forge-mcp
Enables MCP-capable agents to author, compile, run, and commit generative music E-- Recipes from a library catalog, completing the full authoring loop.
README
forge-mcp
Author, compile, run, and commit generative-music E-- Recipes directly from any MCP-capable agent (Claude Desktop, Cursor, …). forge-mcp exposes the Forge E-- library note catalog + vault as an MCP server and closes the authoring loop end-to-end: the agent picks a chip from the catalog, drafts a Recipe, verifies it parses, runs it in a sandbox, previews the artifact, and commits the finished Recipe to a vault note. All 6 tools ship today.
[library note catalog] → [compile] → [run] → [commit] → [vault note with recipe_version bump]
Install into Claude Code
Fastest path — Claude Code spawns forge-mcp as a stdio subprocess. Full walkthrough at docs/claude-code-install.md.
# 1. Install (once repo is public — see FEEDBACK §Driver ops)
pip install "git+https://github.com/frmoded/forge-mcp.git"
# 2. Fetch your Bearer once and export
export FORGE_MCP_BEARER=$(jq -r '.transpileServiceToken' \
~/forge-vaults/bluh/.obsidian/plugins/forge-client-obsidian/data.json)
# 3. Register with Claude Code
claude mcp add forge-mcp \
-e FORGE_MCP_BEARER=$FORGE_MCP_BEARER \
-e FORGE_TRANSPILE_URL=https://forge.thecodingarena.com \
-e FORGE_VAULT_PATH=$HOME/forge-vaults/bluh \
-e FORGE_MCP_TRANSPORT=stdio \
-- forge-mcp
# 4. Start Claude Code and ask "list the notes in my forge music library."
Install (other clients)
Full walkthrough (Claude Desktop config, forge-transpile Bearer acquisition, verification smoke, troubleshooting): docs/install.md.
Quick paths:
# From source (pip + editable install for development)
pip install -e ".[dev]"
python -m forge_mcp.server
# Docker
docker build -t forge-mcp:latest .
docker run --rm -p 8765:8765 \
-e FORGE_TRANSPILE_URL=https://forge.thecodingarena.com \
-e FORGE_VAULT_PATH=/path/to/your/vault \
forge-mcp:latest
Environment:
FORGE_TRANSPILE_URL— base URL of the forge-transpile service. Default:http://localhost:8000.FORGE_VAULT_PATH— local vault directory forforge_read_notes_in_vault+forge_commit_recipe. Default:~/forge-vaults/bluh.FORGE_MCP_HOST— host to bind. Default:0.0.0.0.FORGE_MCP_PORT— port to bind. Default:8765.FORGE_MCP_BEARER— dev fallback only. Per-request Bearer extraction is the primary path (CW-MCP-1-B); this env var only fires when the incoming request has noAuthorizationheader. Do NOT set in production.
Claude Desktop config
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"forge-mcp": {
"url": "http://localhost:8765/mcp",
"headers": {
"Authorization": "Bearer <your-forge-transpile-token>"
}
}
}
}
Get your Bearer:
jq -r '.transpileServiceToken' \
~/forge-vaults/bluh/.obsidian/plugins/forge-client-obsidian/data.json
Tools
Read (no side effects):
forge_read_note_catalog({domain?})— list Forge library notes; every entry carries the E-- signature the agent needs toCallit.forge_read_notes_in_vault({filter?})— list vault notes with ahas_recipe+recipe_versionsummary. Backed by a local filesystem walk (CW-MCP-2-E).
Author (deterministic — no LLM, no vault write):
forge_compile_recipe({source})— Recipe → Python. Returns compiled source + unresolved slot count, OR a structured parse error with line/column (per drain CW-recipe-parser-line-info).forge_run_recipe({source, domains?})— compile + execute in a resource-limited server sandbox. Returns a short preview + arun_id; artifacts (MusicXML / MIDI / PNGs) accessible via theforge-artifact://resource.forge_get_run_result({run_id})— fetch full stdout/stderr + artifact manifest of a previous run. 7-day TTL, per-Bearer isolation.
Commit:
forge_commit_recipe({source, note_id, expected_version?})— persist Recipe to a vault note (facet-scoped — Description + Python + frontmatter survive byte-for-byte). Bumpsrecipe_versionin the note's frontmatter. Optimistic-concurrency viaexpected_version; version-conflict returnsisError:truewith expected + current numbers.
Resources
forge-note:///{domain}/{name}— library note content.forge-artifact:///{run_id}/{artifact_name}— on-demand binary fetch for run artifacts. Text mimes return viatext; binaries via base64blob.forge-recipe:///{note_id}/v{n}— Recipe body at a specificrecipe_version(git-tracked vaults only; returns "history unavailable" text otherwise).
Auth
forge-mcp does NOT validate tokens itself — forge-transpile is the source of truth (guarded by FORGE_TRANSPILE_SECRET). Each request's Authorization: Bearer <token> header is forwarded verbatim; a 401 or 403 from forge-transpile surfaces as isError: true with an actionable message the agent can read (drain CW-MCP-1-B).
Rotation is zero-downtime on the forge-mcp side: change FORGE_TRANSPILE_SECRET on forge-transpile, update your MCP client's header, done. Old tokens fail on the next request with a clean rejection message.
Related repos
- forge — the E-- parser + transpiler + core music library. forge-mcp vendors a snapshot of
forge/recipe/per the CW-MCP-2-A architecture; drift is caught byscripts/check-recipe-drift.shin the forge-transpile repo. - forge-transpile — the FastAPI service exposing
/compile//run//catalogetc. that forge-mcp's tools proxy for the transpile + sandboxed-run paths. Vault reads + commits are LOCAL and don't hit forge-transpile. - forge-client-obsidian — the Obsidian plugin end of the same authoring loop. forge-mcp writes to the SAME vault the plugin reads/renders; both share the note-file format.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。