Repository navigation
feat(mcp): connect MCP servers a launcher provides in FUSERAFT_MCP_SERVERS - #219
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asmcpServers. Tokens go in their own variables and are referenced as${NAME}in headers, soEnvSecretMaskerhides their values like any other*_TOKEN./mcpmarks them provided by the launcher, and/mcp removedrops one for the session only.Pluginsand the config's ownMcpServersdoesn'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 removenow forgets a saved server that didn't connect this session; it used to refuse anything not connected./mcp reconnectnow finds a launcher-provided server that failed at startup. The VS Code MCP Servers view (fuseraft/fuseraft-vscode, see its PR) relies on both.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.fuseraft-web's MCP page depends on this and should ship after it, as 1.24.0.