This MCP (Model Context Protocol) server system provides a framework for coding agents to collaborate and implement coding tasks using LangGraph and MCP tools. The system integrates with various servers to provide tools and capabilities through a unified gateway.
Start by installing the agent and gateway packages:
# Install the agent package
pip install -e .
# Install the gateway package
cd gateway
pip install -e .
cd ..
The system works with multiple LLM providers. Set up your environment with appropriate API keys:
# LLM Configuration
LLM_MODEL=provider/model-name
# API Keys
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
OPENROUTER_API_KEY=your_openrouter_api_key
GOOGLE_API_KEY=your_google_api_key
# OpenRouter Configuration (if applicable)
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
Supported providers and example models include:
anthropic/claude-3-5-sonnet-20240620
openai/gpt-4
openrouter/openai/gpt-4o-mini
google/gemini-1.5-pro
The gateway server uses a configuration file located at gateway/config.json
. The default configuration includes two MCP servers:
{
"mcp": {
"servers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/directory"
]
},
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}
}
You can add more servers from the official MCP servers repository as needed.
Launch the gateway server with:
cd gateway
python -m mcp_gateway.server
The server will run on port 8808 by default.
The agent connects to the gateway through settings in langgraph.json
:
{
"dependencies": ["."],
"graphs": {
"agent": "./src/react_agent/graph.py:graph"
},
"env": ".env",
"mcp": {
"gateway_url": "http://localhost:8808"
}
}
Open the folder in LangGraph Studio to use the agent. It will automatically:
To extend functionality with additional MCP servers:
gateway/config.json
fileTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "filesystem" '{"command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","/path/to/directory"]}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/directory"
]
},
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/directory"
]
},
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect