Documentation

MCP Integration

Connect any MCP-compatible AI agent to your Forage knowledge graph.

Overview

Forage runs a Model Context Protocol (MCP) server on your local machine. Any AI agent that supports MCP can connect to it and query your knowledge graph instead of reading raw files — dramatically reducing token consumption per request.

Once Forage is running, the MCP endpoint is available at:

MCP Server URL
http://localhost:9989/mcp
The port can be changed via mcpPort in forage.config.json or from the Settings page in Forage.

Claude Code

Add Forage to your Claude Code MCP configuration. In your project root, create or update .claude.json:

.claude.json
{
  "mcpServers": {
    "forage": {
      "type": "http",
      "url": "http://localhost:9989/mcp"
    }
  }
}

Restart Claude Code. Forage tools will appear in the MCP panel. Claude will automatically use them when answering questions about your codebase.

Cursor

Create or update .cursor/mcp.json in your project root:

.cursor/mcp.json
{
  "mcpServers": {
    "forage": {
      "url": "http://localhost:9989/mcp"
    }
  }
}

Open Cursor Settings → MCP → Reload servers. Forage should appear in the connected servers list.

Windsurf

Open Windsurf and navigate to Settings → AI → MCP Servers. Add a new server with:

Nameforage
TypeHTTP
URLhttp://localhost:9989/mcp

Alternatively, edit your Windsurf MCP config file directly:

~/.windsurf/mcp_config.json
{
  "servers": [
    {
      "name": "forage",
      "transport": "http",
      "url": "http://localhost:9989/mcp"
    }
  ]
}

VS Code + Copilot

Add Forage to your VS Code workspace settings:

.vscode/settings.json
{
  "github.copilot.chat.mcp.servers": {
    "forage": {
      "type": "http",
      "url": "http://localhost:9989/mcp"
    }
  }
}

Continue

Add Forage to your Continue configuration:

~/.continue/config.json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "http",
          "url": "http://localhost:9989/mcp"
        }
      }
    ]
  }
}

Zed

Add Forage to your Zed settings:

~/.config/zed/settings.json
{
  "context_servers": {
    "forage": {
      "settings": {
        "url": "http://localhost:9989/mcp"
      }
    }
  }
}

Troubleshooting

Agent can't connect to Forage
Confirm Forage is running: open http://localhost:9989/mcp in your browser — you should see a JSON response listing available tools. If not, start Forage with forage --start.

Port 9989 already in use
Change the MCP port in forage.config.json, restart Forage with forage --restart, and update your agent config to match. See Configuration.

Tools not showing up in agent
Most agents cache MCP server metadata. Restart the agent after adding Forage to its config.