-
Notifications
You must be signed in to change notification settings - Fork 28
🤖 feat: add MCP server configuration and runtime support #956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fa9d241 to
0eeedab
Compare
|
/rerun-ci |
982f167 to
eeb3e7d
Compare
- Track worker error state to reject promises immediately if worker is dead - Clean up debug logging from aiService.ts - Improve MCP server logging for better diagnostics - MCP integration test now passes (was blocked by tokenizer, not MCP)
- Add projects.mcp.test ORPC endpoint - Add MCPServerManager.testServer() that spawns server, fetches tools, closes - Add Test button with spinner, success (shows tools), and error states - 30 second timeout for test operations
- Rename sidebar tab from 'Project' to 'Projects' - Add project dropdown selector at top of page - Show full project path below dropdown - Add inline form to add MCP servers (name + command) - Enter key submits the add form - Remove reference to /mcp add command (now done in UI)
- Add testCommand endpoint to test a command before saving to config - Separate Test and Add buttons in the form - Test shows success with tool count and names, or error message - Polished UI with better spacing, labels, and visual hierarchy - Server list shows tool badge when tested successfully - Error messages use styled alert boxes - Empty state with icon for no projects
- Add /mcp edit <name> <command> slash command - Add inline edit button in Settings UI - Enter to save, Esc to cancel
Prevents Escape from closing the modal when canceling inline edits. Also disables spellcheck on MCP command input.
DRY helper for Enter-to-save, Escape-to-cancel pattern with stopPropagation.
Also disable spellcheck on the add command input.
Shows configured servers (name + command) when at least one exists. Explains they're configured in user's local project's .mux/mcp.jsonc.
MCP returns images with type 'image' and 'mimeType', but AI SDK expects type 'media' with 'mediaType'. This wraps MCP tool execute functions to transform the result format, enabling proper image handling for tools like Chrome DevTools MCP's take_screenshot.
- Add fallback to 'image/png' when MCP mimeType is undefined - JSON.stringify omits undefined values, which caused mediaType to be missing from tool results, breaking image rendering in Anthropic provider - Add debug logging to trace MCP image content transformation - Add integration test verifying Chrome DevTools MCP screenshot handling
- Extract runServerTest() helper to deduplicate testServer/testCommand - Move MCPTestResult type to common/types/mcp.ts (single source of truth) - Remove redundant nullish coalescing where getConfig() guarantees non-null - Net reduction of 29 lines
- Consolidate ProjectSettingsSection state (18 useState → grouped objects + custom hook) - Extract parseMCPNameCommand helper to dedupe add/edit parsing in registry.ts - Unify MCP test API (testServer + testCommand → single test endpoint) - Add localStorage caching for test results with CachedMCPTestResult type - Show test age in Settings UI (formatRelativeTime) - Cache successful test results when adding servers
Align with the shadcn refactor that was done on other Settings sections. Uses Button component with variant='ghost', 'outline', and default instead of raw button elements with manual styling.
Automatically stops MCP servers after 10 minutes of inactivity to conserve resources. Servers restart automatically on next message. This prevents resource exhaustion for users with many workspaces.
e0abd40 to
015894f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Tools are now namespaced as `servername_toolname` (e.g., `memory_create_entities`) to prevent collisions when multiple servers expose tools with the same name.
ae54abc to
ed1de83
Compare
Commands may contain credentials or sensitive env values. Only expose server names to the model, not the full command strings.
efb452e to
b5f287d
Compare
Summary
Adds MCP (Model Context Protocol) server support, allowing users to extend agent capabilities with external tool providers.
Features
.mux/mcp.jsoncapply to all workspaces from that project/mcp add|remove|editfor quick configuration from chatmemory_create_entities) to prevent collisionsConfiguration
Security
Files
src/node/services/mcpServerManager.ts— Runtime server lifecycle with idle cleanupsrc/node/services/mcpConfigService.ts— Config CRUD operationssrc/node/services/mcpStdioTransport.ts— NDJSON stdio transportsrc/browser/components/Settings/sections/ProjectSettingsSection.tsx— Settings UIdocs/mcp-servers.mdx— User documentationGenerated with
mux