
Forge MCP
io.github.frmoded由 GitHub 账号 frmoded 发布v0.2.0更新于 Oct 24, 2026
MCP server + tools for the Forge E-- generative-music authoring loop (compile / run / commit).
概览
让助手编写、编译、运行并提交 Forge E-- 生成式音乐 Recipe,可读取音符目录与 vault,并把完成的 Recipe 写回。
- 可以做什么
- 围绕 Forge E-- 生成式音乐创作流程提供六个工具。读取类工具列出音乐库音符及其 E-- 签名,并列出 vault 音符及 has_recipe 与 recipe_version 摘要。创作类工具把 Recipe 源码编译为 Python,在资源受限的沙箱中运行并返回预览与 run_id,还可获取此前运行的完整 stdout、stderr 与产物清单。提交工具把 Recipe 写入 vault 音符并递增 recipe_version,通过 expected_version 实现乐观并发控制。资源可提供音乐库音符、运行产物以及带版本的 Recipe 正文。
- 适用场景
- 当助手需要端到端地起草、校验、执行并保存 Forge E-- 音乐 Recipe,而不仅是讨论它们时使用。适合助手面向本地 Forge vault 与 forge-transpile 服务工作的场景,例如从目录中挑选芯片、编译、预览产物,再把 Recipe 提交到音符。
- 运行要求
- 以 stdio 本地进程运行,从 PyPI 安装 forge-recipe-mcp 并用 uvx 启动。需要 FORGE_TRANSPILE_URL 指向 forge-transpile 服务(默认 指向可写的本地 vault 目录,以及通过 Authorization 请求头逐次提供的 Bearer 令牌,或作为开发回退的 FORGE_MCP_BEARER。可选 FORGE_MCP_HOST 与 FORGE_MCP_PORT 控制绑定。仅支持桌面客户端。
安装
在 SourceWeft 中
- 打开 控制台中的 Forge MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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.
Install into Claude Code
Fastest path — Claude Code spawns forge-mcp as a stdio subprocess. Full walkthrough at docs/claude-code-install.md.
Install (other clients)
Full walkthrough (Claude Desktop config, forge-transpile Bearer acquisition, verification smoke, troubleshooting): docs/install.md.
Quick paths:
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:
Get your Bearer:
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.
来源:README.md,提交 f9fafa5
工具
0版本历史
1- v0.2.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分