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
Servers
modelcontextprotocolModel Context Protocol Servers
Blender
ahujasidOpen-source MCP to use Blender with any LLM
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!
Core Philosophy: Connect, Unify, Respond
mindsdbDelegate anything. It comes back done.
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
Comments