The Anthropic MCP Code Analyzer is a server that helps you analyze open source projects and integrate them with your existing codebase. It uses Claude to analyze code patterns, architecture, and documentation to provide intelligent merge strategies between repositories.
To get started with the MCP Code Analyzer, follow these steps:
Clone the repository:
git clone https://github.com/kivo360/anthropic-mcp-code-analyzer.git
cd anthropic-mcp-code-analyzer
Install dependencies:
npm install
Set up environment variables:
export ANTHROPIC_API_KEY=your_api_key
export PORT=3000 # Optional, defaults to 3000
Once installed, you can start the server with:
npm start
To analyze repositories and get merge strategies, send a POST request to the analyze endpoint:
curl -X POST http://localhost:3000/analyze \
-H "Content-Type: application/json" \
-d '{
"sourceRepo": "https://github.com/user/source-repo.git",
"targetRepo": "https://github.com/user/target-repo.git"
}'
The server will return a comprehensive analysis including:
The main endpoint for repository analysis:
POST /analyze
Request body:
{
"sourceRepo": "string",
"targetRepo": "string"
}
Verify the server is running properly:
GET /health
The service analyzes both repositories by:
The tool identifies:
Using Claude, the service:
The analyzer also:
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.