Token导航 LogoToken导航TokenDH.com
Claude Desktop API MCP logo
搜索检索stdio官方级别未说明来源级核验

Claude Desktop API MCP

MCP Server

MCP server implementation for using Claude API with Claude Desktop, providing advanced API integration and conversation management.

工具数

0

提示词数

0

GitHub Stars

34

资源数

0
API集成对话管理PythonClaude开发工具Claude DesktopClaudeVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mlobo2012

提供方

mlobo2012

最后核验

2026/5/18 04:03

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

Claude Desktop API通过MCP集成

该项目提供了一个MCP服务器实现,可以实现Claude Desktop和Claude API之间的无缝集成。它允许您绕过专业计划的限制,并访问自定义系统提示和对话管理等高级功能。

特性

  • 通过MCP直接集成Claude API
  • 会话历史跟踪和管理
  • 系统提示支持
  • 专业计划和API使用之间的无缝切换
  • 使用Claude Desktop轻松配置

何时使用

  • 专业计划 (默认):

- Claude Desktop中的定期对话 - 计划范围内的基本使用 - 无需特殊配置

  • 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
  1. 再进行
   pip install -r requirements.txt
  1. 配置环境
   # Copy environment template
   cp .env.example .env

   # Edit .env and add your API key
   ANTHROPIC_API_KEY=your_api_key_here
  1. 配置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. 常规克劳德桌面使用

- 只需与Claude正常聊天 - 使用您的专业计划 - 无需特殊命令

  1. 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
  1. 管理对话
   # 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

- 直接打API电话给Claude - 支持系统提示 - 对话跟踪

  1. clear_conversation

- 重置对话历史记录 - 管理多个对话线程

  1. 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密钥具有正确的权限

  1. 连接问题

- 检查MCP服务器是否正在运行 - 验证Python环境 - 检查克劳德桌面日志

  1. 使用问题

- 确保@claude-api语法正确 - 检查对话ID - 验证系统提示格式

贡献

  1. 分叉存储库
  2. 创建要素分支
  3. 进行更改
  4. 提交拉取请求

许可证

麻省理工学院

支持

对于问题和疑问:

  1. 在存储库中打开问题
  2. 检查现有讨论
  3. 查看故障排除指南

目录标签

目录标签

API集成对话管理PythonClaude开发工具research-and-datamathgptmath-solvermath-assistant本地部署自定义提示AI助手

支持客户端

Claude DesktopClaudeVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP