The MCP Security Analyst server provides security analysis capabilities by integrating with OSV.dev and AI models to help identify and analyze potential vulnerabilities in your codebase. It works through the Model Context Protocol (MCP) to seamlessly integrate with various AI tools and provide security insights.
make deps
make install
For enhanced static code analysis, you can install Semgrep:
brew install semgrep
python3 -m pip install semgrep
For other platforms, visit the Semgrep Installation Guide for detailed instructions.
Note that the MCP server will work without Semgrep installed, but will skip the static analysis portion when analyzing directories.
To install the MCP Security Analyst:
make deps
make install
After installation, the mcp-osv
command will be available on your PATH and will use the stdin/stdout method for communication.
The server provides the following security analysis tools:
This tool checks for known vulnerabilities in dependencies using the OSV.dev database.
Parameters:
package_name
: Name of the package to checkversion
: Version of the package to checkThis tool analyzes code for potential security issues based on OSV.dev database.
Parameters:
file_path
: Path to the file to analyzemcp.json-template
file for a configuration example that works with Cursor IDE.To connect the MCP Security Analyst with Claude, edit the config file and add the following section:
{
"mcpServers": {
"mcp_osv": {
"command": "/usr/local/bin/mcp-osv",
"args": []
}
}
}
If you already have other tools installed, just add the mcp_osv
section to your existing configuration.
Here are some examples of how to use the MCP Security Analyst:
# Check for vulnerabilities in a package
"Check for vulnerabilities in the package 'express' version '4.17.1'"
# Analyze a specific file
"Analyze the security of the file 'main.go'"
The server will process these requests and provide security insights through your AI assistant using the MCP protocol.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.