Example TypeScript MCP server with E2E test patterns

Example TypeScript MCP server with E2E test patterns

mcp-server-e2e-testing-example•bymkusaka

A minimal TypeScript Model Context Protocol server provided as a template, with an E2E testing setup demonstrating a raw stdio approach and an SDK in-memory transport approach.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides a createServer() factory exposing resources, prompts and tools.
  • •Includes a CLI entrypoint using tsx and stdio transport.
  • •Tests the server end-to-end by spawning the CLI and sending JSON-RPC over stdin/stdout.
  • •Tests the same server logic in memory using the MCP SDK Client and InMemoryTransport without spawning a child process.

BEST FOR

  • •Developers wanting a template for building a TypeScript MCP server.
  • •Engineers setting up E2E tests for an MCP server using Vitest.

ABOUT MCP-SERVER-E2E-TESTING-EXAMPLE

Example TypeScript MCP server with E2E test patterns is cataloged as an MCP server attributed to mkusaka. A minimal TypeScript Model Context Protocol server provided as a template, with an E2E testing setup demonstrating a raw stdio approach and an SDK in-memory transport approach. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Example TypeScript MCP server with E2E test patterns are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What testing patterns does this example show for MCP servers?

It demonstrates a raw approach that spawns the CLI with tsx and communicates over stdio using JSON-RPC, and an SDK approach using the official MCP SDK Client and InMemoryTransport for in-memory RPC.

Upstream README

View this exact version on GitHub

README.md · 9ee08d382949 · Fetched 2026-11-13 13:42:36 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MCP Server E2E Testing Example

A minimal example repository demonstrating two patterns for end‑to‑end (E2E) testing a TypeScript MCP (Model Context Protocol) server using Vitest:

  • Raw approach: Spawning the CLI with tsx and communicating over stdio (JSON‑RPC).
  • SDK approach: Using the official MCP SDK’s Client and InMemoryTransport for in‑memory RPC.

Repository: https://github.com/mkusaka/mcp-server-e2e-testing-example


📁 Repository Layout

.
├── LICENSE
├── README.md
├── package.json
├── pnpm-lock.yaml
├── src
│   ├── cli.ts         # CLI entrypoint (tsx + stdio transport)
│   └── server.ts      # createServer() factory (resources, prompts, tools)
├── tests
│   └── e2e
│       ├── raw.spec.ts  # spawn‑based E2E tests
│       └── sdk.spec.ts  # SDK/InMemoryTransport‑based E2E tests
└── tsconfig.json

🚀 Getting Started

Prerequisites

  • Node.js ≥ 16
  • pnpm installed globally
  • Git

Installation

# Clone the repo
git clone https://github.com/mkusaka/mcp-server-e2e-testing-example.git
cd mcp-server-e2e-testing-example

# Install dependencies
pnpm install

🧪 Running E2E Tests

1. Raw (spawn + stdio) tests

This suite launches the CLI (src/cli.ts) via npx tsx and sends JSON‑RPC over stdin/stdout.

pnpm vitest run tests/e2e/raw.spec.ts

2. SDK (in‑memory) tests

This suite uses the MCP SDK’s Client + InMemoryTransport to invoke the same server logic without spawning a child process.

pnpm vitest run tests/e2e/sdk.spec.ts

🛠️ Scripts

Add these to package.json if desired:

{
  "scripts": {
    "test:raw": "vitest run tests/e2e/raw.spec.ts",
    "test:sdk": "vitest run tests/e2e/sdk.spec.ts",
    "test": "vitest run"
  }
}
  • pnpm run test:raw – Run only the raw/stdio tests
  • pnpm run test:sdk – Run only the in‑memory SDK tests
  • pnpm run test – Run all tests

📦 Publishing & Usage

This repository is intended as an example/template. Feel free to:

  • Adapt the src/server.ts factory for your own MCP server
  • Expand raw.spec.ts and sdk.spec.ts with additional test cases
  • Integrate into your CI pipeline

📄 License

Released under the MIT License.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Example TypeScript MCP server with E2E test patterns from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-server-e2e-testing-example)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools