Self-improving tool discovery for AI agents. Find, install, and use new MCP servers automatically.
Self-improving tool discovery for AI agents.
Install one MCP server. Your agent finds the rest.
npm Β· GitHub Β· Contributing
Forage is an MCP server that lets AI agents discover, install, and learn to use new tools β automatically. When an agent hits a wall, it forages for the right tool, installs it, and teaches itself how to use it. No restarts. No manual config. The agent gets permanently smarter.
AI coding agents are limited to whatever tools they're configured with at session start. Need to query a database? Deploy to Vercel? Search Slack? The agent apologizes and you manually install the right MCP server.
Forage closes that loop:
Agent encounters a task it can't do
β forage_search("query postgres database")
β forage_install("@modelcontextprotocol/server-postgres")
β Tools available IMMEDIATELY (no restart)
β forage_learn() saves instructions to CLAUDE.md
β Next session: auto-starts, agent already knows how to use it
Claude Code
claude mcp add forage -- npx -y forage-mcp
Cursor
npx forage-mcp init --client cursor
That's it. Start a new session and Forage is ready.
| Tool | Description |
|---|---|
forage_search | Search for MCP servers across the Official MCP Registry, Smithery, and npm |
forage_evaluate | Get details on a package β downloads, README, install command |
forage_install | Install and start an MCP server as a proxied subprocess (requires user approval) |
forage_learn | Write usage instructions to CLAUDE.md / AGENTS.md / .cursor/rules/ |
forage_status | List all installed and running tools |
forage_uninstall | Remove a tool and clean up rules |
Forage is a gateway/proxy MCP server:
list_changed notifications so the agent picks up new tools instantlyforage_learn writes to agent rule files, manifest auto-starts tools next sessionβββββββββββββββββββββββββββββββββββββββββββββββ
β Claude Code / Cursor / Codex β
β β
β "I need to query a Postgres database" β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β MCP
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Forage MCP Server β
β β
β forage_search βββ Official Registry β
β forage_install Smithery β
β forage_learn npm β
β forage_status β
β β
β βββββββββββββββ βββββββββββββββ β
β β Postgres MCPβ β GitHub MCP β ... β
β β (subprocess)β β (subprocess)β β
β βββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
When you install a tool through Forage:
npx -y <package> as a child processStdioClientTransport (MCP client)listToolsforaged__<server>__<tool>)tools/list_changed notification β the agent sees new tools immediatelyForage stores its state in ~/.forage/:
| File | Purpose |
|---|---|
manifest.json | Installed tools, command/args, auto-start configuration |
install-log.json | Audit trail of all installs and uninstalls |
cache/ | Cached registry search results |
On startup, Forage reads the manifest and auto-starts all previously installed servers. Your agent picks up right where it left off.
Forage also includes a CLI for humans:
forage search "postgres database" # Search registries
forage list # List installed tools
forage init # Set up for Claude Code
forage init --client cursor # Set up for Cursor
[!IMPORTANT] Forage cannot install tools without explicit user approval. Every
forage_installcall requiresconfirm: true.
~/.forage/install-log.jsongit clone https://github.com/isaac-levine/forage.git
cd forage
npm install
npm run build
Test locally with Claude Code:
claude mcp add forage-dev -- node /path/to/forage/dist/server.js
See CONTRIBUTING.md for more details.
forage update β check for newer versions of installed tools.env filesforage doctor β diagnose common setup issuesSource-derived launch command. Check the maintainerβs required arguments and credentials before running:
npx -y forage-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-isaac-levine-forage": {
"command": "npx",
"args": [
"-y",
"forage-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the clientβs tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceforage-mcpnpmio.github.isaac-levine/forage works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.