CentralOps MCP Server
Exposes a curated subset of the CentralOps HTTP API as typed tools for Claude Code, enabling drift triage, mapping edits, backfill jobs, and quarantine reprocess without raw HTTP calls.
README
CentralOps MCP Server
Model Context Protocol (MCP) server that exposes a curated subset of the CentralOps HTTP API as typed tools, so internal developers can drive drift triage, mapping edits, backfill jobs and quarantine reprocess from Claude Code without writing raw HTTP calls.
The server runs as a stdio MCP transport inside a container — Claude Code spawns
docker run --rm -i ... per session, no extra service is added to the CentralOps
compose stack, no port is exposed.
Status
Stable for internal use. Authenticates with a CentralOps Personal Access Token
(PAT) or Service Account token issued at /settings/tokens — the same
credential model used by external integrations. Cookie/session auth was removed
in Fase 2 (commit history under feat(pat): …).
Tools
25 tools, grouped by what they let the agent see or do.
Vendor-side visibility (read)
How the vendor is connected, healthy and behaving.
| Tool | Purpose |
|---|---|
list_integrations |
Vendors connected, status, last_error, capabilities. |
get_integration |
Full configuration of one integration (secrets masked unless permitted). |
get_integration_health |
Live health check (manager + indexer for Wazuh, OAuth for Sophos…). |
get_integration_overview |
Aggregated dashboard: counters, recent activity, per-stream summary. |
list_integration_alerts |
Alerts already collected and normalized for an integration. |
list_supported_platforms |
Platforms the backend can connect to. |
Collection pipeline (read)
What is being polled and from where.
| Tool | Purpose |
|---|---|
list_collector_vendors |
(platform, stream) pairs the collector knows how to poll. |
list_collection_state |
Per-stream cursor, last_success_at, last_error, consecutive_failures. |
get_collector_summary |
Global view across all integrations the user can see. |
Raw payloads & drift (read — the "what is the vendor sending?" set)
| Tool | Purpose |
|---|---|
get_mapping_samples |
Raw events from the sample reservoir for a (vendor, event_type) — the actual JSON the collector received. |
get_quarantine_event |
One quarantined event with its full raw_payload — useful when a specific shape broke a mapping. |
list_quarantine |
Quarantined events, filterable by vendor/integration/error_kind. |
list_drift_fields |
Unknown raw fields the drift sampler observed but no mapping consumes. |
discover_mapping_fields |
Fields already discovered for this mapping's vendor/event_type — JMESPath autocomplete source. |
Mappings catalog & history (read)
| Tool | Purpose |
|---|---|
list_mappings |
Catalog of mapping definitions. |
get_mapping |
Definition + version history for a single mapping. |
diff_mapping_versions |
Structured diff between two versions of a mapping. |
list_mapping_audit |
Who changed what, when. |
Backfill (read)
| Tool | Purpose |
|---|---|
list_backfill_jobs |
Jobs for an integration. |
get_backfill_job |
One job snapshot. |
Mutating — safe
| Tool | Purpose |
|---|---|
dry_run_mapping |
Validate rules against the sample reservoir. Issues an ack_token when called with definition_id. |
request_backfill |
Enqueue a backfill window (max 90 days). Returns job_id. |
reprocess_quarantine |
Reprocess up to 50 quarantined events. Backend is idempotent. |
Destructive — gated
| Tool | Purpose |
|---|---|
commit_mapping |
Promote a new mapping version. Requires a fresh ack_token from dry_run_mapping for the same definition_id and rules. |
Helper
| Tool | Purpose |
|---|---|
wait_for_backfill_job |
Server-side poll until terminal state. Avoids LLM polling loops. |
commit_mapping is the only destructive tool. It requires an ack_token issued
by dry_run_mapping for the same definition_id and rules; the token expires in
5 minutes and is single-use. The CentralOps backend re-validates and re-runs the
dry-run on commit, so this is defense-in-depth, not the security boundary.
Authentication
The MCP server sends Authorization: Bearer <token> on every request. Generate
the token in CentralOps:
- Log in to CentralOps as the user that should "own" the MCP traffic.
- Go to Settings → API Tokens (
/settings/tokens). - Click Criar token, give it a name (e.g.
claude-code-mcp), pick an expiration (or "Nunca" for a stable dev workflow), and copy thecopsk_…value once — the UI will not show it again. - Optional: select scopes. Without scopes the token inherits the full
permission set of the user. For an MCP that only needs to read drift /
mappings, restrict to e.g.
mappings.read,quarantine.read,integrations.read,audit.read. - Export the token in your shell or paste it into the MCP config below.
Tokens are revocable individually from the same page — losing the laptop or ending the contract no longer means rotating a shared cookie.
A X-Client: centralops-mcp/<version> header is sent on every request so the
backend audit log can distinguish MCP traffic from UI traffic.
When the token is rejected the tool returns a 401 with a hint to regenerate at
/settings/tokens. When the token is valid but lacks the scope a tool
requires, the response is 403 with a permission hint.
Configuration
| Env var | Default | Required | Notes |
|---|---|---|---|
CENTRALOPS_BASE_URL |
http://localhost:3000/api |
recommended | Trailing /api is part of the URL. |
CENTRALOPS_API_TOKEN |
— | yes | PAT or Service Account token starting with copsk_. Generated at <base_url>/settings/tokens. |
CENTRALOPS_TIMEOUT_S |
30 |
no | Per-request timeout. |
CENTRALOPS_VERIFY_TLS |
1 |
no | Set to 0 only for self-signed dev environments. |
CENTRALOPS_LOG_LEVEL |
WARNING |
no | DEBUG to trace requests on stderr. |
Build
docker build -t centralops-mcp:dev mcp/
Use from Claude Code
Add to .mcp.json (project) or your Claude Code user settings:
{
"mcpServers": {
"centralops": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "CENTRALOPS_BASE_URL",
"-e", "CENTRALOPS_API_TOKEN",
"centralops-mcp:dev"
],
"env": {
"CENTRALOPS_BASE_URL": "https://centralops.local/api",
"CENTRALOPS_API_TOKEN": "copsk_..."
}
}
}
}
Then restart Claude Code and run /mcp to confirm the tools are listed.
The token is sensitive — do not commit
.mcp.jsonwith a real value. Prefer reading from your shell, e.g.CENTRALOPS_API_TOKEN=$(pbpaste), or store it in a secret manager (1Password, macOS Keychain, etc).
Local development
cd mcp
python -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/pip install pytest pytest-asyncio
.venv/bin/pytest
Smoke test the image
The MCP handshake requires initialize → notifications/initialized →
tools/list. The trailing sleep keeps stdin open long enough for the server
to emit the second response before EOF closes the pipe:
{
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}'
printf '%s\n' '{"jsonrpc":"2.0","method":"notifications/initialized"}'
printf '%s\n' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
sleep 2
} | docker run --rm -i \
-e CENTRALOPS_BASE_URL="http://localhost:3000/api" \
-e CENTRALOPS_API_TOKEN="copsk_..." \
centralops-mcp:dev
You should see two JSON-RPC responses; the second contains all 11 tools with their schemas.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。