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:
http://localhost:9989/mcp
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:
{
"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:
{
"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:
| Name | forage |
| Type | HTTP |
| URL | http://localhost:9989/mcp |
Alternatively, edit your Windsurf MCP config file directly:
{
"servers": [
{
"name": "forage",
"transport": "http",
"url": "http://localhost:9989/mcp"
}
]
}
VS Code + Copilot
Add Forage to your VS Code workspace settings:
{
"github.copilot.chat.mcp.servers": {
"forage": {
"type": "http",
"url": "http://localhost:9989/mcp"
}
}
}
Continue
Add Forage to your Continue configuration:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "http",
"url": "http://localhost:9989/mcp"
}
}
]
}
}
Zed
Add Forage to your Zed settings:
{
"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.