A foundation for creating custom Model Context Protocol servers that can integrate with AI systems, providing a simple BMI calculator tool as an example implementation.
A simple TypeScript template for building Model Context Protocol (MCP) servers. This project provides a foundation for creating custom MCP tools that can be integrated with AI systems.
This template implements a basic MCP server with a sample BMI calculator tool. It demonstrates how to:
npm install
index.ts
- Main server implementation with sample toolpackage.json
- Project dependencies and scriptstsconfig.json
- TypeScript configurationBuild and start the server:
npm start
This will compile the TypeScript code and start the MCP server.
For development, you can:
index.ts
to add your own toolsnpm run build
To create a new tool, follow this pattern in index.ts
:
server.tool( "your-tool-name", { // Define input schema using Zod paramName: z.string(), // Add more parameters as needed }, async ({ paramName }) => ({ content: [{ type: "text", text: "Your tool's response" }] }) );
@modelcontextprotocol/sdk
- Core MCP SDKzod
- Schema validationdotenv
- Environment variable managementtypescript
- TypeScript compilerISC
Contributions are welcome! Please feel free to submit a Pull Request.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!