-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
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?
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
- 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'
}]
})
})- 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
- 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);- Run the artifact
- Observe: nested Claude says "I don't have access to tools"
- 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:
- Anthropic support chat is AI-only with no escalation path
- 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.