Skip to content

Anthropic API

The Messages API can call a remote MCP server for you: Claude decides when to call get_toc, search_instructions and get_section, and Anthropic’s servers make those calls with your key.

import anthropic
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-opus-5-5",
max_tokens=16000,
betas=["mcp-client-2025-11-20"],
mcp_servers=[{
"type": "url",
"url": "https://app.jitprompt.com/mcp",
"name": "jitprompt-support-bot",
"authorization_token": "imcp_...",
}],
tools=[{"type": "mcp_toolset", "mcp_server_name": "jitprompt-support-bot"}],
system="You are a support agent. Check the instructions before every reply.",
messages=[{"role": "user", "content": "Can I get a refund on my annual plan?"}],
)

Both halves are required: mcp_servers defines the connection, and the mcp_toolset entry in tools (with the same name) exposes its tools.

Keep the key out of source code — read it from an environment variable or your secret store.