MCP Control Plane

MCP Control Plane

A hardened MCP gateway that lets AI agents securely call infrastructure APIs like Kubernetes, Terraform, and Jenkins, with authentication, rate limiting, and OPA policy enforcement.

Category
访问服务器

README

MCP Control Plane

A hardened gateway that sits between AI agents (LLM clients) and real infrastructure APIs (Kubernetes, Terraform, Jenkins, Prometheus, ticketing). Every tool call is authenticated, rate-limited, policy-checked via OPA, and audited before it reaches an executor. The model is treated as an untrusted caller — the policy engine, not the prompt, is the actual security boundary.

Full target architecture, threat model, and API design live in docs/; this README covers what's implemented today and how to run it.

Status

Actively under development, tracked in docs/roadmap.md. Currently implemented:

  • MCP JSON-RPC gateway (tools/list, tools/call) over HTTP, plus an SSE heartbeat endpoint
  • API key authentication, resolving each key to an agent identity (id, role, allowed_tools)
  • Redis-backed sliding-window rate limiting, per agent
  • Tool call interception, normalization, and an OPA policy check (allow / deny / require_approval)
  • 11 tool executors — currently stubs, real downstream API calls land per docs/roadmap.md Phase 3
  • Structured audit logging to stdout (durable, hash-chained Postgres storage is a later phase)

Not yet built: real tool executors, the human-in-the-loop approval workflow, persistent audit storage, and observability (OTel/Grafana) — see the roadmap for sequencing.

Architecture

Agent → POST /mcp → [log] → [authn] → [rate limit] → interceptor → OPA → executor → audit log
  • app/main.py — FastAPI app, route handlers, middleware wiring
  • app/middleware/auth.py — API key → agent identity
  • app/middleware/rate_limit.py — Redis sliding-window limiter
  • app/interceptor.py — validates/normalizes tools/call params into an OPA input document
  • app/authz/opa.py — calls the OPA sidecar, maps its response to allow/deny/require_approval
  • app/tools/tools_spec.py — tool executors (stubs today)
  • app/audit.py — audit trail of every tool call
  • policies/ — Rego policy (authz.rego) and role/tool data (data.json) loaded by OPA

See docs/architecture.md for the full target-state design (EKS, Terraform, Postgres audit log, approval gate, observability stack).

Tech stack

Python 3.13, FastAPI, Redis, OPA/Rego, Docker Compose. See pyproject.toml for exact dependency versions.

Getting started

Prerequisites

  • Python 3.13+ and uv
  • Docker (for Redis/Postgres/OPA via Compose), or your own local instances

Install

uv sync

Run

Everything (gateway + Redis + Postgres + OPA) via Docker Compose:

docker compose up

Or the gateway alone against local dependencies:

uv run uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload

The app reads REDIS_URL (default redis://localhost:6379) and OPA_URL (default http://localhost:8181/v1/data/authz) from the environment; Compose sets both to point at the sibling containers.

Try it

All /mcp routes require an x-api-key header. The seeded dev key test_key resolves to agent01 (role sre1) with a handful of allowed tools — see API_KEYS in app/middleware/auth.py.

curl -s -X POST http://127.0.0.1:8000/mcp \
  -H "Content-Type: application/json" -H "x-api-key: test_key" \
  -d '{"jsonrpc":"2.0","id":"1","method":"tools/list","params":{}}'

curl -s -X POST http://127.0.0.1:8000/mcp \
  -H "Content-Type: application/json" -H "x-api-key: test_key" \
  -d '{"jsonrpc":"2.0","id":"2","method":"tools/call","params":{"name":"get_pod_logs","arguments":{"namespace":"payments","pod_name":"checkout-api-xyz"}}}'

curl -s http://127.0.0.1:8000/health/live

More request/response examples (error cases, SSE) are in testing/testing.text.

Testing

uv run pytest

Covers the auth middleware, rate limiter, OPA integration, and end-to-end /mcp request handling (see tests/).

Documentation

Doc Contents
docs/roadmap.md Phased build plan and current progress
docs/architecture.md Full target-state system design
docs/api-design.md MCP + admin API surface
docs/tool-spec.md Per-tool input/output schemas and policy constraints
docs/threat-model.md STRIDE threat model and mitigations

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选