Skip to main content
Glama
srvrsoorg

my-mcp-server

by srvrsoorg

My MCP Server

This project implements a Model Context Protocol (MCP) server using Node.js and TypeScript.

Features

  • MCP server with basic tool capabilities

  • Implements a calculate tool for basic mathematical operations: add, subtract, multiply, divide

  • Handles requests via standard input/output (stdio)

Related MCP server: MCP Calculator Demo

Usage

  1. Install dependencies:

    npm install
  2. Build the project:

    npm run build
  3. Start the server:

    npm start

Tool: calculate

Description: Perform basic mathematical calculations Parameters:

  • operation: string (add, subtract, multiply, divide)

  • a: number

  • b: number

Example Prompt

Calculate 15 + 27 using the calculate tool.

Example Request:

{
  "name": "calculate",
  "arguments": {
    "operation": "add",
    "a": 15,
    "b": 27
  }
}

Example Response:

{
  "content": [
    {
      "type": "text",
      "text": "The result of 15 add 27 is 42."
    }
  ]
}

How to Check This MCP Server in VS Code

  1. Open the project folder in VS Code.

  2. Open a new terminal in VS Code (`Ctrl+`` or from the menu).

  3. Make sure dependencies are installed and the server is running:

    npm install
    npm run build
    npm start
  4. You can test the MCP server by sending a request using the terminal. For example:

    echo '{"name": "calculate", "arguments": {"operation": "add", "a": 15, "b": 27}}' | npx ts-node src/server.ts
  5. You should see a response similar to:

    {
      "content": [
        {
          "type": "text",
          "text": "The result of 15 add 27 is 42."
        }
      ]
    }
  6. For more advanced testing, use an MCP client extension or integrate with other MCP-compatible tools in VS Code.

Project Structure

  • src/server.ts: Main MCP server implementation

  • package.json: Project metadata and scripts

  • tsconfig.json: TypeScript configuration

License

MIT

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    A minimal Python-based MCP server that provides standard arithmetic tools including addition, subtraction, multiplication, and division. It allows language models to perform basic mathematical calculations through a standardized interface.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A sample MCP server that provides basic arithmetic tools like addition, subtraction, multiplication, and division. It serves as a demonstration for implementing the Model Context Protocol and connecting custom tools to clients like Claude Desktop.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A stateless MCP server that exposes arithmetic operations (add, subtract, multiply, divide) as tools over HTTP, enabling AI assistants to perform basic calculations conversationally.
    -