Skip to main content

Anthropic SDK (Python)

Connect UNIZO MCP to Anthropic's Claude SDK with native tool calling support.

Overview

Anthropic provides native MCP client support through the official mcp Python SDK, enabling seamless integration with Unizo's MCP server.

Prerequisites

Before setting up the MCP integration, you'll need:

  • Unizo API Key: Used for authentication (found in the Unizo Console)
  • Python 3.10+: Required for async support and MCP client
  • Anthropic API Key: For accessing Claude models

Installation

uv add anthropic mcp python-dotenv

Or using pip:

pip install anthropic mcp python-dotenv

Authentication

Step 1: Generate a Service Key

Use your Unizo API key to generate a service key for MCP authentication:

curl --location 'https://api.unizo.ai/api/v1/serviceKeys' \
--header "apiKey: {unizo_api_key}" \
--header "Content-Type: application/json" \
--data '{
"name": "MCP Ticketing Integration",
"subOrganization": {
"name": "{YOUR_CUSTOMER_NAME}",
"externalKey": "{YOUR_CUSTOMER_UNIQUE_IDENTIFIER}"
},
"integration": {
"target": {
"categorySelectors": [
{
"type": "TICKETING"
}
]
}
}
}'

Required Parameters:

ParameterDescription
apiKeyYour Unizo API key (found in the Unizo Console)
nameDescriptive name for the integration (e.g., "MCP Ticketing Integration")
subOrganization.nameYour organization name (e.g., "Acme Inc")
subOrganization.externalKeyUnique identifier (UUID format recommended)

Response:

{
"state": "ACTIVE",
"displayId": "{UNIZO_SERVICE_KEY}",
...
}

Important: Save the displayId from the response - this is your service key for authenticating with the MCP server.

Step 2: Configure Environment Variables

Create a .env file in your project root:

ANTHROPIC_API_KEY=your_anthropic_api_key

Quick Start

Connect to UNIZO MCP and use Claude with tool calling:

import os
import asyncio
from anthropic import Anthropic
from mcp.client.streamable_http import streamablehttp_client
from mcp import ClientSession
from dotenv import load_dotenv

load_dotenv()

async def main():
# Connect to Unizo MCP server
async with streamablehttp_client(
url="https://api.unizo.ai/mcp",
headers={
"servicekey": os.getenv('UNIZO_SERVICE_KEY'),
"x-mcp-scopes": "TICKETING" # Comma-separated scopes (TICKETING, VMS, etc.)
}
) as (read, write, get_session_id):
async with ClientSession(read, write) as session:
await session.initialize()

# Get available tools from MCP server
tools_response = await session.list_tools()
tools = [{
"name": t.name,
"description": t.description,
"input_schema": t.inputSchema
} for t in tools_response.tools]

# Create Anthropic client and send message
client = Anthropic()
messages = [{"role": "user", "content": "List available TICKETING connectors"}]

response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=4096,
tools=tools,
messages=messages
)

# Handle tool calls from Claude
if response.stop_reason == "tool_use":
for block in response.content:
if block.type == "tool_use":
result = await session.call_tool(
block.name,
arguments=block.input
)
print(result.content[0].text)

asyncio.run(main())

Headers

HeaderDescription
servicekeyYour Unizo service key (from the authentication step)
x-mcp-scopes (optional)Supported scopes include TICKETING, VMS, INCIDENT, SCM, PCR, COMMS, IDENTITY, OBSERVABILITY, KEY_MANAGEMENT, INFRA, EDR, STORAGE, and PLATFORM.

Note: If x-mcp-scopes is not specified, all scopes are enabled by default.