MCP Server E2E Testing Example
@mkusaka
关于 MCP Server E2E Testing Example
暂无概览
基本信息
配置
工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is MCP Server E2E Testing Example?
MCP Server E2E Testing Example is a minimal reference repository that demonstrates two end‑to‑end testing patterns for a TypeScript Model Context Protocol (MCP) server using Vitest. It is intended for developers who build MCP servers and want to validate them via automated tests.
How to use MCP Server E2E Testing Example?
Clone the repository, install dependencies with pnpm install, then run the desired test suite: pnpm vitest run tests/e2e/raw.spec.ts (spawn‑based raw tests) or pnpm vitest run tests/e2e/sdk.spec.ts (in‑memory SDK tests). Convenience scripts (pnpm run test:raw, pnpm run test:sdk, pnpm run test) can be added to package.json.
Key features of MCP Server E2E Testing Example
- Two E2E testing approaches: raw and SDK
- Uses Vitest as the test runner
- Raw approach spawns CLI with
tsxand usesstdio - SDK approach uses
ClientandInMemoryTransport - Includes an example server with resources, prompts, and tools
- Ready‑to‑run test suites and a reproducible layout
Use cases of MCP Server E2E Testing Example
- E2E testing of a TypeScript MCP server before deployment
- Verifying server responses to JSON‑RPC messages over
stdio - Comparing raw process‑spawn testing with in‑memory SDK testing
- Adapting as a template for adding E2E tests to existing MCP servers
- Integrating MCP server tests into a continuous integration pipeline
FAQ from MCP Server E2E Testing Example
What are the prerequisites for using MCP Server E2E Testing Example?
Node.js ≥ 16, pnpm installed globally, and Git are required.
How do I run the raw (spawn + stdio) tests?
Execute pnpm vitest run tests/e2e/raw.spec.ts from the repository root.
How do I run the SDK (in‑memory) tests?
Execute pnpm vitest run tests/e2e/sdk.spec.ts to run tests that use the MCP SDK’s Client and InMemoryTransport.
What is the difference between the raw and SDK testing approaches?
The raw approach spawns a child process (npx tsx src/cli.ts) and communicates over stdin/stdout via JSON‑RPC. The SDK approach invokes the same server logic in‑process using the MCP SDK’s InMemoryTransport, avoiding process spawning.
Is MCP Server E2E Testing Example intended for production use?
No, it is explicitly a minimal example and template. Users are encouraged to adapt the server factory (src/server.ts) and expand the test suites for their own MCP servers.
其他 分类下的更多 MCP 服务器
MCP Go 🚀
mark3labsA Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
Reactive Resume
amruthpillaiA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
ghidraMCP
LaurieWiredMCP Server for Ghidra
Servers
modelcontextprotocolModel Context Protocol Servers
评论