MCPEvent
MCP 事件服务器 — 测试套件
针对 MCP 事件服务器(server.py、events.py、store.py、runtime.py、sources/)的功能聚焦、快速且防挂起的回归测试。
布局
test/
run_all.py # regression driver: isolated subprocess per file, hard 300s/file timeout
helpers/ # lifecycle, mcp, wait, mock_http, runner — shared test support
mcp_result.py # SDK result normalization + safe teardown
test_*.py # one feature per file (the units of the suite)
config.json # base server config (overwritten per-test, restored after)
TEST_RUNTIME_MAP.md # per-file server usage, harness behavior, run guidancetest/ 下的生产源代码已冻结——作为测试工作的一部分,请勿编辑 server.py、events.py、store.py、runtime.py、errors.py、client.py、config.json、requirements.txt 或 sources/*。
Related MCP server: MCP Server & Client Test Environment
运行
# Focused (preferred while debugging one feature):
python test/test_acknowledgement.py
python test/run_all.py --group fast
# Full regression (CI / release only — slow path):
python test/run_all.py
python test/run_all.py --timeout 300参见 TEST_RUNTIME_MAP.md 了解服务器使用矩阵、有界等待策略,以及为什么在开发期间应运行聚焦测试而非完整测试。
原则
除非测试需要 MCP/HTTP 边界,否则不启动服务器。 应用逻辑(存储、事件、路由、检查点/确认、后台任务、源生命周期、去重)直接针对真实对象进行测试,并采用内存存根总线。
每个 D 级文件一个服务器(例外:
test_errors.py/test_reconnect.py中的重启测试,以及test_subscriptions.py中需要不同源配置的测试)。有界等待,无长时间固定休眠。 就绪/计数通过带超时的轮询来实现。
硬超时(300 秒/文件)+ 父进程拥有的清理——运行器终止子进程的进程组,因此挂起的文件会快速失败(报告为 TIMEOUT),且其产生的任何
server.py也会随之终止。不依赖子进程的atexit(在硬终止后无法运行)。
已删除(请勿重新创建)
test/test_phase8.py、test/integrate_test.py——已被上述按功能划分的文件取代。
This server cannot be deployed
Maintenance
Related MCP Connectors
MEOK MCP Test MCP — golden-file + schema-drift + tool-failure tests for any MCP server. Drop-in
MCP server for building and testing AI agents with multi-model experimentation and insights.
An MCP server that provides Javelin Standalone Guardrails
An MCP server that automatically collects feedback on your MCP server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA test server implementing all features of the MCP protocol, including prompts, tools, resources, and sampling, designed for testing MCP clients rather than practical applications.MIT
- FlicenseNot gradedqualityDmaintenanceA testing environment for MCP server setup and client-server interactions, allowing users to verify basic MCP server functionality and test client-server communications including shell command execution.-
- AlicenseBqualityBmaintenanceA Python MCP server with 65 deterministic tools across 8 groups, supporting stdio, HTTP, and REST API transports for consistent MCP protocol testing.65643 PyPI1MIT
- AlicenseAqualityDmaintenanceAn MCP server that reads test reports and provides regression analysis tools for comparing runs, identifying regressions, fixes, and persistent failures.3MIT