🤖 feat: add per-workspace MCP server and tool configuration #1180
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.
Summary
Adds per-workspace MCP server and tool configuration. Users can now customize which MCP servers are enabled and which tools are exposed for each workspace, without modifying the project-level
.mux/mcp.jsonc.Changes
Backend
WorkspaceMCPOverridesschema withdisabledServersandtoolAllowlistfieldsgetWorkspaceMCPOverrides()andsetWorkspaceMCPOverrides()methods in Config classworkspace.mcp.getandworkspace.mcp.setfor frontend accessFrontend
Tests
How it works
.mux/mcp.jsonc~/.mux/config.jsonunder each workspace entrydisabledServers)toolAllowlist[server]if set📋 Implementation Plan
Plan: Selective MCP tools + per-workspace configuration
Goals
.mux/mcp.jsonccontinues to work unchanged.Proposed approach (recommended)
1) Keep server definitions per-project; add per-workspace overrides
PROJECT_ROOT/.mux/mcp.jsonc~/.mux/config.jsonunder each workspace entry):This avoids needing to read/write config inside SSH workspaces (remote filesystem) and keeps the current "configure once per project" ergonomics, while still enabling workspace-specific behavior.
2) Workspace MCP override schema
Add an optional
mcpfield onWorkspaceConfigSchema:Semantics:
disabledServers.toolAllowlist[server]present => only expose those tool names.3) Runtime behavior changes
MCPServerManager.getToolsForWorkspace(...)filters the returned tool map using the workspace allowlists before it is merged intogetToolsForModel.MCPServerManager.listServers(...)gains a workspace-aware variant so the system prompt lists only the servers enabled for that workspace.Generated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high