Skip to main content
Glama
Claude Desktop API MCP

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

Inputs: message (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers