Provides integration with Git for version control and project distribution through repository cloning
Hosts the project repository on GitHub, allowing for easy access and contribution to the codebase
Leverages Node.js as the runtime environment for the MCP server, enabling communication with client applications over standard input/output
Integrates with Nodemon for development mode, enabling automatic server restarts when code changes are detected for efficient tool testing
Uses npm for package management and provides scripts for building and running the server in different modes
Provides a server implementation in TypeScript for the Model Context Protocol, featuring strict type checking and well-documented code structure
TypeScript MCP Server
This project is a simple Model Context Protocol (MCP) server built with TypeScript. It is designed to be a starting point for creating your own MCP servers and includes a basic calculator
tool as an example.
The server is configured to communicate with a client application (like Cursor) over standard input/output (stdio).
Features
- MCP Server: Implements the Model Context Protocol standard via
stdio
. - Calculator Tool: A safe
calculator
tool that evaluates mathematical expressions. - TypeScript: Fully written in TypeScript with strict type checking.
- Well-Documented: Code is documented, and a full
SETUP.md
is included. - Ready to Run: Includes npm scripts and a batch file for easy building and execution.
Prerequisites
Installation
- Clone the repository:
- Install dependencies:
Run the following command in the project root to install all required packages.
Usage
Development Mode
For development, you can run the server using nodemon
, which will automatically restart the server whenever you make changes to the source code. This is useful for testing tools without needing to connect to a full client.
Production / Client Mode
For the server to be used by a client application (like Cursor), you must first build the project.
- Build the project:
This command compiles all TypeScript files from the
src
directory into JavaScript files in thedist
directory. - Run the server from a client: The server is not meant to be run directly by the user in the terminal. Instead, it must be started by an MCP client application.
Connecting with a Client
To connect this server with a client like Cursor, you must add it to the client's configuration file (e.g., a global mcp.json
). This configuration tells the client how to launch your server.
Crucially, the command
or args
in the configuration must use an absolute path to the launch script or server file. This path will be different on every machine.
For detailed instructions on how to set up the project from scratch and configure a client, please see the SETUP.md file.
Example run-server.bat
This project includes a run-server.bat
file which simplifies the process of running the server from a client on Windows. It ensures that the Node.js server starts with the correct settings.
Example: Calling the Calculator Tool
Once the client is configured and connected, it can call the calculator
tool with a request like this:
The server will respond with the calculated result.
This server cannot be installed
A simple Model Context Protocol server implemented in TypeScript that enables communication with client applications (like Cursor) over standard input/output and includes a basic calculator tool as an example.
Related MCP Servers
- AsecurityFlicenseAqualityA TypeScript-based template for developing Model Context Protocol servers with features like dependency injection and service-based architecture, facilitating the creation and integration of custom data processing tools.Last updated -12TypeScript
- -securityFlicense-qualityA Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.Last updated -6451Python
- -securityFlicense-qualityA TypeScript-based server project that can be integrated with Cursor IDE as an MCP (Model Control Protocol) server, enabling enhanced development capabilities.Last updated -4TypeScript
- -securityFlicense-qualityA simple TypeScript library for creating Model Context Protocol (MCP) servers with features like type safety, parameter validation, and a minimal code API.Last updated -1TypeScriptMIT License