- Explore MCP Servers
- mcp-ts-simple-template
Mcp Ts Simple Template
What is Mcp Ts Simple Template
mcp-ts-simple-template is a lightweight TypeScript template designed for building Model Context Protocol (MCP) servers. It provides the essential scaffolding for creating custom AI tools that can be integrated with large language models.
Use cases
Use cases for mcp-ts-simple-template include developing AI-driven applications, creating interactive tools for data processing, and building custom integrations with existing AI frameworks.
How to use
To use mcp-ts-simple-template, clone the repository and install the dependencies using npm or yarn. Build and start the server by running ‘npm start’. You can modify ‘index.ts’ to add custom tools and compile the code with ‘npm run build’.
Key features
Key features include a basic MCP server implementation, sample tools like a BMI calculator, input validation using Zod, and standard I/O communication setup.
Where to use
mcp-ts-simple-template can be used in AI development, particularly for creating custom tools that interact with large language models and other AI systems.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Ts Simple Template
mcp-ts-simple-template is a lightweight TypeScript template designed for building Model Context Protocol (MCP) servers. It provides the essential scaffolding for creating custom AI tools that can be integrated with large language models.
Use cases
Use cases for mcp-ts-simple-template include developing AI-driven applications, creating interactive tools for data processing, and building custom integrations with existing AI frameworks.
How to use
To use mcp-ts-simple-template, clone the repository and install the dependencies using npm or yarn. Build and start the server by running ‘npm start’. You can modify ‘index.ts’ to add custom tools and compile the code with ‘npm run build’.
Key features
Key features include a basic MCP server implementation, sample tools like a BMI calculator, input validation using Zod, and standard I/O communication setup.
Where to use
mcp-ts-simple-template can be used in AI development, particularly for creating custom tools that interact with large language models and other AI systems.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP TypeScript Simple Template
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.
Overview
This template implements a basic MCP server with a sample BMI calculator tool. It demonstrates how to:
- Set up an MCP server in TypeScript
- Define and implement MCP tools with input validation using Zod
- Connect the server to standard I/O for communication
Prerequisites
- Node.js (v20 or higher recommended)
- npm or yarn
Installation
- Clone this repository
- Install dependencies:
npm install
Project Structure
index.ts- Main server implementation with sample toolpackage.json- Project dependencies and scriptstsconfig.json- TypeScript configuration
Usage
Building and Running
Build and start the server:
npm start
This will compile the TypeScript code and start the MCP server.
Development
For development, you can:
- Modify
index.tsto add your own tools - Run the build command to compile:
npm run build
Creating Custom Tools
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"
}]
})
);
Dependencies
@modelcontextprotocol/sdk- Core MCP SDKzod- Schema validationdotenv- Environment variable managementtypescript- TypeScript compiler
License
ISC
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










