Skip to main content
Glama

Simple MCP Server

Simple MCP Server

A simple Model Context Protocol (MCP) server example that demonstrates basic MCP functionality.

What it does

This MCP server provides three basic tools:

  1. echo - Echoes back a message you provide
  2. calculator - Performs basic mathematical operations (add, subtract, multiply, divide)
  3. current_time - Returns the current date and time

Prerequisites

  • Node.js 16 or higher
  • npm

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install

Building

Build the TypeScript code:

npm run build

Running the Server

Start the server in development mode:

npm run dev

Or run the built version:

npm start

Testing with Claude Desktop

To test this MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json:

Windows

Location: %APPDATA%\Claude\claude_desktop_config.json

macOS/Linux

Location: ~/Library/Application Support/Claude/claude_desktop_config.json

Configuration:

{ "mcpServers": { "simple-mcp-server": { "command": "node", "args": ["/absolute/path/to/your/project/build/index.js"] } } }

Replace /absolute/path/to/your/project/ with the actual path to your project directory.

Project Structure

├── src/ │ └── index.ts # Main server implementation ├── build/ # Compiled JavaScript (generated) ├── .github/ │ └── copilot-instructions.md # Copilot instructions ├── .vscode/ │ └── mcp.json # VS Code MCP configuration ├── package.json # Project configuration ├── tsconfig.json # TypeScript configuration └── README.md # This file

Tools Available

echo

  • Description: Echo back the provided message
  • Parameters:
    • message (string): The message to echo back

calculator

  • Description: Perform basic mathematical operations
  • Parameters:
    • operation (enum): One of 'add', 'subtract', 'multiply', 'divide'
    • a (number): The first number
    • b (number): The second number

current_time

  • Description: Get the current date and time
  • Parameters: None

Example Usage

Once connected to an MCP client like Claude Desktop, you can use commands like:

  • "Echo back the message 'Hello World'"
  • "Calculate 15 plus 25"
  • "What's the current time?"

Development

This project is set up with:

  • TypeScript for type safety
  • Zod for runtime type validation
  • MCP SDK for protocol compliance
  • ES modules support
Deploy Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

A demonstration server implementing the Model Context Protocol (MCP) that provides three basic tools: echo, calculator, and current time functionality.

  1. What it does
    1. Prerequisites
      1. Installation
        1. Building
          1. Running the Server
            1. Testing with Claude Desktop
              1. Windows
              2. macOS/Linux
            2. Project Structure
              1. Tools Available
                1. echo
                2. calculator
                3. current_time
              2. Example Usage
                1. Development

                  Related MCP Servers

                  • -
                    security
                    A
                    license
                    -
                    quality
                    A demonstration server that implements the Model Context Protocol (MCP) SDK, providing tools and endpoints for server-sent events and message handling.
                    Last updated -
                    19
                    10
                    MIT License
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A simple server implementing the Model Context Protocol (MCP) that echoes messages back, designed for testing MCP clients.
                    Last updated -
                    1
                    2
                    MIT License
                  • -
                    security
                    F
                    license
                    -
                    quality
                    An MCP (Model Context Protocol) server implementation using HTTP SSE (Server-Sent Events) connections with built-in utility tools including echo, time, calculator, and weather query functionality.
                    Last updated -
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A simple Model Context Protocol (MCP) server that provides date and time functionality in any timezone, along with user profiles and personalized greeting resources.
                    Last updated -
                    • Linux
                    • Apple

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/shaleen-wonder-ent/simple-mcp-server'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server