Skip to content

dastrobu/mcp-test-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Test Server

A simple Model Context Protocol (MCP) server that provides various tools to test edge cases with MCP clients. Useful for testing error handling in MCP clients.

Features

  • fail: Always returns an error (useful for testing error handling)
  • delay: Delays response for a specified duration (useful for testing timeouts)
  • succeed: Always succeeds (useful for verifying basic connectivity)
  • get_image: Returns an MCP logo image in a specified format (useful for testing image/binary content)
  • add_tool: Dynamically adds a new tool at runtime to session.
  • remove_tool: Dynamically removes a tool at runtime from session.
  • get_image: Returns an MCP logo in various image formats (png, gif, jpeg, webp, avif).
  • log_message: Sends a log message via MCP logging notifications over RPC.
  • Built with the official Model Context Protocol Rust SDK
  • Communicates over stdio (default) or HTTP (Streamable HTTP) for versatile integration

Installation

cargo install --git https://github.com/dastrobu/mcp-test-server

Or build from source:

git clone https://github.com/dastrobu/mcp-test-server
cd mcp-test-server
cargo build --release

Usage

Run the server using stdio (default):

mcp-test-server
# or
mcp-test-server --transport stdio

Run the server using HTTP (Streamable HTTP):

mcp-test-server --transport http --port 3000

The server follows the Model Context Protocol specification.

Available Tools

  • fail: Always returns an error with the message "This tool always fails intentionally for testing purposes"
  • delay: Takes duration_seconds (integer) and sleeps for that amount of time before returning success.
  • succeed: Returns a success message immediately.
  • get_image: Returns an MCP logo image in the specified format. Takes type (one of png, gif, jpeg, webp, avif), and optionally audience (array of user and/or assistant) and priority (float from 0.0 to 1.0) for annotations.
  • add_tool: Adds a dynamic tool. Takes name (string) and input_json_schema (object).
  • remove_tool: Removes a dynamic tool. Takes name (string).
  • get_image: Returns an MCP logo image. Takes type (enum: png, gif, jpeg, webp, avif) and optional audience and priority.
  • log_message: Sends a log message. Takes level (enum: debug, info, notice, warning, error, critical, alert, emergency), message (string), and optional logger (string).

About

A simple Model Context Protocol (MCP) server that provides various tools to test edge cases with MCP clients. Useful for testing error handling in MCP clients.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors