Skip to content

Add custom MCP server management for Studio Code - #3288

Draft
chubes4 wants to merge 2 commits into
trunkfrom
feat-studio-code-custom-mcps
Draft

Add custom MCP server management for Studio Code#3288
chubes4 wants to merge 2 commits into
trunkfrom
feat-studio-code-custom-mcps

Conversation

@chubes4

@chubes4 chubes4 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 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
  • npx tsc -p apps/cli/tsconfig.json --noEmit
  • npx 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.ts

Closes #3279.

AI assistance

  • AI assistance: Yes
  • Tool(s): GPT-5.5 via OpenCode
  • 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.
@wpmobilebot

wpmobilebot commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing e3b4dc7 vs trunk

app-size

Metric trunk e3b4dc7 Diff Change
App Size (Mac) 2341.17 MB 2341.18 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk e3b4dc7 Diff Change
load 1067 ms 1074 ms +7 ms ⚪ 0.0%

site-startup

Metric trunk e3b4dc7 Diff Change
siteCreation 6488 ms 6496 ms +8 ms ⚪ 0.0%
siteStartup 6983 ms 6478 ms 505 ms 🟢 -7.2%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@chubes4
chubes4 requested a review from sejas May 1, 2026 12:11
@chubes4
chubes4 force-pushed the feat-studio-code-custom-mcps branch from b16f0fb to 3d02341 Compare June 23, 2026 12:32
@chubes4
chubes4 force-pushed the feat-studio-code-custom-mcps branch from 3d02341 to e3b4dc7 Compare June 23, 2026 12:50
@chubes4

chubes4 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@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?

cc @Poliuk @mtias

@youknowriad

Copy link
Copy Markdown
Contributor

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.

@youknowriad

Copy link
Copy Markdown
Contributor

But I think Figma should be first party support ideally. Figma to WordPress is a common flow.

@wojtekn

wojtekn commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Marking as draft until conflicts are fixed.

@wojtekn
wojtekn marked this pull request as draft July 14, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants