Claude Desktop API MCP

Claude Desktop API MCP

A server that enables Claude Desktop users to access the Claude API directly, allowing them to bypass Professional Plan limitations and use advanced features like custom system prompts and conversation management.

mlobo2012

Developer Tools
Communication
Local
Python
Visit Server

Tools

send-message

Send a message to Claude

README

Claude Desktop API Integration via MCP

This project provides an MCP server implementation that enables seamless integration between Claude Desktop and the Claude API. It allows you to bypass Professional Plan limitations and access advanced features like custom system prompts and conversation management.

Features

  • Direct Claude API integration via MCP
  • Conversation history tracking and management
  • System prompt support
  • Seamless switching between Professional Plan and API usage
  • Easy configuration with Claude Desktop

When to Use

  • Professional Plan (default):

    • Regular conversations in Claude Desktop
    • Basic usage within plan limits
    • No special configuration needed
  • API Token (via this MCP server):

    • When you need longer context windows
    • To use custom system prompts
    • To bypass rate limits
    • For advanced conversation management

Setup Instructions

  1. Clone the Repository

    # Using VS Code:
    # 1. Press Cmd + Shift + P
    # 2. Type "Git: Clone"
    # 3. Paste: https://github.com/mlobo2012/Claude_Desktop_API_USE_VIA_MCP.git
    
    # Or using terminal:
    git clone https://github.com/mlobo2012/Claude_Desktop_API_USE_VIA_MCP.git
    cd Claude_Desktop_API_USE_VIA_MCP
    
  2. Install Dependencies

    pip install -r requirements.txt
    
  3. Configure Environment

    # Copy environment template
    cp .env.example .env
    
    # Edit .env and add your API key
    ANTHROPIC_API_KEY=your_api_key_here
    
  4. Configure Claude Desktop

    • macOS: Navigate to ~/Library/Application Support/Claude/
      # Using Finder:
      # 1. Press Cmd + Shift + G
      # 2. Enter: ~/Library/Application Support/Claude/
      
    • Windows: Navigate to %APPDATA%\Claude\
    • Create or edit claude_desktop_config.json
    • Copy contents from config/claude_desktop_config.json
    • Update paths and API keys

Usage Guide

Basic Usage

  1. Regular Claude Desktop Usage

    • Just chat normally with Claude
    • Uses your Professional Plan
    • No special commands needed
  2. API Usage

    @claude-api Please answer using the API: What is the capital of France?
    

Advanced Features

  1. Using System Prompts

    @claude-api {"system_prompt": "You are an expert fitness coach"} Create a workout plan
    
  2. Managing Conversations

    # Start a new conversation
    @claude-api {"conversation_id": "project1"} Let's discuss Python
    
    # Continue same conversation
    @claude-api {"conversation_id": "project1"} Tell me more
    
    # View conversation history
    @claude-api get_conversation_history project1
    
    # Clear conversation
    @claude-api clear_conversation project1
    

Cost Management

  • API calls use your Anthropic API credits and may incur charges
  • Use the Professional Plan for regular queries
  • Only use @claude-api when you specifically need:
    • Longer context windows
    • Custom system prompts
    • To bypass rate limits

MCP Tools Available

  1. query_claude

    • Make direct API calls to Claude
    • Support for system prompts
    • Conversation tracking
  2. clear_conversation

    • Reset conversation history
    • Manage multiple conversation threads
  3. get_conversation_history

    • Retrieve conversation records
    • Debug conversation flow

Development

The main server implementation is in src/claude_api_server.py. To extend functionality, you can add new tools using the @mcp.tool() decorator.

Example of adding a new tool:

@mcp.tool()
async def custom_tool(param: str) -> str:
    """
    Custom tool description
    
    Args:
        param: Parameter description
    """
    try:
        # Tool implementation
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Troubleshooting

  1. API Key Issues

    • Verify your API key in .env
    • Check Claude Desktop config paths
    • Ensure API key has correct permissions
  2. Connection Issues

    • Check if MCP server is running
    • Verify Python environment
    • Check Claude Desktop logs
  3. Usage Issues

    • Ensure correct @claude-api syntax
    • Check conversation IDs
    • Verify system prompt format

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT

Support

For issues and questions:

  1. Open an issue in the repository
  2. Check existing discussions
  3. Review the troubleshooting guide

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Excel MCP Server

Excel MCP Server

A Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.

Featured
Local
Go
Playwright MCP Server

Playwright MCP Server

Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.

Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Apple MCP Server

Apple MCP Server

Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.

Featured
Local
TypeScript