Socket MCP Server
A Model Context Protocol (MCP) server for Socket integration, allowing AI assistants to efficiently check dependency vulnerability scores and security information.
README
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.
🚀 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.
<details><summary><b>Manual Installation Instructions & more MCP Clients</b></summary>
<details><summary><b>Install in Claude Desktop or Claude Code</b></summary>
[!NOTE] Custom integrations are not available to all paid versions of Claude. Check here 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/
</details>
<details><summary><b>Install in VS Code</b></summary>
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/"
}
}
}
</details>
<details><summary><b>Install in Cursor</b></summary>
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/"
}
}
}
</details>
<details><summary><b>Install in Windsurf</b></summary>
[!WARNING] Windsurf does not support
httptype MCP servers yet. Use thestdioconfiguration 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.
</details>
</details>
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@latest
This 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 --http -
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 |
|---|---|---|---|---|
packages |
Array | ✅ Yes | - | Array of package objects to analyze |
packages[].ecosystem |
String | No | "npm" |
Package ecosystem (npm, pypi, cargo, etc.) |
packages[].depname |
String | ✅ Yes | - | Name of the dependency/package |
packages[].version |
String | No | "unknown" |
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.0
How 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 | CLAUDE.md |
| VSCode Copilot | .github/copilot-instructions.md |
| Cursor | .cursor/rules |
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 /health
Response:
{
"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 install
Build
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 build
Run from Source
To run the Socket MCP server from source:
export SOCKET_API_KEY=your_api_key_here
node --experimental-strip-types index.ts
Or 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 set - Verify 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:listscope - Try 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。