You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add custom MCP server management for Studio Code - #3288
Adds studio code mcp commands to manage user-defined MCP servers for Studio Code.
Stores config in Studio's internal config directory via getStudioCodeMcpConfigPath() using the standard mcpServers shape.
Supports stdio, http, and sse server definitions while reserving Studio's built-in studio MCP server name.
Wires configured custom MCP tools into the current PI runtime as mcp__<server>__<tool> custom tools.
Behavior
Users can configure generic MCP servers without Studio hardcoding a single provider. This covers Figma and other MCP servers through the same path:
studio code mcp add wporg --command node --arg /path/to/mcp-context-wporg/dist/index.js
studio code mcp add figma --type http --url https://mcp.figma.com/mcp
studio code mcp add git --command npx --arg -y --arg @modelcontextprotocol/server-git
studio code mcp list
studio code mcp remove wporg
At agent startup, Studio Code reads the config, connects to each custom MCP server, lists its tools, and registers them with PI alongside Studio's built-in tools. A Figma server tool such as get_design_context is exposed to the agent as mcp__figma__get_design_context.
The command validates transport-specific requirements and reports clean CLI errors for invalid definitions instead of surfacing raw stack traces.
Tests
npx vitest run apps/cli/ai/tests/mcp-config.test.ts apps/cli/commands/ai/tests/mcp.test.ts apps/cli/ai/tests/pi-runtime.test.ts --config apps/cli/vitest.config.ts
Used for: Rebasing the PR, adapting the custom MCP path to the PI runtime, writing tests, running validation, and updating this PR description. Chris reviewed the behavior and owns the final submission.
@youknowriad if we add support for any custom MCP server, then we can easily test it with Figma. What do you think, instead of hardcoding Figma MCP like #2781?
I'm personally ok with custom MCP support, the only thing I would note though is that we should avoid surfacing this extra complexity (configuring MCPs) by default to users, it should some advanced flow.
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
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
studio code mcpcommands to manage user-defined MCP servers for Studio Code.getStudioCodeMcpConfigPath()using the standardmcpServersshape.stdio,http, andsseserver definitions while reserving Studio's built-instudioMCP server name.mcp__<server>__<tool>custom tools.Behavior
Users can configure generic MCP servers without Studio hardcoding a single provider. This covers Figma and other MCP servers through the same path:
At agent startup, Studio Code reads the config, connects to each custom MCP server, lists its tools, and registers them with PI alongside Studio's built-in tools. A Figma server tool such as
get_design_contextis exposed to the agent asmcp__figma__get_design_context.The command validates transport-specific requirements and reports clean CLI errors for invalid definitions instead of surfacing raw stack traces.
Tests
npx vitest run apps/cli/ai/tests/mcp-config.test.ts apps/cli/commands/ai/tests/mcp.test.ts apps/cli/ai/tests/pi-runtime.test.ts --config apps/cli/vitest.config.tsnpx tsc -p apps/cli/tsconfig.json --noEmitnpx eslint apps/cli/ai/mcp-config.ts apps/cli/ai/mcp-client-tools.ts apps/cli/ai/runtimes/pi/index.ts apps/cli/commands/ai/mcp.ts apps/cli/ai/tests/mcp-config.test.ts apps/cli/commands/ai/tests/mcp.test.ts apps/cli/ai/tests/pi-runtime.test.ts apps/cli/index.tsCloses #3279.
AI assistance