SafeDep vet is an open source security tool designed to guard against malicious open source software packages. Its MCP (Model Context Protocol) server provides package review capabilities for AI coding agents, enabling security checks before AI generates code and introduces open source dependencies.
Purpose
The vet MCP server is mainly used during AI-assisted development to perform security review of open source packages intended for use, preventing Slopsquatting attacks, malicious software packages, known vulnerabilities, and other security risks. It is designed to run locally, supports both stdio and SSE transports, and can be integrated with MCP clients such as Claude Code, Cursor, Visual Studio Code, and Codex CLI.
Main capabilities
- Provides tools for MCP clients to call to review open source packages before a project uses AI-generated code.
- Guards against security risks such as Slopsquatting attacks, malicious packages, and vulnerabilities.
- Supports stdio and SSE transports; SSE supports GET (establish an SSE connection to receive real-time events), HEAD (endpoint health check and capability probing, suitable for tools such as Langchain), POST (send messages to the MCP server through the message endpoint).
- In SSE mode, built-in Host and Origin guards are enabled by default, reducing the risk of unauthorized cross-origin access and DNS rebinding attacks. By default, allowed hosts are localhost:9988, 127.0.0.1:9988, [::1]:9988; the default allowed Origin prefix is http://localhost:、http://127.0.0.1:、https://localhost:。未通过主机检查或 Requests that fail the Origin check return 403. Defaults can be overridden via startup flags; non-browser clients can omit the Origin header as long as the host check passes.
- Supports running via Docker image, and can also directly use the vet binary to start the MCP server with stdio transport.
Usage
- Start the MCP server: you can use SSE or stdio transport. Note: avoid using stdout for logging to prevent interfering with MCP server output.
- Configure the MCP client:
- Use the prebuilt Docker image (or build it yourself: docker build -t ghcr.io/safedep/vet:latest .), and add the configuration to the MCP client configuration file. vet uses stdio by default; if SSE is needed, add the parameters "--server-type", "sse". Docker containers need to be updated regularly to the latest version.
- You can also directly use the vet binary with stdio transport as the MCP server.
- Cursor: add the vet-mcp server to .cursor/mcp.json (project level) or ~/.cursor/mcp.json (global), and add rules in .cursor/rules/vet-mcp.mdc.
- Visual Studio Code: add the vet-mcp server to .vscode/mcp.json (project level), or add mcp settings in the user settings settings.json for global use; and add instructions in .github/copilot-instructions.md.
- Claude Code: add configuration in the project's .mcp.json; you can also directly use the vet binary with stdio transport.
- Codex CLI: add configuration in ~/.codex/config.toml so that Codex CLI uses vet as an MCP server to achieve automatic package review.
- If running behind a proxy or using a different port, set both the host and Origin lists to match the environment; for example, when exposing SSE on port 3001, with Docker you need to append the same flags after the container command.
Use Cases
Applicable to teams or individuals using AI coding agents (such as Claude Code, Cursor, VS Code, Codex CLI) for development, who want to automatically perform security review before AI-generated code introduces open-source dependencies, reducing the risk of malicious packages and vulnerabilities.
Limitations
- The list of supported ecosystems is not fully provided in the original material (only mentions “currently supports the following ecosystems” but does not list specific contents), so it is not provided for now.
- Specific tool names, parameter details, and complete configuration example code are not fully shown in the material, so they are not provided for now.
- Docker containers need to be updated regularly to obtain the latest protection.
- SSE mode requires correct configuration of Host and Origin guards; otherwise, legitimate requests may be rejected or security risks may be introduced.