claude-code - 💡(How to fix) Fix [BUG] Artifact API proxy strips mcp_servers parameter [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54781Fetched 2026-04-30 06:36:12
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Timeline (top)
commented ×2labeled ×2unlabeled ×1

Claude.ai artifact API calls to api.anthropic.com/v1/messages have the mcp_servers parameter silently stripped by the proxy, even though artifact documentation indicates mcp_servers is supported.

Error Message

Error Messages/Logs

Root Cause

This issue prevents an artifact from using Claude connected MCPs. My company has a mess of custom MCPs, and we'd like to create artifact/tools for our users, but can't because of this issue.

Code Example

fetch('https://api.anthropic.com/v1/messages', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'anthropic-version': '2023-06-01',
    'anthropic-beta': 'mcp-client-2025-04-04'
  },
  body: JSON.stringify({
    model: 'claude-sonnet-4-20250514',
    max_tokens: 4096,
    messages: [{ role: 'user', content: 'Use the generate_speech tool' }],
    mcp_servers: [{
      type: 'url',
      url: 'https://rexisolway--star-voice-mcp-sse-fastapi-app.modal.run/message',
      name: 'star-voice'
    }]
  })
})

---

Response from nested Claude in artifact:
"I don't have access to a generate_speech tool. I'm Claude, a text-based AI assistant, and I can only communicate through written text in this chat interface."

Browser console shows no network errors - the request succeeds with 200 status, but mcp_servers parameter was silently stripped before reaching the model.

---

const response = await fetch('https://api.anthropic.com/v1/messages', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'anthropic-version': '2023-06-01',
    'anthropic-beta': 'mcp-client-2025-04-04'
  },
  body: JSON.stringify({
    model: 'claude-sonnet-4-20250514',
    max_tokens: 4096,
    messages: [{ role: 'user', content: 'Use the generate_speech tool to say hello' }],
    mcp_servers: [{
      type: 'url',
      url: 'https://your-mcp-server.modal.run/message',
      name: 'star-voice'
    }]
  })
});
const data = await response.json();
console.log(data);
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Yes, this is essentially a new submission of #16848, and I cannot understand how/why it was closed with no answer. It looks like everyone just got too busy. If you're really not going to provide this functionality, or if it's been superceded by something else, apologies and please let me know.

This issue prevents an artifact from using Claude connected MCPs. My company has a mess of custom MCPs, and we'd like to create artifact/tools for our users, but can't because of this issue.

From #16848:

Claude.ai artifact API calls to api.anthropic.com/v1/messages have the mcp_servers parameter silently stripped by the proxy, even though artifact documentation indicates mcp_servers is supported.

Summary

Claude.ai artifact API calls to api.anthropic.com/v1/messages have the mcp_servers parameter silently stripped by the proxy, even though artifact documentation indicates mcp_servers is supported.

Environment

  • Claude.ai Pro subscription ($200/month)
  • Browser: Chrome
  • MCP connector: star-voice (working correctly when called from main conversation)

Steps to Reproduce

  1. Create an artifact that calls the Anthropic API with mcp_servers:
fetch('https://api.anthropic.com/v1/messages', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'anthropic-version': '2023-06-01',
    'anthropic-beta': 'mcp-client-2025-04-04'
  },
  body: JSON.stringify({
    model: 'claude-sonnet-4-20250514',
    max_tokens: 4096,
    messages: [{ role: 'user', content: 'Use the generate_speech tool' }],
    mcp_servers: [{
      type: 'url',
      url: 'https://rexisolway--star-voice-mcp-sse-fastapi-app.modal.run/message',
      name: 'star-voice'
    }]
  })
})
  1. The nested Claude responds: "I don't have access to a generate_speech tool"

Expected Behavior

The mcp_servers parameter should be passed through to the API. MCP calls happen server-side on Anthropic infrastructure, so browser CSP shouldn't apply.

Actual Behavior

The proxy strips mcp_servers entirely. The nested model has no tools available.

Additional Context

  • The same MCP connector works perfectly when called from the main conversation (Claude Opus can call star-voice:generate_speech successfully)
  • Tested multiple formats: mcp_servers array, tools array with type:'mcp', various beta headers
  • All stripped by the artifact proxy
  • This blocks legitimate use cases like voice synthesis in artifacts

Evidence

Diagnostic artifacts confirmed:

  • complete() works (text returns)
  • sendConversationMessage() is fire-and-forget (no return channel)
  • Direct fetch to Modal blocked by CSP (expected)
  • API calls with mcp_servers: parameter stripped (unexpected)

What Should Happen?

When an artifact calls api.anthropic.com/v1/messages with the mcp_servers parameter, the parameter should be passed through to the API unchanged. The MCP call happens server-side on Anthropic's infrastructure, so browser CSP restrictions don't apply.

The nested Claude should see the MCP tools and be able to invoke them, returning tool results (like audio data) back to the artifact.

This would allow artifacts to use MCP connectors that are already authorized in the user's account - the same connectors that work when called from the main conversation.

Error Messages/Logs

Response from nested Claude in artifact:
"I don't have access to a generate_speech tool. I'm Claude, a text-based AI assistant, and I can only communicate through written text in this chat interface."

Browser console shows no network errors - the request succeeds with 200 status, but mcp_servers parameter was silently stripped before reaching the model.

Steps to Reproduce

  1. Create a Claude.ai artifact with this code:
const response = await fetch('https://api.anthropic.com/v1/messages', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'anthropic-version': '2023-06-01',
    'anthropic-beta': 'mcp-client-2025-04-04'
  },
  body: JSON.stringify({
    model: 'claude-sonnet-4-20250514',
    max_tokens: 4096,
    messages: [{ role: 'user', content: 'Use the generate_speech tool to say hello' }],
    mcp_servers: [{
      type: 'url',
      url: 'https://your-mcp-server.modal.run/message',
      name: 'star-voice'
    }]
  })
});
const data = await response.json();
console.log(data);
  1. Run the artifact
  2. Observe: nested Claude says "I don't have access to tools"
  3. Compare: Call the same MCP from main conversation - it works

Claude Model

None

Is this a regression?

I don't know

Last Working Version

claude-sonnet-4-20250514 (in artifact API call) claude-opus-4-5-20250514 (main conversation - MCP works here)

Claude Code Version

N/A - This bug is in Claude.ai web artifacts, not Claude Code CLI. Filing here for visibility as artifacts team monitors this repo.

Platform

Other

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

This is a Claude.ai artifacts issue, not Claude Code. Filing here because:

  1. Anthropic support chat is AI-only with no escalation path
  2. Engineers monitor this repo

The artifact proxy at api.anthropic.com strips mcp_servers silently. MCP calls happen server-side, so browser CSP shouldn't block them. This appears to be intentional proxy filtering that contradicts documentation stating artifacts support mcp_servers.

Pro subscriber ($200/month). Happy to provide additional diagnostic artifacts or logs.

extent analysis

TL;DR

The issue can be addressed by working with the Anthropic team to update the artifact proxy to pass the mcp_servers parameter through to the API, as the current behavior contradicts the documentation.

Guidance

  • Verify that the mcp_servers parameter is correctly formatted and included in the API request body.
  • Test the API call using a tool like Postman or cURL to confirm that the issue is specific to the artifact proxy.
  • Reach out to the Anthropic team to report the issue and request an update to the artifact proxy to support the mcp_servers parameter.
  • Consider providing additional diagnostic artifacts or logs to help the Anthropic team troubleshoot the issue.

Example

// Example API call with mcp_servers parameter
fetch('https://api.anthropic.com/v1/messages', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'anthropic-version': '2023-06-01',
    'anthropic-beta': 'mcp-client-2025-04-04'
  },
  body: JSON.stringify({
    model: 'claude-sonnet-4-20250514',
    max_tokens: 4096,
    messages: [{ role: 'user', content: 'Use the generate_speech tool' }],
    mcp_servers: [{
      type: 'url',
      url: 'https://rexisolway--star-voice-mcp-sse-fastapi-app.modal.run/message',
      name: 'star-voice'
    }]
  })
})

Notes

The issue appears to be specific to the artifact proxy and not a problem with the API or the MCP connector. The Anthropic team may need to update the proxy to support the mcp_servers parameter.

Recommendation

Apply workaround: Reach out to the Anthropic team to report the issue and request an update to the artifact proxy to

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Artifact API proxy strips mcp_servers parameter [2 comments, 2 participants]