Socket MCP Server
Socket MCP Server
A Model Context Protocol (MCP) server for Socket integration, allowing AI assistants to efficiently check dependency vulnerability scores and security information.
✨ Features
🔍 Dependency Security Scanning - Get comprehensive security scores for npm, PyPI, and other package 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.
Related MCP server: MCP NVD Server
🚀 Quick Start
Option 1: Use the Public Socket MCP Server (Recommended)
The easiest way to get started is to use our public Socket MCP server. No API key or authentication required! Click a button below to install the public server in your favorite AI assistant.
Custom integrations are not available to all paid versions of Claude. Checkhere for more information.
To use the public Socket MCP server with Claude Desktop:
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 questions like "Check the security score for express version 4.18.2".
The process is similar for Claude Code. See the Claude Code documentation for more details. Here's an example command to add the Socket MCP server:
claude mcp add --transport http socket-mcp https://mcp.socket.dev/You can install the Socket MCP server using the VS Code CLI:
# For VS Code with GitHub Copilot
code --add-mcp '{"name":"socket-mcp","type":"http","url":"https://mcp.socket.dev/}'After installation, the Socket MCP server will be available for use with your GitHub Copilot agent in VS Code.
Alternatively, you can manually add it to your VS Code MCP configuration in .vscode/mcp.json:
{
"servers": {
"socket-mcp": {
"type": "http",
"url": "https://mcp.socket.dev/"
}
}
}Go to Cursor Settings -> MCP -> Add new MCP Server. Name it "socket-mcp", use http type with 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 below.
To use the Socket MCP server in Windsurf:
Open Windsurf Settings
Navigate to MCP Servers section
Add a new server with the following configuration:
{
"mcpServers": {
"socket-mcp": {
"serverUrl": "https://mcp.socket.dev/mcp"
}
}
}Save the configuration and restart Windsurf if needed.
Option 2: Deploy Socket MCP Server on your machine
If you prefer to run your own instance, you can deploy the Socket MCP server locally using either stdio or HTTP modes.
Getting an API key
To use a local Socket MCP Server, you need to create an API key. You can do this by following these steps. The only required permission scope is packages:list, which allows the MCP server to query package metadata for dependency scores.
For local deployment, you have two options:
Option 2a: Stdio Mode (Default)
Click a button below to install the self-hosted stdio server in your favorite AI assistant.
Claude Code (stdio mode) can be set up with the following command:
claude mcp add socket-mcp -e SOCKET_API_KEY="your-api-key-here" -- npx -y @socketsecurity/mcp@latestThis is how the configuration looks like on most MCP clients:
{
"mcpServers": {
"socket-mcp": {
"command": "npx",
"args": ["@socketsecurity/mcp@latest"],
"env": {
"SOCKET_API_KEY": "your-api-key-here"
}
}
}
}This approach automatically uses the latest version without requiring global installation.
Option 2b: HTTP Mode
Run the server in HTTP mode using npx:
MCP_HTTP_MODE=true SOCKET_API_KEY=your-api-key npx @socketsecurity/mcp@latest --httpHTTP mode supports these environment variables:
Variable
Required
Default
Description
SOCKET_API_KEYRequired unless OAuth is enabled
None
Socket API key used for outbound API calls. If unset in OAuth-enabled HTTP mode, the validated incoming bearer token is forwarded upstream instead.
SOCKET_OAUTH_ISSUERSet together with the two introspection vars to enable OAuth
None
OAuth issuer URL used for metadata discovery and incoming bearer-token validation.
SOCKET_OAUTH_INTROSPECTION_CLIENT_IDWith OAuth
None
Client ID used for token introspection.
SOCKET_OAUTH_INTROSPECTION_CLIENT_SECRETWith OAuth
None
Client secret used for token introspection.
SOCKET_OAUTH_REQUIRED_SCOPESNo
packages:listSpace-delimited scopes required on incoming access tokens.
SOCKET_API_URLNo
Production Socket API URL, or localhost when
SOCKET_DEBUG=trueOverride the upstream Socket API endpoint. Useful for local development and testing.
SOCKET_DEBUGNo
falseSwitches the default upstream Socket API endpoint to localhost when
SOCKET_API_URLis unset.TRUST_PROXYNo
falseWhen
true, trustX-Forwarded-HostandX-Forwarded-Protowhen building OAuth metadata URLs. Enable only behind a trusted reverse proxy that rewrites these headers.MCP_PORTHTTP mode only
3000Port to bind the HTTP server to.
SOCKET_API_URLandSOCKET_DEBUGalso apply in stdio mode. In OAuth-enabled HTTP mode, ifSOCKET_API_KEYis unset, the authenticated client's bearer token is forwarded to the Socket API. That token therefore must also be accepted by the configured upstream Socket API.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 --httpAdd
TRUST_PROXY=trueonly 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" } } }
Tools exposed by the Socket MCP Server
depscore
The depscore tool allows AI assistants to query the Socket API for dependency scoring information. It provides comprehensive security and quality metrics for packages across different ecosystems.
Parameters:
Parameter | Type | Required | Default | Description |
| Array | ✅ Yes | - | Array of package objects to analyze |
| String | No |
| Package ecosystem ( |
| String | ✅ Yes | - | Name of the dependency/package |
| String | No |
| Version of the dependency |
Example Usage:
{
"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
pkg:pypi/fastapi@0.100.0: supply_chain: 1.0, quality: 0.95, maintenance: 0.98, vulnerability: 1.0, license: 1.0How to Use the Socket MCP Server
Ask your AI assistant to check dependencies:
"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?"
Get comprehensive security insights including supply chain, quality, maintenance, vulnerability, and license scores.
Adjust tool usage with custom rules
You can further customize how the Socket MCP server interacts with your AI assistant by modifying your client rules. The rules are usually a markdown file and its location depends on the AI assistant you are using.
MCP Client | Rules File Location |
Claude Desktop/Code |
|
VSCode Copilot |
|
Cursor |
|
Rules that can be added to the client rules file include the following:
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. If you are unsure about the score, ask for a review from someone with more experience. When checking dependencies, make sure to also check the imports not just the pyproject.toml/package.json/dependency file.You can adjust the rules to fit your needs. For example, you can add rules to include specific manifest files, or guide the AI assistant on how to handle low scores. The rules are flexible and can be tailored to your workflow.
Development
For End Users
For most users, we recommend using either:
Public server:
https://mcp.socket.dev/(no setup required)NPX command:
npx @socketsecurity/mcp@latest(always latest version)
For Contributors
If you want to contribute to the Socket MCP server development:
Health Check Endpoint
When running in HTTP mode, the server provides a health check endpoint for Kubernetes and Docker deployments:
GET /healthResponse:
{
"status": "healthy",
"service": "socket-mcp",
"version": "0.0.3",
"timestamp": "2025-06-17T20:45:22.059Z"
}This endpoint can be used for:
Kubernetes liveness and readiness probes
Docker health checks
Load balancer health monitoring
General service monitoring
Prerequisites
Node.js v16 or higher
npm or yarn
Installation
Clone the repository and install dependencies:
git clone https://github.com/SocketDev/socket-mcp.git
cd socket-mcp
npm installBuild
This project is a directly runnable Node.js project using Type stripping.
If you are on Node.js 22, run with node --experimental-strip-types index.ts.
On any later versions of Node.js, you can simply run node index.ts.
In either version you can also run the npm run scripts which include the correct flags.
The js files will automatically be build when running npm publish, and cleaned up afterwards with npm run clean.
If you want to preview the build you can run:
npm run buildRun from Source
To run the Socket MCP server from source:
export SOCKET_API_KEY=your_api_key_here
node --experimental-strip-types index.tsOr in HTTP mode:
MCP_HTTP_MODE=true SOCKET_API_KEY=your_api_key_here node --experimental-strip-types index.ts --http🔧 Troubleshooting
Common Issues
Q: The public server isn't responding
Check that you're using the correct URL:
https://mcp.socket.dev/Verify your MCP client configuration is correct
Try restarting your MCP client
Q: Local server fails to start
Ensure you have Node.js v16+ installed
Check that your
SOCKET_API_KEYenvironment variable is setVerify the API key has
packages:listpermission
Q: Getting authentication errors with local server
Double-check your Socket API key is valid
Ensure the key has the required
packages:listscopeTry regenerating your API key from the Socket dashboard
Q: AI assistant can't find the depscore tool
Restart your MCP client after configuration changes
Verify the server configuration is saved correctly
Check that the MCP server is running (for local deployments)
Getting Help
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables AI-powered analysis of NPM packages through multiple tools for security vulnerability scanning, dependency analysis, package comparison, and quality assessment.Last updated12193,72418TypeScriptMIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that retrieves CVE information from the National Vulnerability Database, allowing AI models to access up-to-date vulnerability data.Last updated17Apache 2.0
- AlicenseAqualityDmaintenanceA Model Context Protocol server providing security vulnerability intelligence tools including CVE lookup, EPSS scoring, CVSS calculation, exploit detection, and Python package vulnerability checking.Last updated89MIT
- Alicense-qualityDmaintenanceA security-focused MCP server that enables AI assistants to search PyPI packages, scan for vulnerabilities, audit dependencies, and ensure security across Python projects.Last updated4MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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