LangGraph Coding Team MCP server

Create coding agents to generate implementation options.
Back to servers
Setup instructions
Provider
danmas0n
Release date
Feb 07, 2025
Language
Python
Stats
33 stars

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.

Installation

Set Up Dependencies

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 ..

Configure Environment Variables

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: anthropic/claude-3-5-sonnet-20240620
  • OpenAI: openai/gpt-4
  • OpenRouter: openrouter/openai/gpt-4o-mini
  • Google: google/gemini-1.5-pro

Setting Up MCP Servers

Configure MCP Servers

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.

Start the Gateway Server

Launch the gateway server with:

cd gateway
python -m mcp_gateway.server

The server will run on port 8808 by default.

Configuring the Agent

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"
  }
}

Using the Agent

Open the folder in LangGraph Studio to use the agent. It will automatically:

  1. Connect to the gateway server
  2. Discover all available tools
  3. Make these tools available during conversations

Available Tools

Filesystem Tools

  • read_file: Read the contents of a file
  • write_file: Create or update files
  • list_directory: View directory contents
  • search_files: Find files matching specific patterns

Memory Tools

  • create_entities: Add entities to the knowledge graph
  • create_relations: Link entities together
  • search_nodes: Query the knowledge graph

Adding New MCP Servers

To extend functionality with additional MCP servers:

  1. Find a compatible server in the MCP servers repository
  2. Add its configuration to your gateway/config.json file
  3. Restart the gateway server
  4. The agent will automatically discover the new tools

How to install this MCP server

For Claude Code

To 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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later