Claude Desktop API USE VIA 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.
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.
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.
No special configuration needed
API Token (via this MCP server):
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
Install Dependencies
pip install -r requirements.txt
Configure Environment
# Copy environment template
cp .env.example .env
# Edit .env and add your API key
ANTHROPIC_API_KEY=your_api_key_here
Configure Claude Desktop
~/Library/Application Support/Claude/
# Using Finder:
# 1. Press Cmd + Shift + G
# 2. Enter: ~/Library/Application Support/Claude/
%APPDATA%Claude
claude_desktop_config.json
config/claude_desktop_config.json
No special commands needed
API Usage
@claude-api Please answer using the API: What is the capital of France?
Using System Prompts
@claude-api {"system_prompt": "You are an expert fitness coach"} Create a workout plan
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
query_claude
Conversation tracking
clear_conversation
Manage multiple conversation threads
get_conversation_history
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)}"
Ensure API key has correct permissions
Connection Issues
Check Claude Desktop logs
Usage Issues
MIT
For issues and questions: 1. Open an issue in the repository 2. Check existing discussions 3. Review the troubleshooting guide
[
{
"description": "Send a message to Claude",
"inputSchema": {
"properties": {
"message": {
"description": "Message to send to Claude",
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
},
"name": "send-message"
}
]