Skip to main content
Glama
emzimmer

server-anthropic

by emzimmer

Anthropic API MCP Server

A Model Context Protocol (MCP) server that provides access to Anthropic's AI models through their official API. List available models and send messages to Claude using a secure, standardized interface. More about MCP.

Anthropic API MCP Server

Features

  • List all available Anthropic models

  • Send messages to any Anthropic model

  • Secure API key management

  • Support for workspace segmentation

  • Automatic API versioning

  • Comprehensive error handling

  • Experimental context window management

Related MCP server: Perplexity Insight MCP Server

Why Use This Server?

Unlike direct API integration, this server:

  • Provides a standardized MCP interface for Anthropic's API

  • Handles authentication and versioning automatically

  • Supports workspace isolation for different use cases

  • Integrates seamlessly with Claude Desktop and other MCP clients

  • Includes detailed error messages and validation

  • Potentially extends conversation context windows through distributed processing

Context Window Management Hypothesis

This server explores efficient context window management through distributed processing:

Claim: Offloading processing to separate API calls through the MCP server may reduce context window pressure on the main Claude Desktop conversation.

Primary Hypothesis: By branching conversation processing across multiple isolated API instances, the total effective context window of a conversation can be extended beyond standard limitations.

Key Mechanisms:

  • Main conversation (trunk) retains only final outputs and discussion

  • Individual API calls maintain isolated contexts

  • Processing can be distributed across multiple model instances

Testing Scenarios:

  1. Context Window Extension

    • Compare context limits with and without API offloading

    • Measure conversation longevity in both scenarios

    • Track rate limit encounters

  2. Processing Distribution

    • Haiku for rapid initial processing

    • Sonnet for medium-sized aggregation

    • Opus for comprehensive analysis

Installation

npm install server-anthropic

Tool Reference

list_models

Lists all available Anthropic models and their capabilities.

Arguments:

{
  // No arguments required
}

Returns:

{
  "models": [
    {
      "name": "claude-3-opus-20240229",
      "description": "Most powerful model for highly complex tasks",
      ...
    },
    ...
  ]
}

send_message

Send a message to an Anthropic model using the Messages API.

Arguments:

{
  "messages": {
    "type": "array",
    "description": "Array of messages to send",
    "items": {
      "role": "user | assistant",
      "content": "string"
    },
    "required": true
  },
  "model": {
    "type": "string",
    "description": "Model ID to use",
    "default": "claude-3-opus-20240229"
  },
  "max_tokens": {
    "type": "number",
    "description": "Maximum tokens to generate",
    "default": 1024
  }
}

Returns:

{
  "content": [
    {
      "type": "text",
      "text": "Model response..."
    }
  ]
}

Usage with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "anthropic": {
      "command": "npx",
      "args": ["-y", "server-anthropic"],
      "env": {
        "ANTHROPIC_API_KEY": "your-api-key-here",
        "ANTHROPIC_WORKSPACE_ID": "optional-workspace-id"
      }
    }
  }
}

Environment Variables

Variable

Required

Description

ANTHROPIC_API_KEY

Yes

Your Anthropic API key from console.anthropic.com

ANTHROPIC_WORKSPACE_ID

No

Optional workspace ID for usage segmentation

Dependencies

  • @modelcontextprotocol/sdk - Core MCP functionality

  • @anthropic-ai/sdk - Official Anthropic API client

Error Handling

The server provides detailed error messages for common issues:

  • Invalid API key

  • Missing required parameters

  • Rate limiting

  • Model-specific errors

  • Network connectivity issues

Development

  1. Clone the repository

  2. Install dependencies: npm install

  3. Set up environment variables in .env:

    ANTHROPIC_API_KEY=your-api-key
    ANTHROPIC_WORKSPACE_ID=optional-workspace
  4. Start the server: npm start

Version Notes (0.1.0-beta)

Current beta version focuses on:

  • Core MCP server functionality

  • Context window management testing

  • API integration stability

  • Initial hypothesis validation

Known limitations:

  • Context window behavior requires further testing

  • Rate limiting patterns under investigation

  • Workspace segmentation impact on context management undefined

License

MIT

Available Tools

2 tools
list_modelsA

List all available Anthropic models and their capabilities. Access requires a valid API key configured through the ANTHROPIC_API_KEY environment variable.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden. It accurately discloses the need for an API key, which is a critical behavioral constraint. No contradictions are present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the action and resource, with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and zero parameters, the description adequately covers purpose and access requirements. It hints at output (capabilities) but does not detail structure, which is acceptable for a simple list tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters, the schema description coverage is 100%. The description does not add parameter information as there are none, which is appropriate. Baseline for 0 parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'list' and the resource 'all available Anthropic models and their capabilities', effectively distinguishing it from the sibling tool 'send_message' which is for messaging.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly mentions a prerequisite (valid API key) and implies usage for listing models. While it does not explicitly exclude other scenarios, the sibling context aids in differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_messageA

Send a message to an Anthropic model using the Messages API. Requires authentication via ANTHROPIC_API_KEY environment variable. Optionally supports workspace segmentation via ANTHROPIC_WORKSPACE_ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of messages to send
modelNoModel ID to use (e.g., claude-3-opus-20240229)claude-3-opus-20240229
max_tokensNoMaximum tokens to generate

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only mentions authentication requirements, omitting important behavioral traits such as rate limits, error handling, whether the operation is destructive, or what the response contains. This is insufficient for an agent to fully understand tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences, no redundant information, and front-loads the core purpose. Every word contributes value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema), the description adequately covers purpose and authentication but fails to mention the return value or behavior. It is minimally viable but has clear gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the schema already documents all parameters. The description adds no additional parameter semantics beyond the schema, warranting a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Send a message to an Anthropic model using the Messages API.' It identifies the specific verb (send), resource (message to Anthropic model), and API context. It differentiates from the sibling tool 'list_models' which lists models, not sending messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context by mentioning authentication requirements (ANTHROPIC_API_KEY) and optional workspace segmentation. However, it does not explicitly state when not to use this tool or mention alternatives, limiting guidance for the AI agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedlist_models
    • First observedsend_message

TDQS

A3.9/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: list_models provides information about available models, while send_message executes a message to a model. There is no overlap or ambiguity.

Naming Consistency5/5

Both tool names follow a consistent verb_noun pattern with underscores: list_models and send_message. The naming is clear and predictable.

Tool Count3/5

With only 2 tools, the server feels thin for its intended purpose of interacting with the Anthropic API. While the tools are essential, additional tools like streaming or model details would be expected.

Completeness3/5

The server covers basic operations (list models and send a message) but lacks common features like streaming, message history, or batch operations. Notable gaps exist for a full API surface.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/emzimmer/server-anthropic'

If you have feedback or need assistance with the MCP directory API, please join our Discord server