Socket MCP Server

Socket's dependency risk scores, org alerts and package file inspection for MCP clients

Official · socket.dev TypeScript Remote (hosted) · Streamable HTTPLocal · stdio SecurityDeveloper tools

41 popularity score ↓ 15k/wk

Connect your client

Remote (hosted)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude Codeterminal
claude mcp add --transport http socket-mcp https://mcp.socket.dev/
Claude (desktop and web)Customize > Connectors > Add custom connector, URL https://mcp.socket.dev/
https://mcp.socket.dev/
VS Code.vscode/mcp.json
{
  "servers": {
    "socket-mcp": {
      "type": "http",
      "url": "https://mcp.socket.dev/"
    }
  }
}
CursorCursor MCP settings (mcp.json)
{
  "mcpServers": {
    "socket-mcp": {
      "type": "http",
      "url": "https://mcp.socket.dev/"
    }
  }
}
windsurfWindsurf MCP config
{
  "mcpServers": {
    "socket-mcp": {
      "serverUrl": "https://mcp.socket.dev/mcp"
    }
  }
}
factoryterminal
droid mcp add socket https://mcp.socket.dev/ --type http
Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs SOCKET_API_TOKEN. Replace each <NAME> with your value.

FirstTerminal
pnpm add -g @socketsecurity/mcp
Claude CodeTerminal
claude mcp add socket -e SOCKET_API_TOKEN=<SOCKET_API_TOKEN> -- socket-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "socket": {
      "command": "socket-mcp",
      "args": [],
      "env": {
        "SOCKET_API_TOKEN": "<SOCKET_API_TOKEN>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "socket": {
      "command": "socket-mcp",
      "args": [],
      "env": {
        "SOCKET_API_TOKEN": "<SOCKET_API_TOKEN>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "socket": {
      "type": "stdio",
      "command": "socket-mcp",
      "args": [],
      "env": {
        "SOCKET_API_TOKEN": "<SOCKET_API_TOKEN>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.socket]
command = "socket-mcp"
args = []

[mcp_servers.socket.env]
SOCKET_API_TOKEN = "<SOCKET_API_TOKEN>"
Gemini CLITerminal
gemini mcp add --scope user -e SOCKET_API_TOKEN=<SOCKET_API_TOKEN> socket socket-mcp

Settings 8

SOCKET_API_TOKEN Required: Socket API token (packages:list scope at least). Also read as SOCKET_API_KEY, SOCKET_CLI_API_TOKEN, SOCKET_CLI_API_KEY, SOCKET_SECURITY_API_TOKEN or SOCKET_SECURITY_API_KEY.
MCP_HTTP_MODE Optional: Set to true (or pass --http) to serve HTTP instead of stdio.
MCP_PORT Optional: Port for HTTP mode; 3000 by default.
SOCKET_API_BASE_URL Optional: Overrides the Socket API address; https://api.socket.dev when unset.
SOCKET_OAUTH_ISSUER Optional: HTTP mode: OAuth issuer URL; set together with the two introspection settings or not at all.
SOCKET_OAUTH_INTROSPECTION_CLIENT_ID Optional: HTTP mode with OAuth: client ID for token introspection.
SOCKET_OAUTH_INTROSPECTION_CLIENT_SECRET Optional: HTTP mode with OAuth: client secret for token introspection.
SOCKET_DEBUG Optional: Verbose request tracing on stderr; also points depscore at localhost:8866, so only for local development.

What it does

Socket MCP Server connects an MCP client to Socket's supply-chain data, so an assistant can look up how risky a dependency is before you add it. The depscore tool takes a batch of packages (npm by default, also PyPI, Go, Maven, RubyGems, NuGet, Cargo, Composer and other PURL types) and returns Socket's score components for each, with a link to the package report.

With a Socket account, three more tools reach your organization's data: organizations finds your org slug, alerts lists the open or cleared issues Socket has raised on the packages your org monitors, and threat_feed pages through packages Socket has flagged as malware, typosquats or obfuscated code. Three further tools look inside a published package without installing it: package_files lists its files with sizes and hashes, package_file_contents reads one file (up to 1 MB of text; binary files give metadata only) and package_file_grep searches one file with a regular expression, returning up to 100 matching lines by default and at most 500.

You can connect to Socket's hosted server at https://mcp.socket.dev/, which signs in with OAuth, or run the socket-mcp program yourself over stdio or HTTP with a Socket API token. The tools registered in lib/server.mts at v0.2.1 are the same seven the service reference lists. In self-hosted HTTP mode the code only lets depscore fall back to the operator's startup token; the org-scoped tools need each caller's own token and return an authentication error without one, so one deployment does not expose the operator's org data to everyone who can reach it. The repository also ships an optional Claude Code hook that blocks package installs scoring below 20 on supply chain; it is separate from the MCP tools.

What it needs

To run it yourselfNode.js 24+

Hosted: a Socket account to complete the OAuth sign-in; on Claude Team and Enterprise plans an organization owner must add the custom connector first. Self-hosted: Node.js 24 or later, the package installed globally (pnpm add -g @socketsecurity/mcp), and a Socket API token from the socket.dev dashboard with the packages:list scope; the org tools need whatever extra scopes your organization's endpoints require.

Limits

Its makers call it early-stage and fast-changing. In stdio mode one token is read at startup; without it every API-backed tool returns an authentication message, and only package_file_contents and package_file_grep work. alerts returns 100 results per page by default (up to 5000) and threat_feed 30 (up to 100). Self-hosted HTTP mode listens on port 3000 unless MCP_PORT is set and refuses request bodies over 4 MiB. Windsurf cannot use the http connection type; its docs give a serverUrl form or the stdio setup instead. The bundled hook is best-effort: it misses installs from edited manifests, direct downloads and transitive dependencies, and allows installs when Socket is unreachable.

Who it suits

Developers who want an assistant to check a package's supply-chain risk or read what a published package actually contains before adding it. The hosted endpoint suits individuals who would rather sign in once with OAuth than handle a token; self-hosting over stdio suits one developer with an API token who wants calls to go straight from their own machine, and HTTP mode suits a team running one shared instance behind its own OAuth issuer. All tools only read data, so it does not fix or update dependencies. The org alert and threat feed tools are only useful if your organization already uses Socket.

Tools 7

depscore
Gets Socket's risk score components for a batch of packages across ecosystems, with report links.
organizations
Lists the Socket organizations your token belongs to, giving the slug the org tools need.
alerts
Lists an organization's security, quality, licence and maintenance alerts, with filters and paging.
threat_feed
Pages through packages Socket has flagged for an organization, such as malware or typosquats.
package_files
Lists the files in a published package version with their sizes and blob hashes.
package_file_contents
Reads one file from a package by its blob hash, up to 1 MB of text.
package_file_grep
Searches one package file by blob hash with a regular expression and returns numbered matches.

Similar servers