Skip to main content
Glama
shaleen-wonder-ent

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

Related MCP server: Model Context Protocol Demo

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

Available Tools

3 tools
calculatorC

Perform basic mathematical operations

ParametersJSON Schema
NameRequiredDescriptionDefault
operationYesThe mathematical operation to perform
aYesThe first number
bYesThe second number

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the function without mentioning error handling (e.g., division by zero), performance characteristics, or output format. It lacks details on what the tool returns or any behavioral traits beyond the minimal purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, front-loading the core purpose without unnecessary elaboration. It's appropriately sized for a simple tool, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain return values, error cases, or behavioral context, leaving gaps that could hinder an agent's ability to use the tool effectively despite the good schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the parameters (operation, a, b). The description adds no additional meaning beyond what the schema provides, such as examples or constraints, but the baseline is 3 since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Perform basic mathematical operations' states a general purpose but lacks specificity about what constitutes 'basic' operations or which resources are involved. It doesn't distinguish from sibling tools (current_time, echo) since they serve completely different functions, but the description remains vague about scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives or in what contexts it's appropriate. The description doesn't mention any prerequisites, limitations, or comparisons to other tools, leaving the agent with no usage instructions beyond the basic function stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

current_timeA

Get the current date and time

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states what the tool does but doesn't disclose behavioral traits like timezone handling, format of returned time, whether it's real-time or cached, or any rate limits. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple tool with no parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally complete but lacks details on return format or behavioral nuances. It covers the basic purpose adequately but doesn't provide enough context for optimal agent use without additional assumptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add parameter semantics (none exist), which is appropriate, earning a baseline score above 3 due to the absence of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get the current date and time' clearly states the verb ('Get') and resource ('current date and time') with specific scope. It distinguishes from sibling tools (calculator, echo) by focusing on time retrieval rather than computation or message echoing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (when current time is needed) but doesn't explicitly state when to use this tool versus alternatives or any exclusions. No guidance on prerequisites or limitations is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

echoB

Echo back the provided message

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYesThe message to echo back

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'echoes back' the message, implying a simple read/return operation, but doesn't disclose any behavioral traits such as whether it modifies data, has side effects, requires authentication, or has rate limits. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded with a single, clear sentence: 'Echo back the provided message.' There is zero waste, and every word earns its place by directly explaining the tool's function without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one simple parameter) and high schema coverage (100%), the description is minimally adequate. However, with no annotations and no output schema, it lacks details on behavioral aspects and return values, which could be helpful for an agent. It's complete enough for basic understanding but leaves gaps in operational context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'the provided message,' which aligns with the single parameter 'message' in the input schema. Since schema description coverage is 100% (the schema already describes 'message' as 'The message to echo back'), the description adds no additional meaning beyond what the schema provides. The baseline score of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb ('echo back') and resource ('the provided message'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings (calculator, current_time), which are completely different functions, so it doesn't need sibling differentiation but could be more specific about what makes 'echo' unique in this context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or comparisons with sibling tools like calculator or current_time, leaving the agent to infer usage based solely on the tool name and basic function.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updates
    • First observedcalculator
    • First observedcurrent_time
    • First observedecho

TDQS

B3.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: calculator handles math, current_time provides time/date, and echo returns input messages. An agent can easily tell them apart based on their unique functions.

Naming Consistency4/5

The naming is mostly consistent with a clear noun-based pattern (calculator, current_time, echo), though 'current_time' uses snake_case while 'calculator' and 'echo' are single words, which is a minor deviation from perfect uniformity.

Tool Count5/5

With 3 tools, the count is well-scoped for a simple utility server, providing a focused set of basic operations without being too sparse or overwhelming for its apparent purpose.

Completeness4/5

For a simple utility server, the tools cover basic needs (math, time, messaging) with no obvious dead ends, though minor gaps like unit conversion or advanced time functions could exist but are not critical for this scope.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A demonstration server for the Model Context Protocol (MCP) that exposes calculator and Yahoo Finance tools, allowing LLMs to interpret natural language requests and make tool calls via the MCP standard.
    1
    Apache 2.0
  • F
    license
    C
    quality
    D
    maintenance
    A demonstration server based on Model Context Protocol (MCP) that showcases how to build custom tools for AI assistants, providing mathematical calculation and multilingual greeting capabilities.
    3
    -
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server implementation that provides basic utility tools including echo, uppercase text conversion, and mathematical calculations.
    2
    3
    225
    MIT

Latest Blog Posts

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