MCPSERV.CLUB
thoughtspot

MCP Testing Kit

MCP Server

Test your MCP servers effortlessly

Active(70)
10stars
3views
Updated 15 days ago

About

A lightweight, framework‑agnostic library that connects to Model Context Protocol servers, sends requests, receives notifications, and enables assertions in tests.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

MCP Testing Kit in Action

The mcp‑testing‑kit is a lightweight, framework‑agnostic utility library designed to make unit and integration testing of Model Context Protocol (MCP) servers straightforward. It solves the common pain point of having to spin up a full HTTP or SSE transport layer just to verify that your MCP server behaves correctly. By creating an in‑process, dummy transport, the kit lets developers invoke tools, resources, and prompts directly against a running server instance while still exercising the same JSON‑RPC protocol that an external AI assistant would use.

At its core, the kit exposes two simple functions: and . spawns a mock client that mirrors the public API of an MCP client, offering methods such as , , , and . These helpers abstract away the intricacies of JSON‑RPC message construction, allowing tests to focus on input and output rather than protocol plumbing. The client also supports notification handlers (, , ) so that tests can assert side‑effects or streaming behavior without needing a real network connection.

Key features include:

  • Framework agnostic: Works seamlessly with Vitest, Jest, Mocha, or any other testing framework that supports async tests.
  • TypeScript support: Full type definitions for server and client interactions keep codebases safe from runtime errors.
  • Minimal footprint: Only the essential utilities are bundled, keeping test suites lean and fast.
  • Rich API surface: Beyond simple tool calls, the client can list resources, retrieve prompts with parameters, and send raw JSON‑RPC requests for edge‑case testing.

Real‑world use cases abound: a developer building an MCP server can write end‑to‑end tests that validate tool logic, resource registration, and prompt rendering without deploying the server to a remote host. QA teams can assert that error handling paths emit correct notifications, while performance engineers can measure latency of in‑process calls to ensure responsiveness before exposing the server to production assistants. Because the kit operates entirely in‑memory, tests run quickly and deterministically, making it ideal for continuous integration pipelines.

The standout advantage of mcp‑testing‑kit is its directness. By bypassing the network stack, it eliminates flakiness caused by DNS resolution or transient connectivity issues, while still exercising the full MCP protocol stack. This gives developers confidence that their server will behave exactly as expected when a real AI assistant connects over HTTP or SSE, all within the safety and speed of local unit tests.