You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ A Model Context Protocol (MCP) server for Socket integration, allowing AI assist
9
9
## ✨ Features
10
10
11
11
- 🔍 **Dependency Security Scanning** - Get comprehensive security scores for npm, PyPI, and other package ecosystems
12
+
- 🛡️ **Verdicts + Alerts** - PASS/WARN/FAIL verdicts with Socket alerts for actionable context
13
+
- 🚧 **Claude Code Install Gate (Optional)** - PreToolUse hook to warn/block risky package installs before execution
12
14
- 🌐 **Public Hosted Service** - Use our public server at `https://mcp.socket.dev/` with no setup required
13
15
- 🚀 **Multiple Deployment Options** - Run locally via stdio, HTTP, or use our service
14
16
- 🤖 **AI Assistant Integration** - Works seamlessly with Claude, VS Code Copilot, Cursor, and other MCP clients
@@ -138,6 +140,18 @@ To use the Socket MCP server in Windsurf:
138
140
139
141
If you prefer to run your own instance, you can deploy the Socket MCP server locally using either stdio or HTTP modes.
140
142
143
+
### (Optional) Claude Code Socket Security Gate
144
+
145
+
If you use Claude Code, you can install a PreToolUse hook that intercepts package install commands (npm/pip/cargo/etc.), checks them with Socket, and blocks known malware by default.
This will update `~/.claude/settings.json`, install `~/.claude/hooks/socket-gate.sh`, and print a recommended `.claude/CLAUDE.md` snippet.
154
+
141
155
### Getting an API key
142
156
143
157
To use a local Socket MCP Server, you need to create an API key. You can do this by following [these steps](https://docs.socket.dev/reference/creating-and-managing-api-tokens). The only required permission scope is `packages:list`, which allows the MCP server to query package metadata for dependency scores.
@@ -196,9 +210,21 @@ This approach automatically uses the latest version without requiring global ins
196
210
197
211
## Tools exposed by the Socket MCP Server
198
212
199
-
### depscore
213
+
### check_package
214
+
215
+
Check a single package and return a PASS/WARN/FAIL verdict, category scores, and any Socket alerts.
216
+
217
+
### batch_check
218
+
219
+
Check multiple packages at once and return per-package verdicts, scores, alerts, and a summary.
220
+
221
+
### explain_alert
222
+
223
+
Explain a Socket alert type in plain language (static knowledge base; no API call).
224
+
225
+
### depscore (deprecated)
200
226
201
-
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.
227
+
The `depscore` tool is kept for backward compatibility. Prefer `batch_check`.
202
228
203
229
**Parameters:**
204
230
@@ -257,7 +283,7 @@ You can further customize how the Socket MCP server interacts with your AI assis
257
283
Rules that can be added to the client rules file include the following:
258
284
259
285
```md
260
-
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.
286
+
Before installing or importing a new dependency, check it with the check_package tool (or batch_check for multiple). If the verdict is FAIL, do not proceed. If the verdict is WARN, explain the risks and ask the user how to proceed. When checking dependencies, make sure to also check the imports not just the pyproject.toml/package.json/dependency file.
261
287
```
262
288
263
289
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.
0 commit comments