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 smarte
Add this skill
npx mdskills install isaac-levine/forageMeta-MCP server enabling dynamic tool discovery and installation without restarts
1<div align="center">23# 🌿 Forage45**Self-improving tool discovery for AI agents.**67Install one MCP server. Your agent finds the rest.89[](https://www.npmjs.com/package/forage-mcp)10[](https://www.npmjs.com/package/forage-mcp)11[](LICENSE)1213[npm](https://www.npmjs.com/package/forage-mcp) · [GitHub](https://github.com/isaac-levine/forage) · [Contributing](CONTRIBUTING.md)1415</div>1617---1819Forage 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.2021<!-- TODO: Add demo GIF here -->22<!--  -->2324## Why?2526AI 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.2728Forage closes that loop:2930```31Agent encounters a task it can't do32 → forage_search("query postgres database")33 → forage_install("@modelcontextprotocol/server-postgres")34 → Tools available IMMEDIATELY (no restart)35 → forage_learn() saves instructions to CLAUDE.md36 → Next session: auto-starts, agent already knows how to use it37```3839## Quick Start4041**Claude Code**4243```bash44claude mcp add forage -- npx -y forage-mcp45```4647**Cursor**4849```bash50npx forage-mcp init --client cursor51```5253That's it. Start a new session and Forage is ready.5455## Tools5657| Tool | Description |58|---|---|59| `forage_search` | Search for MCP servers across the [Official MCP Registry](https://registry.modelcontextprotocol.io), [Smithery](https://smithery.ai), and [npm](https://www.npmjs.com) |60| `forage_evaluate` | Get details on a package — downloads, README, install command |61| `forage_install` | Install and start an MCP server as a proxied subprocess (requires user approval) |62| `forage_learn` | Write usage instructions to CLAUDE.md / AGENTS.md / .cursor/rules/ |63| `forage_status` | List all installed and running tools |64| `forage_uninstall` | Remove a tool and clean up rules |6566## How It Works6768Forage is a **gateway/proxy** MCP server:69701. **You install Forage once** — it's the only MCP server you configure manually712. **Forage discovers tools** — searches the Official MCP Registry, Smithery, and npm in parallel723. **Forage installs tools** — starts them as child processes, wraps their capabilities734. **No restart needed** — emits `list_changed` notifications so the agent picks up new tools instantly745. **Knowledge persists** — `forage_learn` writes to agent rule files, manifest auto-starts tools next session7576<details>77<summary><strong>Architecture</strong></summary>7879```80┌─────────────────────────────────────────────┐81│ Claude Code / Cursor / Codex │82│ │83│ "I need to query a Postgres database" │84└──────────────────┬──────────────────────────┘85 │ MCP86 ▼87┌─────────────────────────────────────────────┐88│ Forage MCP Server │89│ │90│ forage_search ─── Official Registry │91│ forage_install Smithery │92│ forage_learn npm │93│ forage_status │94│ │95│ ┌─────────────┐ ┌─────────────┐ │96│ │ Postgres MCP│ │ GitHub MCP │ ... │97│ │ (subprocess)│ │ (subprocess)│ │98│ └─────────────┘ └─────────────┘ │99└─────────────────────────────────────────────┘100```101102When you install a tool through Forage:1031041. Forage runs `npx -y <package>` as a child process1052. Connects to it via `StdioClientTransport` (MCP client)1063. Discovers the child server's tools via `listTools`1074. Re-registers each tool on the Forage server with a namespaced name (`foraged__<server>__<tool>`)1085. Sends `tools/list_changed` notification — the agent sees new tools immediately1096. When the agent calls a proxied tool, Forage forwards the call to the child server110111</details>112113<details>114<summary><strong>Persistence</strong></summary>115116Forage stores its state in `~/.forage/`:117118| File | Purpose |119|---|---|120| `manifest.json` | Installed tools, command/args, auto-start configuration |121| `install-log.json` | Audit trail of all installs and uninstalls |122| `cache/` | Cached registry search results |123124On startup, Forage reads the manifest and auto-starts all previously installed servers. Your agent picks up right where it left off.125126</details>127128## CLI129130Forage also includes a CLI for humans:131132```bash133forage search "postgres database" # Search registries134forage list # List installed tools135forage init # Set up for Claude Code136forage init --client cursor # Set up for Cursor137```138139## Security140141> [!IMPORTANT]142> Forage cannot install tools without explicit user approval. Every `forage_install` call requires `confirm: true`.143144- **Audit trail** — every install/uninstall is logged with timestamps to `~/.forage/install-log.json`145- **No remote backend** — everything runs locally. Registry searches are read-only GET requests to public APIs.146- **No secrets stored** — environment variables for child servers are passed at install time, not persisted.147148## Development149150```bash151git clone https://github.com/isaac-levine/forage.git152cd forage153npm install154npm run build155```156157Test locally with Claude Code:158159```bash160claude mcp add forage-dev -- node /path/to/forage/dist/server.js161```162163See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.164165## Roadmap166167### Features168169- [ ] `forage update` — check for newer versions of installed tools170- [ ] Support for pip/cargo/brew packages (not just npm)171- [ ] Smarter search ranking (weight by downloads, stars, description relevance)172- [ ] Auto-configure environment variables from `.env` files173- [ ] `forage doctor` — diagnose common setup issues174175### Distribution176177- [x] Publish to npm178- [ ] Submit to the [Official MCP Registry](https://registry.modelcontextprotocol.io)179- [ ] Submit to [Smithery](https://smithery.ai)180- [ ] Submit to [mcp.so](https://mcp.so) and [glama.ai](https://glama.ai/mcp/servers)181- [ ] Landing page at forage.dev182183### Community184185- [ ] Demo GIF / video in README186- [ ] Write launch blog post187- [ ] Post to r/ClaudeAI, r/LocalLLaMA, Hacker News (Show HN)188- [ ] Share in MCP Discord / community channels189- [ ] Write use-case guides (e.g. "Add Postgres to Claude Code in 30 seconds")190- [ ] Add GitHub Discussions for Q&A and feature requests191192## License193194[MIT](LICENSE)195
Full transparency — inspect the skill content before installing.