mcp-apollo-config
by xsg22
README.md
# mcp-apollo-config
MCP server for Apollo Config Center using **portal username/password login**, implemented with **FastMCP**.
## Install
```bash
pip install mcp-apollo-config
```
Local editable install:
```bash
pip install -e .
```
## Auth Mode
The plugin authenticates by portal session:
1. `POST /signin` with username/password
2. Receives login session cookie (`SESSION` or `JSESSIONID`)
3. Uses portal management APIs under `/apps/{appId}/envs/{env}/...`
No OpenAPI token is required.
## Governance Mode
- `readonly` (default): query only
- `editable`: query + edit (requires `--operator`)
## MCP Configuration
Configure the server in your MCP client with `command` + `args`:
```json
{
"mcpServers": {
"apollo": {
"command": "mcp-apollo-config",
"args": [
"--portal-url", "http://apollo-portal.example.com",
"--username", "your.username",
"--password", "your.password",
"--governance-mode", "readonly",
"--default-app-id", "your-app-id",
"--default-env", "DEV",
"--default-cluster", "default",
"--default-namespace", "application"
]
}
}
}
```
## Full Parameters
Required:
- `--portal-url` or `APOLLO_PORTAL_URL`
- `--username` or `APOLLO_USERNAME`
- `--password` or `APOLLO_PASSWORD`
Optional:
- `--login-submit` or `APOLLO_LOGIN_SUBMIT`
- `--governance-mode` or `APOLLO_GOVERNANCE_MODE`: `readonly|editable`
- `--operator` or `APOLLO_OPERATOR` (required in editable mode)
- `--default-app-id` or `APOLLO_DEFAULT_APP_ID`
- `--default-env` or `APOLLO_DEFAULT_ENV` (for example `DEV`, `TEST`)
- `--default-cluster` or `APOLLO_DEFAULT_CLUSTER` (default: `default`)
- `--default-namespace` or `APOLLO_DEFAULT_NAMESPACE`
- `--timeout-ms` or `APOLLO_TIMEOUT_MS` (default: `10000`)
- `--log-level` or `MCP_APOLLO_LOG_LEVEL`: `DEBUG|INFO|WARN|ERROR` (default: `WARN`)
- `--debug-http` or `MCP_APOLLO_DEBUG_HTTP=true`
## Tools
- `apollo_get_namespace_configs`: query all key/value items under a namespace/environment/cluster with pagination controls (`pageSize`, `maxItems`).
- `apollo_get_key`: query one config key under a namespace/environment/cluster.
- `apollo_edit_key` (editable mode only): create or update one key and return the updated item.
## Tests
Local tests use a **mock Apollo portal server** and do not require real credentials or network access.
```bash
python -m unittest discover -s tests -p "test_*.py"
```
Covered scenarios:
- `tools/list` in readonly and editable mode
- `apollo_get_key`
- `apollo_get_namespace_configs`
- `apollo_edit_key`
- Portal session login + cookie flow
## Notes
- The management API path includes `/envs/{env}`. Set `--default-env` or pass `env` in tool arguments.
- The server is built on FastMCP and runs in stdio transport mode.
- After editing a key, Apollo release may still be needed before clients see the change.
- Avoid keeping `DEBUG` logs enabled in production for long periods.
## Chinese README
- [README.zh-CN.md](/E:/workspace/mcp-apollo/README.zh-CN.md)
TDQS
B3.1/5.0
Scored across 2 tools
Disambiguation5/5
The two tools have clearly distinct purposes: one retrieves a single key, the other retrieves all configs under a namespace. No overlap in functionality.
Naming Consistency5/5
Both tools follow a consistent 'apollo_get_<thing>' pattern in snake_case, making it predictable and easy to understand.
Tool Count4/5
With only 2 tools, the surface is thin but appropriate for a read-only query interface focused on single key and full namespace config retrieval.
Completeness2/5
The server lacks any write operations (create, update, delete) and only provides basic read capabilities. Significant gaps exist for managing configurations.
Maintenance
ActivityInactive
ResponsivenessNo issues