MCP Agent Execution Runtime
A runtime for inspectable agent workflows that provides MCP tools, bounded Python execution, session memory, and deterministic evaluation.
README
MCP Agent Execution Runtime
A Python runtime for inspectable agent workflows and AI-augmented software delivery. It combines MCP tools, bounded code execution, session-scoped context, change-risk analysis, intelligent test selection, optional evidence-cited LLM review, policy decisions, traces, and regression evaluation.
What it implements
- Official stdio Model Context Protocol server built with the MCP Python SDK.
- Five tools:
run_agent_workflow,run_bounded_python,get_session_context,list_runtime_skills, andreview_sdlc_change. - An AI-augmented SDLC review tool that parses unified diffs, ranks repository context within a character budget, maps changed paths to tests, detects rule-based risk signals, and drafts review documentation.
- An opt-in OpenAI-compatible review adapter with an untrusted-context prompt boundary, strict JSON validation, evidence-ID enforcement, graceful fallback, and mandatory human review.
- Declarative skill registry mapping named skills to capabilities and risk levels without duplicating execution logic.
- Role-separated planner, execution, and reviewer subagents coordinated by a workflow orchestrator.
- Expression-only Python execution in an isolated child interpreter with AST allowlists, an empty working directory, a cleared environment, timeouts, output limits, and best-effort POSIX CPU, memory, file, and descriptor limits.
- SQLite session memory with namespace validation, entry and context-window limits, secret redaction, and explicit deletion.
- JSONL observability traces containing hashes, timings, policy results, and status without raw prompts or secrets.
- Deterministic evaluation cases with a quality gate and JSON/Markdown reports.
- Unit, integration, MCP client/server, and policy-denial tests in GitHub Actions.
Architecture
flowchart LR
A["MCP client"] --> B["Official stdio MCP server"]
B --> C["Runtime tool service"]
C --> D["Workflow orchestrator"]
C --> M["SDLC change-review service"]
D --> E["Planner subagent"]
D --> F["Execution subagent"]
D --> G["Reviewer subagent"]
D --> L["Declarative skill registry"]
F --> H["Bounded Python child process"]
D --> I["SQLite session memory"]
C --> J["JSONL trace recorder"]
M --> J
M --> N["Optional OpenAI-compatible LLM"]
K["Evaluation cases"] --> C
See docs/architecture.md for module responsibilities and docs/security.md for the execution threat model.
Run locally
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
python -m unittest discover -s tests -v
mcp-agent-runtime eval --cases evals/runtime_cases.json --report-dir reports
mcp-agent-runtime sdlc-eval --cases evals/sdlc_review_cases.json --report-dir reports
mcp-agent-runtime run "calculate: sum([4, 8, 15, 16, 23, 42])" --session example
Run the MCP server
mcp-agent-runtime mcp
Configure a compatible MCP client to start the installed
mcp-agent-runtime executable with the mcp argument. The integration test
launches the server over stdio, completes initialization, lists all five tools,
and calls both the workflow and SDLC review tools.
AI-augmented SDLC review
review_sdlc_change always runs deterministic context selection, change-risk
analysis, test mapping, and documentation drafting. Set use_llm=true to add a
review from an OpenAI-compatible endpoint:
export SDLC_LLM_BASE_URL="https://provider.example/v1"
export SDLC_LLM_MODEL="review-model"
export SDLC_LLM_API_KEY="replace-at-runtime"
mcp-agent-runtime mcp
The API key is read only from the environment. Repository snippets are marked untrusted, context and output are bounded, cited evidence IDs must be present in the packet, invalid provider output fails closed to an empty model finding set, and every response requires human review. See docs/sdlc-review.md.
Evaluation gate
mcp-agent-runtime eval --cases evals/runtime_cases.json --report-dir reports
mcp-agent-runtime sdlc-eval --cases evals/sdlc_review_cases.json --report-dir reports
The runtime cases cover allowed operations and policy denial. The SDLC cases cover security, delivery, data-contract, test-selection, human-review, and context-budget behavior. A release passes only when every case in both suites meets its expected outcome.
Container execution
Build the image:
docker build -t mcp-agent-execution-runtime .
Run the MCP server with additional container restrictions:
docker run --rm -i \
--network none \
--read-only \
--tmpfs /tmp:rw,noexec,nosuid,size=64m \
--pids-limit 64 \
--memory 256m \
--cpus 0.5 \
mcp-agent-execution-runtime mcp
Security boundaries
The expression runner is layered and deliberately narrow. It is useful for demonstrating policy enforcement and resource controls, but it is not described as a complete hostile-code security boundary. Production execution should add an independently hardened container or microVM boundary, syscall filtering, per-tenant credentials, network policy, image provenance, and centralized audit storage. See docs/security.md.
Evidence boundaries
This is a portfolio runtime using deterministic subagents, local storage, and an optional provider adapter. CI does not send code to an LLM, and the project does not operate against customer repositories, measure organization-level developer productivity, automate merge decisions, prove production scale, or claim production-grade isolation. Those limits are intentional and documented so the implemented controls remain interview-defensible.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。