ToolForge MCP
A governed registry of reusable Python tools for AI agents, enabling search by intent, execution with JSON input, draft registration, and lifecycle management.
README
ToolForge MCP
ToolForge MCP is a governed registry of reusable Python tools for AI agents. It lets agents search approved tools by intent, run approved tools with JSON input, register newly generated scripts as drafts, and manage tool lifecycle through approval, updates, deprecation, and rollback.
The MVP is MCP-only. It runs over stdio by default and does not include a web UI or HTTP server.
Features
- Register Python scripts as draft reusable tools
- Approve reviewed tool versions for execution
- Search approved tools by semantic-style intent with keyword/tag fallback
- Run approved tools through a subprocess JSON contract
- Log every run to SQLite
- Seed safe default tools on first startup
- Update, deprecate, and rollback tool versions
Runtime Paths
By default, ToolForge stores metadata and runtime tool files locally:
data/toolforge.db
tools/
Override these paths with:
export TOOLFORGE_DB_PATH=/path/to/toolforge.db
export TOOLFORGE_TOOLS_DIR=/path/to/tools
export TOOLFORGE_WORK_DIR=/path/to/work
MCP Server
Run the server with:
uv run toolforge-mcp
or:
python3 server.py
Connect MCP Clients
ToolForge MCP is a local stdio MCP server. The MCP client starts the process, then discovers the server instructions and available tools at connection time.
Use absolute paths in client configuration so the server can start from any
working directory. Replace /absolute/path/to/toolforge-mcp with your local
checkout path.
Recommended Setup
Install runtime dependencies before connecting a client:
cd /absolute/path/to/toolforge-mcp
uv sync --extra dev
The --extra dev option installs test dependencies and optional libraries used
by the default seed tools, such as PDF and image helpers. Local semantic
embeddings are optional because they pull a larger ML dependency stack. To enable
them, run:
uv sync --extra dev --extra semantic
If you do not use uv, create a Python environment and install the package
dependencies from pyproject.toml.
Codex
Codex reads MCP servers from ~/.codex/config.toml, or from a project-scoped
.codex/config.toml in trusted projects. The Codex CLI and IDE extension share
this configuration.
CLI setup:
codex mcp add toolforge --env TOOLFORGE_DB_PATH=/absolute/path/to/toolforge-mcp/data/toolforge.db --env TOOLFORGE_TOOLS_DIR=/absolute/path/to/toolforge-mcp/tools --env TOOLFORGE_WORK_DIR=/absolute/path/to/toolforge-mcp/work -- uv --directory /absolute/path/to/toolforge-mcp run toolforge-mcp
Equivalent ~/.codex/config.toml entry:
[mcp_servers.toolforge]
command = "uv"
args = ["--directory", "/absolute/path/to/toolforge-mcp", "run", "toolforge-mcp"]
startup_timeout_sec = 20
tool_timeout_sec = 120
[mcp_servers.toolforge.env]
TOOLFORGE_DB_PATH = "/absolute/path/to/toolforge-mcp/data/toolforge.db"
TOOLFORGE_TOOLS_DIR = "/absolute/path/to/toolforge-mcp/tools"
TOOLFORGE_WORK_DIR = "/absolute/path/to/toolforge-mcp/work"
In the Codex TUI, run /mcp to confirm that toolforge is connected.
Claude Code
Claude Code can add local stdio MCP servers with claude mcp add. The --
separator is important: everything after it is the command used to start the MCP
server.
CLI setup:
claude mcp add \
--env TOOLFORGE_DB_PATH=/absolute/path/to/toolforge-mcp/data/toolforge.db \
--env TOOLFORGE_TOOLS_DIR=/absolute/path/to/toolforge-mcp/tools \
--env TOOLFORGE_WORK_DIR=/absolute/path/to/toolforge-mcp/work \
--transport stdio \
toolforge \
-- uv --directory /absolute/path/to/toolforge-mcp run toolforge-mcp
Project-scoped .mcp.json example:
{
"mcpServers": {
"toolforge": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/toolforge-mcp", "run", "toolforge-mcp"],
"env": {
"TOOLFORGE_DB_PATH": "/absolute/path/to/toolforge-mcp/data/toolforge.db",
"TOOLFORGE_TOOLS_DIR": "/absolute/path/to/toolforge-mcp/tools",
"TOOLFORGE_WORK_DIR": "/absolute/path/to/toolforge-mcp/work"
},
"timeout": 120000
}
}
}
Inside Claude Code, use /mcp to inspect server status. Project-scoped MCP
servers may require workspace trust approval before they become active.
Cursor
Cursor reads MCP servers from JSON configuration. Use a project-scoped
.cursor/mcp.json when ToolForge should be available only for this repository,
or a user-level MCP configuration when you want it available across projects.
Project-scoped .cursor/mcp.json example:
{
"mcpServers": {
"toolforge": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/toolforge-mcp", "run", "toolforge-mcp"],
"env": {
"TOOLFORGE_DB_PATH": "/absolute/path/to/toolforge-mcp/data/toolforge.db",
"TOOLFORGE_TOOLS_DIR": "/absolute/path/to/toolforge-mcp/tools",
"TOOLFORGE_WORK_DIR": "/absolute/path/to/toolforge-mcp/work"
}
}
}
}
After editing Cursor MCP settings, reload Cursor or restart the agent session, then confirm that the ToolForge tools appear in Cursor's MCP/tools panel.
Without uv
If uv is not available, install the project into a virtual environment and use
that environment's Python directly:
cd /absolute/path/to/toolforge-mcp
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install -e ".[dev]"
# Optional semantic embeddings:
# python3 -m pip install -e ".[dev,semantic]"
Then replace the MCP command with:
{
"command": "/absolute/path/to/toolforge-mcp/.venv/bin/python",
"args": ["/absolute/path/to/toolforge-mcp/server.py"]
}
Agent Governance Pack
ToolForge includes copy-ready governance examples for teams that want Codex, Claude Code, and Cursor to consistently reuse MCP tools instead of creating throwaway scripts.
See governance/ for:
- Codex
AGENTS.mdguidance andconfig.tomlMCP example - Claude Code
CLAUDE.mdguidance and.mcp.jsonexample - Cursor
.mdcrule and.cursor/mcp.jsonexample
The shared policy is:
- Search ToolForge before creating utility scripts.
- Run an approved tool when one exists.
- Register newly generated reusable utility scripts as draft tools.
- Approve tools only after human or authorized workflow review.
Setup Script
Use the setup script to install project-scoped governance and MCP config for Codex, Claude Code, and Cursor. Running the script without arguments prints help and does not write files:
python3 scripts/setup_agent_governance.py
Pass explicit options to install governance/config files:
python3 scripts/setup_agent_governance.py \
--agents all \
--target-project /path/to/your/project \
--toolforge-dir /absolute/path/to/toolforge-mcp
Preview changes without writing files:
python3 scripts/setup_agent_governance.py --agents all --target-project /path/to/your/project --dry-run
Configure one agent at a time:
python3 scripts/setup_agent_governance.py --agents codex --target-project /path/to/your/project
python3 scripts/setup_agent_governance.py --agents claude --target-project /path/to/your/project
python3 scripts/setup_agent_governance.py --agents cursor --target-project /path/to/your/project
The script updates managed ToolForge sections idempotently and preserves other MCP servers in JSON config files.
Stored Tool Contract
Stored scripts must:
- read one JSON object from stdin
- write one JSON object to stdout
- exit nonzero on failure
Default Seed Tools
On first startup, ToolForge seeds these approved tools:
validate_json_schemaclean_csv_filegenerate_markdown_reportresize_imageextract_text_from_pdf
The seed operation is idempotent and recorded in SQLite.
License
Apache License 2.0
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。