Skip to main content
Glama
mlobo2012

Claude Desktop API MCP

by mlobo2012

MCP 経由の Claude デスクトップ API 統合

このプロジェクトは、Claude DesktopとClaude APIのシームレスな統合を可能にするMCPサーバー実装を提供します。これにより、プロフェッショナルプランの制限を回避し、カスタムシステムプロンプトや会話管理などの高度な機能にアクセスできます。

特徴

  • MCP 経由の Claude API の直接統合

  • 会話履歴の追跡と管理

  • システムプロンプトのサポート

  • プロフェッショナルプランとAPI使用間のシームレスな切り替え

  • Claude Desktopで簡単に設定

Related MCP server: Desktop Commander MCP

いつ使うか

  • プロフェッショナルプラン(デフォルト):

    • クロードデスクトップでの定期的な会話

    • プラン制限内での基本的な使用

    • 特別な設定は必要ありません

  • API トークン(この MCP サーバー経由):

    • より長いコンテキストウィンドウが必要な場合

    • カスタムシステムプロンプトを使用するには

    • レート制限を回避するには

    • 高度な会話管理

セットアップ手順

  1. リポジトリのクローンを作成する

    # 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. 依存関係をインストールする

    pip install -r requirements.txt
  3. 環境を構成する

    # Copy environment template
    cp .env.example .env
    
    # Edit .env and add your API key
    ANTHROPIC_API_KEY=your_api_key_here
  4. Claudeデスクトップの設定

    • macOS: ~/Library/Application Support/Claude/に移動します。

      # Using Finder:
      # 1. Press Cmd + Shift + G
      # 2. Enter: ~/Library/Application Support/Claude/
    • Windows: %APPDATA%\Claude\に移動します。

    • claude_desktop_config.jsonを作成または編集する

    • config/claude_desktop_config.jsonから内容をコピーします。

    • パスとAPIキーを更新する

使用ガイド

基本的な使い方

  1. 通常のクロードデスクトップの使用

    • クロードと普通にチャットする

    • プロフェッショナルプランを使用する

    • 特別なコマンドは必要ありません

  2. APIの使用

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

高度な機能

  1. システムプロンプトの使用

    @claude-api {"system_prompt": "You are an expert fitness coach"} Create a workout plan
  2. 会話の管理

    # 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

コスト管理

  • API呼び出しにはAnthropic APIクレジットが使用され、料金が発生する場合があります

  • 通常の問い合わせにはプロフェッショナルプランをご利用ください

  • 特に必要な場合にのみ @claude-api を使用してください。

    • より長いコンテキストウィンドウ

    • カスタムシステムプロンプト

    • レート制限を回避するには

利用可能なMCPツール

  1. query_claude

    • Claudeへの直接API呼び出し

    • システムプロンプトのサポート

    • 会話の追跡

  2. clear_conversation

    • 会話履歴をリセット

    • 複数の会話スレッドを管理する

  3. get_conversation_history

    • 会話記録を取得する

    • 会話フローをデバッグする

発達

メインのサーバー実装はsrc/claude_api_server.pyにあります。機能を拡張するには、 @mcp.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)}"

トラブルシューティング

  1. APIキーの問題

    • .env で API キーを確認する

    • Claude Desktopの設定パスを確認する

    • APIキーに正しい権限があることを確認する

  2. 接続の問題

    • MCPサーバーが実行中かどうかを確認する

    • Python環境を確認する

    • Claude Desktopのログを確認する

  3. 使用上の問題

    • @claude-api 構文が正しいことを確認する

    • 会話IDを確認する

    • システムプロンプトの形式を確認する

貢献

  1. リポジトリをフォークする

  2. 機能ブランチを作成する

  3. 変更を加える

  4. プルリクエストを送信する

ライセンス

マサチューセッツ工科大学

サポート

問題や質問については:

  1. リポジトリで問題を開く

  2. 既存の議論を確認する

  3. トラブルシューティングガイドを確認する

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