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
前提条件
- Apollo Portal 已部署并可访问
- 在 Portal 的
http://{portal_address}/open/add-consumer.html创建第三方应用并获取 Token - 在
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b05bc9fb9a54ee7f55bcb8a00248f22a59d77ad267c85e30204e9fc1884cb4
|
|
| MD5 |
471e81def1e4b44e0996d97944b71296
|
|
| BLAKE2b-256 |
f217591e1b61b7bcb50d9e92aa7d8cc95bf1494cc9b014261a9a6d9d18797104
|
File details
Details for the file apollo_mcp_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: apollo_mcp_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fead4f8b27ffc7b86796514ada8c26666ebb03ed821dd676c3c13fe555c9b8d
|
|
| MD5 |
092f233c55b1e708313cde2895a0c4cb
|
|
| BLAKE2b-256 |
89ae6dfd3afbef748b709172b5e07cf1daeef883cd4f59ece8cb2dd9105eec9e
|