MCP Server E2E Testing Example
@mkusaka
About MCP Server E2E Testing Example
No overview available yet
Basic information
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
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.
More Other MCP servers
Awesome Mcp Servers
punkpeyeA collection of MCP servers.
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
Awesome-MCP-ZH
yzflyMCP 资源精选, MCP指南,Claude MCP,MCP Servers, MCP Clients
Inbox Zero AI MCP
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
🚀 Model Context Protocol (MCP) Curriculum for Beginners
microsoftThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable,
Comments