Overview
What is Template for MCP Server?
Template for MCP Server is a starting point for building an MCP server. It provides a simple string reversal tool, supports both stdio and SSE transports, and is implemented in TypeScript with a full build process. It is intended to be duplicated and customized.
How to use Template for MCP Server?
Install dependencies with npm install. Run the default stdio transport using bash run-server.sh or run with SSE transport via TRANSPORT_TYPE=sse npm run start (SSE server runs on port 4000 by default, configurable in CONST.ts). Test with MCP Inspector using npx fastmcp inspect server.ts.
Key features of Template for MCP Server
- Simple string reversal tool
- Support for both stdio and SSE transports
- TypeScript implementation with full build process
- Includes a
reversetool and two greeting resources - Hot reload development mode (
npm run dev) - Build outputs to
distdirectory
Use cases of Template for MCP Server
- Kickstarting a new MCP server project
- Learning MCP server structure and tool/resource implementation
- Rapid prototyping of string processing tools
- Testing MCP transport behavior (stdio vs SSE)
FAQ from Template for MCP Server
What transports does Template for MCP Server support?
It supports stdio (default) and SSE transports.
What tool is included in Template for MCP Server?
A reverse tool that takes a string input and returns it reversed.
What resources are available?
Two resources: greeting://hello (a welcome greeting) and welcome://info (information about the server and its capabilities).
How can I test the server?
Use the MCP Inspector: run npx fastmcp inspect server.ts, then execute the run-server.sh file with stdio and no arguments.
What are the prerequisites for running the server?
Node.js v14 or higher and npm.