mcp-server-boilerplate
The MCP Server Boilerplate is a TypeScript and Express-based starter implementation for the Model Context Protocol (MCP), facilitating standardized communication with language models. It includes key features like HTTP/stdio transport, sample resources, tools, and prompts for ease of use and extension.
Overview
This project implements a server that follows the Model Context Protocol (MCP), which allows applications to provide context for LLMs in a standardized way. It includes:
- A fully configured MCP server with HTTP and stdio transport options
- Sample resources, tools, and prompts to demonstrate key functionality
- TypeScript support for type safety and better developer experience
- Express integration for the HTTP transport layer
Getting Started
Prerequisites
- Node.js (v18 or later)
- npm or yarn
Installation
Clone the repository and install dependencies.
Environment Variables
Configure environment settings in the .env
file.
Running the Server
Build and start the HTTP server or run in stdio mode.
Resources
- Static Info Resource: Provides basic information about the server.
- Dynamic Greeting Resource: Generates personalized greetings.
Tools
- Calculator: Performs arithmetic operations.
- Timestamp: Provides current time in different formats.
Prompts
- Greeting: Creates a personalized greeting prompt.
- Analyze Data: Data analysis prompt with various formats.
Extending the Server
Guidelines provided for adding new resources, tools, and prompts.
Testing and Debugging
Use tools like MCP Inspector and client libraries for testing.
License
Licensed under the MIT License.