Skip to content

Request for Claude Python SDK access to MCP #14

@owencqueen

Description

@owencqueen

Hello! I'm trying to access your MCP through the Claude Python SDK. Here's a bit of testing ccode:

import anthropic

client = anthropic.Anthropic()

response = client.beta.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1000,
    messages=[{
        "role": "user",
        "content": "Can you search for datasets from the dataverse about Alzheimer's disease?"
    }],
    mcp_servers=[{
        "name": "dataverse-mcp",
        "type": "url",  # or "stdio" depending on the server
        "url": "https://mcp.dataverse.org/sse"
    }],
    betas=["mcp-client-2025-04-04"]
)

Claude is able to get information about the tools but when calling them, the tools fail:

>>> response.content[0]:
BetaTextBlock(citations=None, text="I'll help you search for datasets about Alzheimer's disease. First, let me get an overview of available Dataverse installations to find a suitable one to search.", type='text')
>>> response.content[1]:
BetaMCPToolUseBlock(id='mcptoolu_015TjitAxScxrcG929TEs4vP', input={}, name='overview', server_name='dataverse-mcp', type='mcp_tool_use')
>>> response.content[2]
BetaMCPToolResultBlock(content=[BetaTextBlock(citations=None, text='Unknown tool: overview', type='text')], is_error=True, tool_use_id='mcptoolu_015TjitAxScxrcG929TEs4vP', type='mcp_tool_result')
>>> response.content[3]
BetaTextBlock(citations=None, text='Let me try the correct function name:', type='text')
>>> response.content[4]
BetaMCPToolUseBlock(id='mcptoolu_0121A5yZLLUMQQTmi349DGvp', input={}, name='overview', server_name='dataverse-mcp', type='mcp_tool_use')
>>> response.content[5]
BetaMCPToolResultBlock(content=[BetaTextBlock(citations=None, text='Unknown tool: overview', type='text')], is_error=True, tool_use_id='mcptoolu_0121A5yZLLUMQQTmi349DGvp', type='mcp_tool_result')

There do not seem to be great docs on Anthropic's websites about how to make the transition from the Claude Desktop MCP specs (here are docs for the MCP connect I'm using) - are you all aware of how to make this transition? Am I using the tool correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions