feat(mcp): merge forgejo-mcp into fj as fj mcp serve (FJCLI-45) #59
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/FJCLI-45-merge-mcp-into-fj"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Merges the standalone
forgejo-mcpserver into thefjbinary as a newfj mcp servesubcommand, so the CLI and the MCP server ship from one repo through one release process. Implements FJCLI-45.Why
forgejo-mcpwas a separate repo whose every tool is a thin wrapper over afj_core::*operation, pinned tofj-core/fj-clientby a gitrevthat had already drifted (pinned at8f27115while this repo was atv0.9.0). Two repos meant two release processes: a critical fix touching the sharedfj-coreAPI had to be released twice. This is a hard fork with no upstream sync, so both repos are fully controlled here and there is no reason to keep them split.What changed
crates/fj-mcpworkspace member holds the MCP server surface: theForgejoServerrmcp tool router wrappingfj_core::*, the default-denyWritePolicygating, and the stdio + axum Streamable-HTTP transports. It depends onfj-core/fj-clientby path, replacing the gitrevpin with compile-time coupling.fjgains anmcpsubcommand.fj mcp serveruns the stdio server;MCP_TRANSPORT=http fj mcp serveruns the bearer-gated Streamable-HTTP server. It is excluded fromneeds_keys()(the server loads its own credentials), and the host resolves from the global--hostflag, thenFORGEJO_HOST, then the built-in default.fj version check|update(theupdate-checkfeature, train-aware and sha256-verified) supersedes it, so noFORGEJO_MCP_*build bakes orversionmodule are carried over.oci-buildDockerfiles COPY the new crate through their dependency-prime and real-source layers. README.md and CLAUDE.md documentfj mcp serve, its env vars, and theclaude mcp add -- fj mcp serveinvocation.Design decisions (confirmed with maintainer)
crates/fj-mcplibrary crate, not an inline module, to isolate the rmcp/axum dependency tree.fj(no cargo feature gate).fj version.--host, thenFORGEJO_HOST, then default), so existing env-driven deployments keep working.Testing
just pre-commit(fmt + clippy-D warnings+ build + full test suite in the rust-builder-glibc image): green, including the 9fj-mcptests.just check-docker(builder-stage compile ofoci-build/Dockerfilewith the new COPY lines): green, image exported.fj mcp serve --helprenders the subcommand and its write-policy flags.Follow-ups (filed and linked, both depend on this)
forgejo-mcprepo, replace its README with a pointer tofj mcp serve, stop publishingforgejo-mcp-*packages, and migrateclaude mcp add/ HTTP deployments.fj-linux-x86_64-staticartifact.Breaking change
forgejo-mcp servebecomesfj mcp serve; the separateforgejo-mcp-*binaries are discontinued (tracked in FJMCP-22). Existing MCP client configs must switch tofj mcp serve(same env vars).fj mcp servesubcommand