Skip to content

feat(mcp): connect MCP servers a launcher provides in FUSERAFT_MCP_SERVERS - #219

Merged
fuseraft merged 2 commits into
mainfrom
feature/managed-mcp-servers
Nov 12, 2026
Merged

fuseraft merged 2 commits into
mainfrom
feature/managed-mcp-servers

Conversation

@fuseraft

@fuseraft fuseraft commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Why

fuseraft-web needs to give every account's chats and orchestrations the same MCP servers (a shared sql-mcp, say) without writing into each user's config. This lets whatever launches fuseraft hand it a list of servers through the environment.

What

  • FUSERAFT_MCP_SERVERS: a JSON array of MCP server entries, the same shape as mcpServers. Tokens go in their own variables and are referenced as ${NAME} in headers, so EnvSecretMasker hides their values like any other *_TOKEN.
  • REPL: these servers connect at startup along with saved ones. A saved server with the same name wins. /mcp marks them provided by the launcher, and /mcp remove drops one for the session only.
  • Orchestration: a server connects only when an agent lists it in Plugins and the config's own McpServers doesn't use that name. If it can't connect, the run registers it with no tools and logs a warning instead of failing with "unknown plugin". A live test found that failure.
  • /mcp remove now forgets a saved server that didn't connect this session; it used to refuse anything not connected. /mcp reconnect now finds a launcher-provided server that failed at startup. The VS Code MCP Servers view (fuseraft/fuseraft-vscode, see its PR) relies on both.
  • Docs: new section in docs/mcp.md.

Testing

  • ManagedMcpServersTests: parse, unset, invalid, nameless, merge, ReferencedBy, token masking.
  • ReplCommandsMcpServerLifecycleTests: remove and reconnect for servers that didn't connect at startup.
  • OrchestratorBuilderManagedMcpTests: an unreachable server is registered with no tools, and an unreferenced one isn't connected.
  • Live checks against a real sql-mcp and Postgres:
    • A bridge REPL chat queried a table through the server's tools.
    • An orchestration run worked with the server up, and carried on without its tools when the server was down.

fuseraft-web's MCP page depends on this and should ship after it, as 1.24.0.

…RVERS

- Lets fuseraft-web configure MCP servers once for every account, without
  writing into each user's config; tokens travel as separate *_TOKEN env
  vars referenced by ${VAR}, so they're masked like any other secret
- The REPL merges them with saved servers, and a saved server of the same
  name wins so users can still override one
- Orchestration connects one only when an agent lists it in Plugins; a
  server that's down registers no tools and warns instead of failing the run
- /mcp remove refused any server not connected this session, so a saved
  server that was down could never be forgotten
- /mcp reconnect only looked in the saved list, so a launcher-provided
  server that failed at startup couldn't be retried
@fuseraft
fuseraft merged commit 26b350c into main Nov 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant