Socket MCP Server
The Socket MCP Server enables AI assistants to check security and quality scores for software dependencies across multiple package ecosystems.
Dependency Security Scanning: Fetches comprehensive metrics (supply chain, quality, maintenance, vulnerability, and license scores) for packages via the
depscoretool.Multi-Ecosystem Support: Covers npm, PyPI, cargo, gem, golang, maven, nuget, and more.
Batch Processing: Analyze multiple dependencies in a single request.
Version & Platform Awareness: Specify exact versions or use
'unknown'; optionally provide an OS-architecture hint (e.g.,linux-x64) for platform-specific results.AI Assistant Integration: Works seamlessly with Claude, VS Code Copilot, Cursor, and other MCP clientsβallowing proactive dependency checks as code is written or reviewed.
Customizable AI Rules: Define custom rules (e.g., in
CLAUDE.md,.cursor/rules) to guide how AI assistants handle low security scores.Flexible Deployment: Use the public hosted service (
https://mcp.socket.dev/) with no API key or authentication required, or run locally via stdio or HTTP mode.Health Check Endpoint: A
/healthendpoint is available in HTTP mode for monitoring service status.Read-Only & Safe: The tool never modifies code or dependencies.
Integrates with GitHub Copilot in VS Code to provide dependency security scanning capabilities through the Socket MCP server.
Enables querying security and quality information for npm packages, including comprehensive security scores for dependency analysis.
Allows checking security scores and vulnerability information for Python packages from the PyPI ecosystem.
Provides tools for checking dependency security scores and vulnerability information across package ecosystems like npm, PyPI, and Cargo, including supply chain, quality, maintenance, vulnerability, and license metrics.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Socket MCP Servercheck security score for express version 4.18.2"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Socket MCP Server
A Model Context Protocol (MCP) server for Socket integration β lets AI assistants query dependency vulnerability scores and security metadata.
Why this repo exists
Socket MCP exposes Socket.dev's package-scoring API through the Model Context Protocol, so any MCP-aware AI assistant (Claude, VS Code Copilot, Cursor, Windsurf) can score a package, audit a package.json, or flag risky dependencies as part of a conversation. It ships as both a hosted public server (https://mcp.socket.dev/, no setup) and a self-hostable npm package, so you can choose between zero-friction and full data isolation.
Related MCP server: MCP NVD Server
β¨ Features
π Dependency Security Scanning - Get comprehensive security scores for npm, PyPI, cargo, Maven, NuGet, RubyGems, Go Modules, and more (supported ecosystems)
π Public Hosted Service - Use our public server at
https://mcp.socket.dev/with no setup requiredπ Multiple Deployment Options - Run locally via stdio, HTTP, or use our service
π€ AI Assistant Integration - Works seamlessly with Claude, VS Code Copilot, Cursor, and other MCP clients
π Batch Processing - Check multiple dependencies in a single request
π No Authentication Required - Public server requires no API keys or registration
π οΈ This project is in early development and rapidly evolving.
Install
Option 1: Use the public Socket MCP server (recommended)
The easiest way to get started. No API key or authentication required! Click a button below to install in your favorite AI assistant.
Custom integrations are not available to all paid versions of Claude. Checkhere for more information.
In Claude Desktop, go to Settings > Developer > Edit Config.
Add the Socket MCP server configuration:
{
"mcpServers": {
"socket-mcp": {
"type": "http",
"url": "https://mcp.socket.dev/"
}
}
}Save the configuration and restart Claude Desktop.
Now you can ask Claude "Check the security score for express version 4.18.2".
For Claude Code:
claude mcp add --transport http socket-mcp https://mcp.socket.dev/# For VS Code with GitHub Copilot
code --add-mcp '{"name":"socket-mcp","type":"http","url":"https://mcp.socket.dev/"}'Or add to .vscode/mcp.json:
{
"servers": {
"socket-mcp": {
"type": "http",
"url": "https://mcp.socket.dev/"
}
}
}Cursor Settings β MCP β Add new MCP Server. Name socket-mcp, http type, URL https://mcp.socket.dev/.
{
"mcpServers": {
"socket-mcp": {
"type": "http",
"url": "https://mcp.socket.dev/"
}
}
}Windsurf does not supporthttp type MCP servers yet. Use the stdio configuration in Option 2 below.
{
"mcpServers": {
"socket-mcp": {
"serverUrl": "https://mcp.socket.dev/mcp"
}
}
}Factory is an AI-powered software engineering platform. Install the Socket MCP server with the Factory CLI:
droid mcp add socket https://mcp.socket.dev/ --type httpTo self-host with an API key instead, see Option 2 below and register the stdio command with droid mcp add.
Alternatively, type /mcp within the Factory droid to manage MCP servers from an interactive UI. Learn more in the Factory MCP documentation.
Option 2: Self-host the Socket MCP server
To run your own instance, create an API key first (only the packages:list permission scope is needed; see creating-and-managing-api-tokens).
Claude Code:
claude mcp add socket-mcp -e SOCKET_API_TOKEN="your-api-token-here" -- npx -y @socketsecurity/mcp@latest # socket-hook: allow npxMost other MCP clients:
{
"mcpServers": {
"socket-mcp": {
"command": "npx", // socket-hook: allow npx
"args": ["@socketsecurity/mcp@latest"],
"env": {
"SOCKET_API_TOKEN": "your-api-token-here"
}
}
}
}Run the server in HTTP mode using npx:
MCP_HTTP_MODE=true SOCKET_API_TOKEN=your-api-token npx @socketsecurity/mcp@latest --http # socket-hook: allow npxEnvironment variables for HTTP mode:
Variable | Required | Default | Description |
| Required unless OAuth is enabled | None | Socket API token used for outbound API calls. Legacy aliases ( |
| Set together with the two introspection vars to enable OAuth | None | OAuth issuer URL used for metadata discovery and incoming bearer-token validation. |
| With OAuth | None | Client ID used for token introspection. |
| With OAuth | None | Client secret used for token introspection. |
| No |
| Space-delimited scopes required on incoming access tokens. |
| No | Production Socket API URL, or localhost when | Override the upstream Socket API endpoint. Useful for local development and testing. |
| No |
| Switches the default upstream Socket API endpoint to localhost when |
| No |
| When |
| HTTP mode only |
| Port to bind the HTTP server to. |
SOCKET_API_URL and SOCKET_DEBUG also apply in stdio mode.
To enable OAuth-backed auth for incoming MCP requests:
MCP_HTTP_MODE=true \
SOCKET_OAUTH_ISSUER=https://issuer.example.com \
SOCKET_OAUTH_INTROSPECTION_CLIENT_ID=your-client-id \
SOCKET_OAUTH_INTROSPECTION_CLIENT_SECRET=your-client-secret \
npx @socketsecurity/mcp@latest --http # socket-hook: allow npxAdd TRUST_PROXY=true only when the server is deployed behind a trusted reverse proxy or load balancer that normalizes the forwarded host and protocol headers.
Configure your MCP client to connect to the HTTP server:
{
"mcpServers": {
"socket-mcp": {
"type": "http",
"url": "http://localhost:3000"
}
}
}Usage
Once installed, ask your AI assistant questions like:
"Check the security score for express version 4.18.2"
"Analyze the security of my package.json dependencies"
"What are the vulnerability scores for react, lodash, and axios?"
Tools exposed
depscore
Query the Socket API for dependency scoring information. Returns supply chain, quality, maintenance, vulnerability, and license scores per package.
Parameter | Type | Required | Default | Description |
| Array | β Yes | - | Array of package objects to analyze |
| String | No |
| Package ecosystem. See Supported ecosystems below. |
| String | β Yes | - | Name of the dependency/package |
| String | No |
| Version of the dependency |
Supported ecosystems
Based on Socket's language support. The ecosystem parameter maps to PURL types:
Ecosystem | PURL type | Package managers | Maturity |
JavaScript & TypeScript |
| npm, yarn, pnpm, Bun, VLT | GA |
Python |
| uv, pip, Poetry, Anaconda | GA |
Go |
| Go Modules | GA |
Java / Scala / Kotlin |
| Maven, Gradle, sbt | GA |
Ruby |
| Bundler | GA |
.NET (C#, F#, VB) |
| NuGet | GA |
Rust |
| cargo | GA |
PHP |
| Composer | Experimental |
GitHub Actions |
| GitHub Actions workflows | Experimental (workflow scanning, not package-level) |
Example request:
{
"packages": [
{ "ecosystem": "npm", "depname": "express", "version": "4.18.2" },
{ "ecosystem": "pypi", "depname": "fastapi", "version": "0.100.0" }
]
}Sample response:
pkg:npm/express@4.18.2: supply_chain: 1.0, quality: 0.9, maintenance: 1.0, vulnerability: 1.0, license: 1.0
Report: https://socket.dev/npm/package/express
pkg:pypi/fastapi@0.100.0: supply_chain: 1.0, quality: 0.95, maintenance: 0.98, vulnerability: 1.0, license: 1.0
Report: https://socket.dev/pypi/package/fastapiAdjusting tool usage via client rules
You can customize how the MCP server interacts with your AI assistant by editing your client's rules file:
MCP Client | Rules File Location |
Claude Desktop/Code |
|
VSCode Copilot |
|
Cursor |
|
Example rule:
Always check dependency scores with the depscore tool when you add a new dependency. If the score is low, consider using an alternative library or writing the code yourself.Claude Code Hook (Optional)
The repo ships an optional Claude Code hook that blocks high-risk packages before installation. When Claude Code runs an install command, the hook queries the public Socket MCP server at https://mcp.socket.dev/ and denies the install when the package's supply chain score is below 20 (known malware, typosquats, high-risk supply chain signals). No API key, no CLI, no registration β copy the file and wire it up.
Supported ecosystems and package managers:
Ecosystem | Commands |
npm |
|
PyPI |
|
Cargo |
|
RubyGems |
|
Go |
|
NuGet |
|
Setup
Prerequisites: Node.js 22+.
Copy the whole
socket-gatedirectory into your hooks folder. The bundledsocket-gate.cjsis self-contained, so it runs without any dependencies beside it. From a checkout, runpnpm run buildfirst to produce it; from a published install, copy fromnode_modules/@socketsecurity/mcp/:
mkdir -p ~/.claude/hooks
cp -R hooks/socket-gate ~/.claude/hooks/Add to
~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "node ~/.claude/hooks/socket-gate/socket-gate.cjs"
}
]
}
]
}
}See hooks/socket-gate/README.md for the full
reference.
How it works
The hook denies installation when supplyChain < 20, allows it otherwise β e.g. express/lodash/react (75β97) allow, browserlist (typosquat of browserslist, 15) and confirmed malware (0) block. Network, timeout, or parse errors all fail open, so a Socket outage will not block legitimate work.
Limitations
A best-effort guardrail, not a complete defense. Known gaps:
Manifest edits + lockfile installs. If Claude edits a manifest directly (
package.json,requirements.txt,Cargo.toml,Gemfile,go.mod,*.csproj) then runs a bare install (npm install,pip install -r requirements.txt,cargo build,bundle install,go mod tidy,dotnet restore), there is no package name on the command line to check.Package-manager invocations only. Direct downloads (
curl | sh,wget), post-install scripts of already-accepted packages, and transitive dependencies are not re-checked.Indirect Claude paths. Sub-agents, MCP tools that shell out, and non-
Bashtool calls are not covered unless thematcheris broadened.
Inspired by Jimmy Vo's dependency hook.
Development
git clone https://github.com/SocketDev/socket-mcp.git
cd socket-mcp
npm install
npm run buildRun from source (stdio mode):
export SOCKET_API_TOKEN=your_api_token_here
node --experimental-strip-types index.tsOr in HTTP mode:
MCP_HTTP_MODE=true SOCKET_API_TOKEN=your_api_token_here node --experimental-strip-types index.ts --httpHealth check endpoint
When running in HTTP mode, GET /health returns:
{
"status": "healthy",
"service": "socket-mcp",
"version": "0.0.3",
"timestamp": "2025-06-17T20:45:22.059Z"
}Suitable for Kubernetes liveness/readiness probes, Docker health checks, load balancers.
Troubleshooting
Q: The public server isn't responding β Check the URL https://mcp.socket.dev/, verify your MCP client configuration, restart your MCP client.
Q: Local server fails to start β Ensure Node.js v16+ is installed, check SOCKET_API_TOKEN is set, verify the API token has packages:list permission.
Q: Getting authentication errors with local server β Double-check your API key is valid, ensure packages:list scope, regenerate if needed.
Q: AI assistant can't find the depscore tool β Restart your MCP client after configuration changes, verify config is saved, check the server is running.
Getting help
π Socket Documentation
π Report Issues
π¬ Community Support
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SocketDev/socket-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server