Skip to main content
Glama
TypeScript MCP Server

TypeScript MCP Server

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.

Related MCP server: MCP Montano Server

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/KyleAnthonyMcAdam/Typescript-mcp.git
    cd Typescript-mcp
  2. Install dependencies: Run the following command in the project root to install all required packages.

    npm install

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.

npm run dev

Production / Client Mode

For the server to be used by a client application (like Cursor), you must first build the project.

  1. Build the project: This command compiles all TypeScript files from the src directory into JavaScript files in the dist directory.

    npm run build
  2. 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:

{
  "jsonrpc": "2.0",
  "method": "tool/run",
  "params": {
    "name": "calculator",
    "arguments": {
      "expression": "2 * (10 + 5)"
    }
  },
  "id": "request-1"
}

The server will respond with the calculated result.

Available Tools

1 tool
calculatorSimple CalculatorB

A safe calculator that can evaluate mathematical expressions.

Inputs: expression (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose, making it impossible for an agent to misselect between tools.

    Naming Consistency5/5

    Since there is only one tool, naming consistency is inherently perfect. The tool name 'calculator' follows a clear noun-based pattern, which is appropriate for its function, and there are no other tools to compare it against for inconsistency.

    Tool Count2/5

    A single tool is generally too few for a server's purpose, as it limits functionality and scope. While the tool is well-defined, the server likely lacks coverage for broader TypeScript-related tasks, making the count inappropriate for the implied domain.

    Completeness1/5

    The server is severely incomplete for a TypeScript domain, as it only offers a calculator tool with no other TypeScript-specific operations like code analysis, compilation, or linting. This represents a significant gap that will cause agent failures in handling TypeScript tasks.

    Related MCP Connectors

    Related MCP Servers