viaSocket Help
Integration Guides

Anthropic API MCP Server

Connect to Anthropic API

Connect Anthropic's Messages API to your viaSocket MCP server

Get an Anthropic API Key

First, make sure that you have a valid Anthropic API key.

To view or generate a new Anthropic API Key, go to the Anthropic developer console API Keys page

Export your API key as an environment variable:

export ANTHROPIC_API_KEY="sk-..."

MCP server information

⚠️

Caution: Treat your API key like a password! It can be used to run tools attached to this server and access your data.

The URL for this MCP server. Url for the MCP server copy from the panel.

Using Anthropic's Messages API

Anthropic's Messages API can be used to call viaSocket MCP from anywhere.

Code Example

cURL

curl https://api.anthropic.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: mcp-client-2025-04-04" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "max_tokens": 1000,
    "messages": [{"role": "user", "content": "What tools do you have available?"}],
    "mcp_servers": [
      {
        "type": "url",
        "url": "https://mcp.viasocket.com/mcp/68**************",
        "name": "viaSocket",
        "authorization_token": "viasocket"
      }
    ]
  }'