feat(mcp): add explicit fj mcp stdio subcommand #65
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/FJ-50-mcp-stdio-subcommand"
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?
Add a
Stdio(ServeArgs)variant toMcpSubcommandso an MCP client can select the stdio transport by subcommand, mirroringyt mcp stdio, instead of relying onFORGEJO_MCP_TRANSPORTbeing unset. It reusesServeArgs, so the write-policy flags (--allow-edit,--allow-delete,--allow-global-write, and theirFORGEJO_MCP_ALLOW_*env equivalents) apply identically to stdio.In
fj-mcp, factor the stdio path out ofserveinto a newserve_stdio(policy, host_override)entry point that builds the server and serves over stdio directly, never consultinghttp_transport_selected().serveis unchanged: it still defaults to stdio and still selects HTTP onFORGEJO_MCP_TRANSPORT=http, so the deployedfj mcp servicesystemd unit keeps working. Shared setup (tracing init, server build, stdio serve loop) is extracted intoinit_server/run_stdiohelpers.Document
fj mcp stdioin the README as the preferred explicit form for MCP-client configs, notingservewithoutFORGEJO_MCP_TRANSPORTremains equivalent for backward compatibility. Add clap parse tests guarding thatmcpexposesserve,stdio, andservice, and thatstdioaccepts the write-policy flags.#FJ-50
fj mcp stdiosubcommand