io.github.isaac-levine/forage

编码与调试

by isaac-levine

Self-improving tool discovery for AI agents. Find, install, and use new MCP servers automatically.

什么是 io.github.isaac-levine/forage

Self-improving tool discovery for AI agents. Find, install, and use new MCP servers automatically.

README

<div align="center">

🌿 Forage

Self-improving tool discovery for AI agents.

Install one MCP server. Your agent finds the rest.

npm version npm downloads License: MIT

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 --> <!-- ![Forage demo](assets/demo.gif) -->

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:

code
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

bash
claude mcp add forage -- npx -y forage-mcp

Cursor

bash
npx forage-mcp init --client cursor

That's it. Start a new session and Forage is ready.

Tools

ToolDescription
forage_searchSearch for MCP servers across the Official MCP Registry, Smithery, and npm
forage_evaluateGet details on a package — downloads, README, install command
forage_installInstall and start an MCP server as a proxied subprocess (requires user approval)
forage_learnWrite usage instructions to CLAUDE.md / AGENTS.md / .cursor/rules/
forage_statusList all installed and running tools
forage_uninstallRemove a tool and clean up rules

How It Works

Forage is a gateway/proxy MCP server:

  1. You install Forage once — it's the only MCP server you configure manually
  2. Forage discovers tools — searches the Official MCP Registry, Smithery, and npm in parallel
  3. Forage installs tools — starts them as child processes, wraps their capabilities
  4. No restart needed — emits list_changed notifications so the agent picks up new tools instantly
  5. Knowledge persistsforage_learn writes to agent rule files, manifest auto-starts tools next session
<details> <summary><strong>Architecture</strong></summary>
code
┌─────────────────────────────────────────────┐
│  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:

  1. Forage runs npx -y <package> as a child process
  2. Connects to it via StdioClientTransport (MCP client)
  3. Discovers the child server's tools via listTools
  4. Re-registers each tool on the Forage server with a namespaced name (foraged__<server>__<tool>)
  5. Sends tools/list_changed notification — the agent sees new tools immediately
  6. 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/:

FilePurpose
manifest.jsonInstalled tools, command/args, auto-start configuration
install-log.jsonAudit 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:

bash
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_install call requires confirm: 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

bash
git clone https://github.com/isaac-levine/forage.git
cd forage
npm install
npm run build

Test locally with Claude Code:

bash
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 .env files
  • forage doctor — diagnose common setup issues

Distribution

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

MIT

常见问题

io.github.isaac-levine/forage 是什么?

Self-improving tool discovery for AI agents. Find, install, and use new MCP servers automatically.

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描164.6k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描164.6k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描164.6k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
88.1k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
58.6k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
49.4k

评论