Forage MCP Server
An MCP server that enables AI agents to automatically discover, install, and learn to use new tools without manual configuration.
README
<div align="center">
🌿 Forage
Self-improving tool discovery for AI agents.
Install one MCP server. Your agent finds the rest.
npm · GitHub · Contributing
</div>
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.
<!-- TODO: Add demo GIF here -->
<!--
-->
Why?
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
Quick Start
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.
Tools
| 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 |
How It Works
Forage is a gateway/proxy MCP server:
- You install Forage once — it's the only MCP server you configure manually
- Forage discovers tools — searches the Official MCP Registry, Smithery, and npm in parallel
- Forage installs tools — starts them as child processes, wraps their capabilities
- No restart needed — emits
list_changednotifications so the agent picks up new tools instantly - Knowledge persists —
forage_learnwrites to agent rule files, manifest auto-starts tools next session
<details> <summary><strong>Architecture</strong></summary>
┌─────────────────────────────────────────────┐
│ 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:
- Forage runs
npx -y <package>as a child process - Connects to it via
StdioClientTransport(MCP client) - Discovers the child server's tools via
listTools - Re-registers each tool on the Forage server with a namespaced name (
foraged__<server>__<tool>) - Sends
tools/list_changednotification — the agent sees new tools immediately - When the agent calls a proxied tool, Forage forwards the call to the child server
</details>
<details> <summary><strong>Persistence</strong></summary>
Forage 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.
</details>
CLI
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
Security
[!IMPORTANT] Forage cannot install tools without explicit user approval. Every
forage_installcall requiresconfirm: true.
- Audit trail — every install/uninstall is logged with timestamps to
~/.forage/install-log.json - No remote backend — everything runs locally. Registry searches are read-only GET requests to public APIs.
- No secrets stored — environment variables for child servers are passed at install time, not persisted.
Development
git 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.
Roadmap
Features
- [ ]
forage update— check for newer versions of installed tools - [ ] Support for pip/cargo/brew packages (not just npm)
- [ ] Smarter search ranking (weight by downloads, stars, description relevance)
- [ ] Auto-configure environment variables from
.envfiles - [ ]
forage doctor— diagnose common setup issues
Distribution
- [x] Publish to npm
- [ ] Submit to the Official MCP Registry
- [ ] Submit to Smithery
- [ ] Submit to mcp.so and glama.ai
- [ ] Landing page at forage.dev
Community
- [ ] Demo GIF / video in README
- [ ] Write launch blog post
- [ ] Post to r/ClaudeAI, r/LocalLLaMA, Hacker News (Show HN)
- [ ] Share in MCP Discord / community channels
- [ ] Write use-case guides (e.g. "Add Postgres to Claude Code in 30 seconds")
- [ ] Add GitHub Discussions for Q&A and feature requests
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。