Skip to main content

Apollo Configuration Center MCP Server - 使大语言模型通过 MCP 协议操作 Apollo 配置中心

Project description

Apollo MCP Server

Apollo 配置中心的 MCP (Model Context Protocol) 服务,使大语言模型能够通过配置的 Apollo 地址和 Token 对 Apollo 进行查询和操作。

v1.0.0 说明:本期仅完成 Apollo 的读取能力,写入(新增/修改/删除配置、发布、回滚等)已实现接口但暂未测试,且需 Token 在 Portal 中具备相应赋权。

功能

基于 Apollo 开放平台接口文档 实现以下能力:

  • 应用与集群:list_apps、get_app_env_clusters、get_cluster、create_cluster
  • 命名空间:list_namespaces、get_namespace、create_namespace、get_namespace_lock
  • 配置项:list_items、get_item、create_item、update_item、delete_item
  • 发布与回滚:get_latest_release、publish_release、rollback_release
  • 应用创建:create_app

前提条件

  1. Apollo Portal 已部署并可访问
  2. 在 Portal 的 http://{portal_address}/open/add-consumer.html 创建第三方应用并获取 Token
  3. http://{portal_address}/open/manage.html 为 Token 绑定可操作的 Namespace

安装

使用 uv(推荐)

uv pip install -e .

使用 pip

pip install -e .

配置

使用方式

apollo-mcp-server --url http://your-apollo-portal:8070 --token your_open_api_token

--url 为 Apollo Portal 根地址(不含 /openapi/v1/ 后缀),如 http://localhost:8070

python -m mcp_server_apollo --url http://your-apollo-portal:8070 --token your_open_api_token

Claude Desktop 配置

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "apollo": {
      "command": "uvx",
      "args": [
        "apollo-mcp-server",
        "--url",
        "http://your-apollo-portal:8070",
        "--token",
        "your_open_api_token"
      ]
    }
  }
}

若使用 pip 安装:

{
  "mcpServers": {
    "apollo": {
      "command": "python",
      "args": [
        "-m",
        "mcp_server_apollo",
        "--url",
        "http://your-apollo-portal:8070",
        "--token",
        "your_open_api_token"
      ]
    }
  }
}

开发

# 安装依赖
pip install -e .

# 本地运行(无需安装,从项目目录)
PYTHONPATH=src python -m mcp_server_apollo --url http://localhost:8070 --token your_token

# 或安装后直接运行
apollo-mcp-server --url http://localhost:8070 --token your_token

许可证

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apollo_mcp_server-1.0.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apollo_mcp_server-1.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file apollo_mcp_server-1.0.0.tar.gz.

File metadata

  • Download URL: apollo_mcp_server-1.0.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for apollo_mcp_server-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a4b05bc9fb9a54ee7f55bcb8a00248f22a59d77ad267c85e30204e9fc1884cb4
MD5 471e81def1e4b44e0996d97944b71296
BLAKE2b-256 f217591e1b61b7bcb50d9e92aa7d8cc95bf1494cc9b014261a9a6d9d18797104

See more details on using hashes here.

File details

Details for the file apollo_mcp_server-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for apollo_mcp_server-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fead4f8b27ffc7b86796514ada8c26666ebb03ed821dd676c3c13fe555c9b8d
MD5 092f233c55b1e708313cde2895a0c4cb
BLAKE2b-256 89ae6dfd3afbef748b709172b5e07cf1daeef883cd4f59ece8cb2dd9105eec9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page