Skip to main content
Glama
mlobo2012

Claude Desktop API MCP

by mlobo2012

Integración de la API de Claude Desktop a través de MCP

Este proyecto proporciona una implementación de servidor MCP que permite una integración fluida entre Claude Desktop y la API de Claude. Permite superar las limitaciones del Plan Profesional y acceder a funciones avanzadas como avisos personalizados del sistema y gestión de conversaciones.

Características

  • Integración directa de la API de Claude a través de MCP

  • Seguimiento y gestión del historial de conversaciones

  • Soporte de avisos del sistema

  • Cambio sin problemas entre el Plan Profesional y el uso de la API

  • Fácil configuración con Claude Desktop

Related MCP server: Desktop Commander MCP

Cuándo utilizarlo

  • Plan Profesional (predeterminado):

    • Conversaciones regulares en Claude Desktop

    • Uso básico dentro de los límites del plan

    • No se necesita ninguna configuración especial

  • Token API (a través de este servidor MCP):

    • Cuando necesitas ventanas de contexto más largas

    • Para utilizar indicaciones del sistema personalizadas

    • Para eludir los límites de velocidad

    • Para una gestión avanzada de conversaciones

Instrucciones de configuración

  1. Clonar el repositorio

    # 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. Instalar dependencias

    pip install -r requirements.txt
  3. Configurar el entorno

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

    • macOS: Vaya a ~/Library/Application Support/Claude/

      # Using Finder:
      # 1. Press Cmd + Shift + G
      # 2. Enter: ~/Library/Application Support/Claude/
    • Windows: navegue a %APPDATA%\Claude\

    • Crear o editar claude_desktop_config.json

    • Copiar el contenido de config/claude_desktop_config.json

    • Actualizar rutas y claves API

Guía de uso

Uso básico

  1. Uso habitual del escritorio de Claude

    • Simplemente chatea normalmente con Claude

    • Utiliza tu Plan Profesional

    • No se necesitan comandos especiales

  2. Uso de la API

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

Funciones avanzadas

  1. Uso de los avisos del sistema

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

    # 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

Gestión de costes

  • Las llamadas API utilizan sus créditos de API de Anthropic y pueden generar cargos

  • Utilice el Plan Profesional para consultas regulares

  • Utilice @claude-api solo cuando necesite específicamente:

    • Ventanas de contexto más largas

    • Indicaciones del sistema personalizadas

    • Para eludir los límites de velocidad

Herramientas MCP disponibles

  1. query_claude

    • Realizar llamadas API directas a Claude

    • Soporte para indicaciones del sistema

    • Seguimiento de conversaciones

  2. clear_conversation

    • Restablecer el historial de conversaciones

    • Administrar múltiples hilos de conversación

  3. get_conversation_history

    • Recuperar registros de conversaciones

    • Flujo de conversación de depuración

Desarrollo

La implementación principal del servidor se encuentra en src/claude_api_server.py . Para ampliar la funcionalidad, puede agregar nuevas herramientas mediante el decorador @mcp.tool() .

Ejemplo de adición de una nueva herramienta:

@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)}"

Solución de problemas

  1. Problemas con la clave API

    • Verifique su clave API en .env

    • Verifique las rutas de configuración de Claude Desktop

    • Asegúrese de que la clave API tenga los permisos correctos

  2. Problemas de conexión

    • Compruebe si el servidor MCP se está ejecutando

    • Verificar el entorno de Python

    • Consultar los registros de Claude Desktop

  3. Problemas de uso

    • Asegúrese de que la sintaxis de @claude-api sea correcta

    • Comprobar los ID de las conversaciones

    • Verificar el formato del mensaje del sistema

Contribuyendo

  1. Bifurcar el repositorio

  2. Crear una rama de características

  3. Realiza tus cambios

  4. Enviar una solicitud de extracción

Licencia

Instituto Tecnológico de Massachusetts (MIT)

Apoyo

Para problemas y preguntas:

  1. Abrir un problema en el repositorio

  2. Consultar las discusiones existentes

  3. Revise la guía de solución de problemas

Available Tools

1 tool
send-messageC

Send a message to Claude

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to send to Claude

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('send a message') but doesn't describe what happens after sending, whether there are rate limits, authentication requirements, response expectations, or error conditions. This leaves significant behavioral uncertainty for an agent.

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 perfectly concise at just 4 words, front-loading the essential action without any wasted words. Every element earns its place, making it immediately understandable while being maximally efficient.

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

Completeness2/5

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

Given no annotations and no output schema, the description is insufficiently complete. It doesn't explain what happens after sending the message, what kind of response to expect, or any behavioral characteristics. For a communication tool with zero structured metadata, more context about the interaction pattern would be needed.

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 schema description coverage is 100%, with the single parameter 'message' clearly documented in the schema. The description doesn't add any parameter information beyond what's already in the schema, so it meets the baseline for high schema coverage without providing additional semantic context.

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

Purpose4/5

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

The description clearly states the verb ('send') and resource ('message to Claude'), making the purpose immediately understandable. However, it doesn't differentiate from siblings since there are none, and could be slightly more specific about what type of message or context this involves.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. With no sibling tools, this is less critical, but still lacks any usage context that would help an agent determine appropriate invocation scenarios.

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.

  1. 1 tool update
    • First observedsend-message

TDQS

B3/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or confusion between tools. The single tool has a clear, distinct purpose that cannot be mistaken for any other tool in the set.

Naming Consistency5/5

A single tool inherently demonstrates perfect naming consistency. There are no other tools to compare against, so no inconsistency can exist in the naming pattern.

Tool Count2/5

One tool is too few for meaningful interaction with a Claude Desktop API. While the tool's purpose is clear, a single send-message operation severely limits functionality and suggests an incomplete or minimal implementation.

Completeness1/5

The tool surface is severely incomplete for a Claude Desktop API. With only send-message, there are no tools for receiving messages, managing conversations, handling settings, or performing any other expected API operations. This creates significant dead ends for agents.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers