Claude Desktop API MCP

v1.0.0APIsstable

MCP server implementation for using Claude API with Claude Desktop, providing advanced API integration and conversation management.

claude-desktop-api-use-via-mcpmcpai-integration
Share:
34
Stars
0
Downloads
0
Weekly
0/5

What is Claude Desktop API MCP?

Claude Desktop API MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server implementation for using claude api with claude desktop, providing advanced api integration and conversation management.

MCP server implementation for using Claude API with Claude Desktop, providing advanced API integration and conversation management.

This server falls under the APIs and Coding Agents categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP server implementation for using Claude API with Claude D

Use Cases

Use Claude API with Claude Desktop client.
Manage conversations and API integration.
Enable advanced API features through MCP.
mlobo2012

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 29, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx claude-desktop-api-use-via-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Claude Desktop API MCP

Claude Desktop API Use via MCP is a Python-based MCP server that bridges Claude Desktop with the Anthropic Claude API, enabling Claude Desktop users to make direct API calls beyond their Professional Plan limits — with support for custom system prompts, named conversation threads, longer context windows, and conversation history management. It exposes three MCP tools (query_claude, clear_conversation, and get_conversation_history) and is invoked by prefixing messages with @claude-api in Claude Desktop. Developers and power users who want to use Claude Desktop as a front-end while programmatically controlling model parameters and maintaining persistent conversation state will find it useful.

Prerequisites

  • Python 3.8 or higher with pip
  • An Anthropic API key (obtainable from https://console.anthropic.com/)
  • Claude Desktop installed and running
  • Git for cloning the repository
1

Clone the repository

Clone the project to a local directory. The main server implementation lives in src/claude_api_server.py.

git clone https://github.com/mlobo2012/Claude_Desktop_API_USE_VIA_MCP.git
cd Claude_Desktop_API_USE_VIA_MCP
2

Install Python dependencies

Install the required packages from the requirements.txt file into your Python environment.

pip install -r requirements.txt
3

Configure your Anthropic API key

Copy the example environment file and add your Anthropic API key. The server reads ANTHROPIC_API_KEY from this file at startup.

cp .env.example .env
# Edit .env and set:
# ANTHROPIC_API_KEY=your_api_key_here
4

Register the MCP server with Claude Desktop

Copy the bundled config template into the Claude Desktop config directory and update the path to point to your local clone. On macOS the config directory is ~/Library/Application Support/Claude/.

{
  "mcpServers": {
    "claude-api": {
      "command": "python",
      "args": ["/absolute/path/to/Claude_Desktop_API_USE_VIA_MCP/src/claude_api_server.py"],
      "env": {
        "ANTHROPIC_API_KEY": "your_api_key_here"
      }
    }
  }
}
5

Restart Claude Desktop

Quit and relaunch Claude Desktop. The three API tools (query_claude, clear_conversation, get_conversation_history) will be registered and available when you use the @claude-api prefix.

Claude Desktop API MCP Examples

Client configuration

Claude Desktop configuration pointing to the local Python server. Replace the path with the absolute path to your clone.

{
  "mcpServers": {
    "claude-api": {
      "command": "python",
      "args": ["/absolute/path/to/Claude_Desktop_API_USE_VIA_MCP/src/claude_api_server.py"],
      "env": {
        "ANTHROPIC_API_KEY": "your_api_key_here"
      }
    }
  }
}

Prompts to try

Use these patterns directly in Claude Desktop to invoke the MCP tools. The @claude-api prefix routes the request through the server to the Anthropic API.

- "@claude-api What is the capital of France?"
- "@claude-api {\"system_prompt\": \"You are an expert fitness coach\"} Create a 30-day workout plan"
- "@claude-api {\"conversation_id\": \"project1\"} Let's discuss Python best practices"
- "@claude-api {\"conversation_id\": \"project1\"} Continue — what about error handling?"
- "@claude-api get_conversation_history project1"
- "@claude-api clear_conversation project1"

Troubleshooting Claude Desktop API MCP

API key not recognised — server returns an authentication error

Verify that ANTHROPIC_API_KEY is correctly set in your .env file and that the path to the .env file matches the working directory from which the server is launched. You can also pass the key directly in the env block of the MCP config as shown above.

Claude Desktop does not show the @claude-api tools after restart

Check that the absolute path in the args array points to the correct claude_api_server.py file and that Python is on the system PATH. You can test by running `python /path/to/src/claude_api_server.py` directly in a terminal to see any startup errors.

Conversation history is not retained between sessions

Conversation history is stored in memory while the MCP server process is running. If Claude Desktop restarts the server process, history is lost. Use the @claude-api get_conversation_history <id> tool before a restart to review the thread, or extend claude_api_server.py to persist history to a JSON file.

Frequently Asked Questions about Claude Desktop API MCP

What is Claude Desktop API MCP?

Claude Desktop API MCP is a Model Context Protocol (MCP) server that mcp server implementation for using claude api with claude desktop, providing advanced api integration and conversation management. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Claude Desktop API MCP?

Follow the installation instructions on the Claude Desktop API MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Claude Desktop API MCP?

Claude Desktop API MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Claude Desktop API MCP free to use?

Yes, Claude Desktop API MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "claude-desktop-api-use-via-mcp": { "command": "npx", "args": ["-y", "claude-desktop-api-use-via-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Claude Desktop API MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides