- Explore MCP Servers
- typescript-mcp-demo
Typescript Mcp Demo
What is Typescript Mcp Demo
typescript-mcp-demo is a simple MCP server built on the Model Context Protocol (MCP) using TypeScript. It serves as an example project to demonstrate the creation of an MCP server with basic functionalities.
Use cases
Use cases for typescript-mcp-demo include creating educational applications that demonstrate programming concepts, developing tools for quick calculations, and integrating with other services using MCP for enhanced functionality.
How to use
To use typescript-mcp-demo, install the dependencies using ‘pnpm install’, then build the project with ‘pnpm build’. The compiled files will be located in the ‘dist’ directory. You can then run the server and interact with its tools and resources.
Key features
Key features include a simple addition tool, a dynamic greeting resource, development in TypeScript, and support for standard input/output communication.
Where to use
typescript-mcp-demo can be used in various fields such as software development, educational tools, and any application requiring a simple server-client interaction based on the MCP protocol.
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 Typescript Mcp Demo
typescript-mcp-demo is a simple MCP server built on the Model Context Protocol (MCP) using TypeScript. It serves as an example project to demonstrate the creation of an MCP server with basic functionalities.
Use cases
Use cases for typescript-mcp-demo include creating educational applications that demonstrate programming concepts, developing tools for quick calculations, and integrating with other services using MCP for enhanced functionality.
How to use
To use typescript-mcp-demo, install the dependencies using ‘pnpm install’, then build the project with ‘pnpm build’. The compiled files will be located in the ‘dist’ directory. You can then run the server and interact with its tools and resources.
Key features
Key features include a simple addition tool, a dynamic greeting resource, development in TypeScript, and support for standard input/output communication.
Where to use
typescript-mcp-demo can be used in various fields such as software development, educational tools, and any application requiring a simple server-client interaction based on the MCP protocol.
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
Model Context Protocol (MCP) TypeScript Demo
This is a TypeScript example project based on the Model Context Protocol (MCP), demonstrating how to create a simple MCP server with basic tools and resources functionality.
Language
Features
- Provides a simple addition tool
- Provides a dynamic greeting resource
- Developed with TypeScript
- Supports standard input/output communication
Documentation
- MCP TypeScript SDK - Official TypeScript SDK Documentation
- MCP Inspector - MCP Service Testing Tool Documentation
- Model Context Protocol - MCP Protocol Specification
Requirements
- Node.js >= 20.10.0
- pnpm >= 8.0.0
Installation
- Install dependencies:
pnpm install
- Build the project:
pnpm build
The compiled files will be output to the dist directory.
Examples
- For details about standard input/output (stdio) transport, please refer to Stdio Transport.
- For remote servers using Server-Sent Events (SSE) endpoints and starting a web server with separate endpoints, refer to HTTP with SSE
- OpenAI Integration with Custom MCP Tools Guide
Developing New Features
To add new tools or resources in src/index.ts:
- Use
server.tool()to add new tools - Use
server.resource()to add new resources - Define input parameter types using Zod
- Implement the corresponding processing logic
- Create corresponding test case files
Troubleshooting
If you encounter issues:
- Ensure all dependencies are correctly installed
- Check compilation output for errors
- Verify test case JSON format is correct
- Check process input/output configuration
Notes
- Make sure to use compiled JavaScript files (in the
distdirectory) for testing - Use the
@modelcontextprotocol/inspectortool for testing - Follow JSON-RPC 2.0 specification when writing requests
- Handle asynchronous operations and error cases properly
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.










