Sponsored by Deepsite.site

腾讯云HAI MCP服务器

Created By
avacx9 months ago
腾讯云HAI Model Context Protocol (MCP)服务器
Content

腾讯云HAI MCP服务器

这个项目实现了一个Model Context Protocol (MCP) 服务器,用于连接腾讯云HAI (Hunyuan AI) 服务。通过这个服务器,Claude Desktop/Cline可以直接调用腾讯云HAI的API。

功能特性

  • 列出腾讯云HAI实例
  • 获取特定HAI实例的详细信息
  • 检查HAI实例的状态
  • 根据状态筛选HAI实例
  • 提供HAI实例信息作为资源
  • 分析HAI实例配置并提供建议

安装方法

方法1:从GitHub克隆

  1. 克隆仓库
  2. 创建并激活虚拟环境
  3. 安装依赖
git clone https://github.com/avacx/hai-mcp-server.git
cd hai-mcp-server
python -m venv venv
source venv/bin/activate  # 在Windows上使用 venv\Scripts\activate
pip install -r requirements.txt

方法2:通过pip安装

pip install hai-mcp-server

安装后可以通过命令行直接运行:

hai-mcp-server

方法3:使用Docker

docker pull avacx/hai-mcp-server:latest
docker run -e TENCENTCLOUD_SECRET_ID=你的SecretId -e TENCENTCLOUD_SECRET_KEY=你的SecretKey avacx/hai-mcp-server:latest

在Claude Desktop/Cline中安装

按照以下步骤在Claude Desktop/Cline中安装HAI MCP服务器:

  1. 创建目录:在/Users/你的用户名/Documents/Cline/MCP创建目录(Mac用户)或C:\Users\你的用户名\Documents\Cline\MCP(Windows用户)

  2. 克隆仓库:将GitHub仓库克隆到创建的目录中

    cd /Users/你的用户名/Documents/Cline/MCP
    git clone https://github.com/avacx/hai-mcp-server.git
    cd hai-mcp-server
    
  3. 安装依赖

    python -m venv venv
    source venv/bin/activate  # 在Windows上使用 venv\Scripts\activate
    pip install -r requirements.txt
    
  4. 配置环境变量:复制.env.example文件为.env并填入你的腾讯云API密钥

    cp .env.example .env
    

    编辑.env文件:

    TENCENTCLOUD_SECRET_ID=你的SecretId
    TENCENTCLOUD_SECRET_KEY=你的SecretKey
    TENCENTCLOUD_REGION=ap-beijing
    
  5. 配置Claude Desktop/Cline

    • 打开Claude Desktop/Cline设置文件:
      • Mac: /Users/你的用户名/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
      • Windows: C:\Users\你的用户名\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
    • 添加HAI MCP服务器配置:
    {
      "mcpServers": {
        "hai": {
          "command": "/Users/你的用户名/Documents/Cline/MCP/hai-mcp-server/venv/bin/python",
          "args": ["/Users/你的用户名/Documents/Cline/MCP/hai-mcp-server/run.py"],
          "cwd": "/Users/你的用户名/Documents/Cline/MCP/hai-mcp-server",
          "env": {
            "PYTHONUNBUFFERED": "1",
            "TENCENTCLOUD_SECRET_ID": "你的SecretId",
            "TENCENTCLOUD_SECRET_KEY": "你的SecretKey",
            "TENCENTCLOUD_REGION": "ap-beijing"
          }
        }
      }
    }
    

    Windows用户请使用适当的路径格式:

    {
      "mcpServers": {
        "hai": {
          "command": "C:\\Users\\你的用户名\\Documents\\Cline\\MCP\\hai-mcp-server\\venv\\Scripts\\python.exe",
          "args": ["C:\\Users\\你的用户名\\Documents\\Cline\\MCP\\hai-mcp-server\\run.py"],
          "cwd": "C:\\Users\\你的用户名\\Documents\\Cline\\MCP\\hai-mcp-server",
          "env": {
            "PYTHONUNBUFFERED": "1",
            "TENCENTCLOUD_SECRET_ID": "你的SecretId",
            "TENCENTCLOUD_SECRET_KEY": "你的SecretKey",
            "TENCENTCLOUD_REGION": "ap-beijing"
          }
        }
      }
    }
    
  6. 测试安装:重启Claude Desktop/Cline,然后使用以下提示测试MCP服务器:

    请列出我的腾讯云HAI实例
    

配置

  1. 复制.env.example文件为.env,并填入你的腾讯云API密钥:
cp .env.example .env
  1. 编辑.env文件:
TENCENTCLOUD_SECRET_ID=你的SecretId
TENCENTCLOUD_SECRET_KEY=你的SecretKey
TENCENTCLOUD_REGION=ap-beijing

使用方法

直接运行

使用以下命令启动服务器:

python run.py

或者如果通过pip安装:

hai-mcp-server

命令行工具

查看版本信息:

hai-mcp-server version

启动服务器:

hai-mcp-server server --debug

列出HAI实例:

hai-mcp-server instances

获取特定实例详情:

hai-mcp-server instance 实例ID

项目结构

hai-mcp-server/
├── .env                  # 环境变量配置文件
├── .env.example          # 环境变量示例文件
├── .gitignore            # Git忽略文件
├── README.md             # 项目说明文档
├── claude_desktop_config_example.json  # Claude Desktop配置示例
├── requirements.txt      # 项目依赖
├── run.py                # 服务器启动脚本
├── setup.py              # Python包配置文件
└── hai_mcp/              # 源代码目录
    ├── __init__.py       # 包初始化文件
    ├── hai_client.py     # 腾讯云HAI客户端
    ├── cli.py            # 命令行入口点
    └── server.py         # MCP服务器实现

开发

构建Python包

pip install build twine
python -m build

构建Docker镜像

docker build -t hai-mcp-server:latest .

许可证

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
ChatWiseThe second fastest AI chatbot™
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
DeepChatYour AI Partner on Desktop