example-mcp-server-stdio
Enables testing of the MCP server by spawning it as a child process to validate its I/O behavior, supporting various test modes including coverage reporting.
Provides tools for generating Markdown-formatted explanations of calculations, practice problems, and tutoring content through various calculator functions.
Used to visualize and document the sequence diagram of parent-child process communication in the MCP server documentation.
Serves as the runtime environment for the MCP server, managing the process-based architecture and handling stdin/stdout communication streams.
Provides type safety and structure for the MCP server implementation, with the server being built using TypeScript 5.x.
Implements rigorous validation of incoming request parameters through Zod schemas to ensure type safety and prevent injection-style attacks.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@example-mcp-server-stdio calculate 15 * 3 + 7"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
example-mcp-stdio
production-ready, learning-focused starter for MCP servers over STDIO using TypeScript SDK v2.
part of a series: stdio (you are here) · stateless · stateful · sse
what it does
runs an MCP server that communicates exclusively over STDIO (stdin/stdout JSON-RPC, stderr for logs)
ships two tools (
echo,sum_numbers), two resources (starter-checklist,starter-lesson), and one prompt (scaffold-plan)loads features automatically from
src/features/using a file-based registrar patternincludes a scaffold CLI to generate new tools, resources, and prompts from templates
enforces quality with a full pipeline: typecheck, lint, format, build, smoke test
Related MCP server: mcp-serverTest
quick start
git clone https://github.com/yigitkonur/example-mcp-stdio.git
cd example-mcp-stdio
npm cirun in development mode:
npm run devor build and run:
npm run build && npm startvalidate everything:
npm run pipelinescaffold cli
generate new feature modules with a single command:
node dist/index.js create tool my-tool
node dist/index.js create resource my-resource --uri my://resource
node dist/index.js create prompt my-promptgenerated files land in src/features/<kind>/ and are picked up automatically on next server start.
full reference: docs/03-scaffold-cli.md
documentation
doc | what it covers |
reading order and audience guide | |
prerequisites, install, first run, Docker | |
module layout, registrar pattern, STDIO transport model | |
serve and create commands, options, naming conventions | |
vendoring strategy, v2 patterns, migration notes | |
pipeline breakdown, smoke test, mcp-cli verification |
sdk v2 context
this repo targets the TypeScript SDK v2 pre-release (@modelcontextprotocol/server). because v2 is not yet published to npm, the package is vendored as a tarball in vendor/. refresh it with npm run vendor:sdk:update. see docs/04-sdk-v2-notes.md for details.
license
MIT
Available Tools
8 toolsadvanced_calculateAdvanced CalculateB
Perform advanced mathematical operations (factorial, log, combinations, permutations)
Inputs: operation (required), n (required), k, base. Returns: value, expression, calculationId
batch_calculateBatch CalculateC
Perform multiple calculations in a single request
Inputs: calculations (required). Returns: results
calculateCalculateC
Perform a basic arithmetic calculation
Inputs: a (required), b (required), op (required), stream. Returns: meta, value
calculator_assistantCalculator AssistantC
Interactive calculator assistance with context-aware help
Inputs: query (required), context.
demo_progressDemo ProgressB
Demonstrate progress notifications with 5 updates
Inputs: no named parameters. Returns: message, progressSteps
explain_formulaExplain FormulaC
Explain a mathematical formula interactively
Inputs: formula (required), examples.
maintenance_modeMaintenance ModeB
Simulate enabling or disabling tools for maintenance (demo only)
Inputs: toolName (required), enable (required). Returns: status, enabled, message, toolName
solve_math_problemSolve Math ProblemC
Solve a word problem or mathematical expression (may request user input)
Inputs: problem (required), showSteps.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The tools have some overlap in mathematical functionality, such as 'calculate', 'advanced_calculate', and 'solve_math_problem', which could cause confusion about which to use for specific tasks. However, descriptions help differentiate them by scope (e.g., basic vs. advanced, interactive vs. batch). The non-math tools like 'demo_progress' and 'maintenance_mode' are clearly distinct, preventing complete ambiguity.
The naming is mixed with some consistency in verb_noun patterns like 'explain_formula' and 'solve_math_problem', but deviations exist such as 'calculator_assistant' (noun_verb) and 'demo_progress' (verb_noun with a prefix). There's no chaotic naming, but the lack of a uniform convention reduces predictability.
With 8 tools, the count is reasonable for a server focused on mathematical calculations and demonstrations. It's slightly over-scoped due to overlapping math tools, but each tool serves a purpose, and the number aligns well with the apparent domain without being excessive or too thin.
The server covers a range of mathematical operations from basic to advanced, including interactive and batch features, but there are notable gaps such as no clear update or delete operations for stored calculations or data. The inclusion of demo tools like 'maintenance_mode' suggests a focus on functionality rather than full lifecycle coverage, leaving the surface incomplete for broader use cases.
Related MCP Connectors
A simple MCP server built with FastMCP and python
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server allowing any and all command execution over CMD287 npm25MIT
- -
- -
- AlicenseNot gradedqualityDmaintenancestateful MCP server with Redis sessions, event sourcing, and horizontal scaling1MIT