Skip to main content
Glama

Simple MCP Server Demo πŸš€

A full-featured demonstration project for the Model Context Protocol (MCP) built with TypeScript and @modelcontextprotocol/sdk.

This project showcases all three primary primitives of the MCP standard:

  1. πŸ› οΈ Tools β€” Functions and actions executed by the AI model.

  2. πŸ“„ Resources β€” Data sources and context attachments read by the AI model via URIs.

  3. πŸ’¬ Prompts β€” Reusable, parameterized prompt templates and workflows.

It is structured to run both locally via Stdio (for Claude Desktop, IDEs, Inspector) and in the cloud on Vercel as a Serverless API (using Web Standards Streamable HTTP transport).


🌟 Features Included

1. Tools

  • get_greeting: Greets a user by name with a friendly message.

  • calculate: Performs arithmetic operations (add, subtract, multiply, divide, power) with safety checks (e.g. division by zero).

  • fetch_weather: Fetches live, real-time weather forecasts for any city worldwide using the free Open-Meteo REST API (no API key required).

  • add_note: Creates and stores a note in server memory with a custom ID.

  • list_notes: Lists all notes currently stored in server memory.

2. Resources

  • Static Resource (system://info): Returns host OS, Node.js version, memory usage, uptime, and timestamp in JSON format.

  • Dynamic Resource Template (notes://{id}): Reads specific note details and markdown content dynamically by ID.

3. Prompts

  • code_review: A structured code review prompt template that instructs the LLM to inspect code for security, performance, readability, and recommendations.

  • summarize_notes: A prompt template that pulls all stored server notes and asks the model for an executive summary.


Related MCP server: creating-your-first-mcp-server

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)

  • npm

Installation

npm install

Development

Run the server locally over Stdio:

npm run dev

Run Local Automated Test Suite

npm test

Type Checking

npm run typecheck

πŸ” Testing Interactively with MCP Inspector

The official MCP Inspector provides an interactive web UI to test and debug your MCP server:

npx @modelcontextprotocol/inspector tsx src/stdio.ts

Once running, open the URL provided in your terminal (usually http://localhost:5173) to test:

  • Tools tab: Execute calculate, fetch_weather (e.g. city: "Tokyo"), add_note, and list_notes.

  • Resources tab: Read system://info or notes://welcome.

  • Prompts tab: Test the code_review and summarize_notes templates.


πŸ”Œ Connecting to Local MCP Clients (Claude Desktop)

Add the following to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "simple-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "tsx",
        "/Users/saheel-ahmed/Projects/demos/saheel-git-repo/simple-mcp-project/src/stdio.ts"
      ]
    }
  }
}

☁️ Deploying to Vercel

This repository includes a serverless endpoint ready for Vercel in api/index.ts using WebStandardStreamableHTTPServerTransport.

Deploy using Vercel CLI

npx vercel

Follow the interactive prompts to link and deploy your project.

Or Deploy via GitHub

  1. Push this repository to GitHub.

  2. Go to vercel.com/new and import the repository.

  3. Click Deploy.

Once deployed, your remote MCP server endpoint will be live at:

https://<your-project-name>.vercel.app/api

Remote MCP clients can connect to this URL using the SSE/Streamable HTTP transport!


πŸ“‚ Project Structure

simple-mcp-project/
β”œβ”€β”€ api/
β”‚   └── index.ts          # Vercel Serverless Function entrypoint (HTTP / Web Standards)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts          # Local entrypoint (Stdio transport)
β”‚   β”œβ”€β”€ server.ts         # MCP Server definition (Tools, Resources, Prompts)
β”‚   └── test-client.ts    # Automated integration test suite
β”œβ”€β”€ tsconfig.json         # TypeScript configuration
β”œβ”€β”€ vercel.json           # Vercel routing configuration
β”œβ”€β”€ package.json          # Dependencies, scripts, and build setup
└── README.md             # Project documentation

Available Tools

5 tools
add_noteA

Stores a new note in server memory.

Inputs: id (required), title (required), content (required).

calculateA

Performs arithmetic operations (add, subtract, multiply, divide, power).

Inputs: a (required), b (required), operation (required).

fetch_weatherA

Fetches live weather forecast for any city using Open-Meteo.

Inputs: city (required).

get_greetingB

Returns a personalized welcome message.

Inputs: name (required).

list_notesA

Lists all available notes stored in server memory.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool addresses a distinct function: greeting, arithmetic, weather, and note management. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    Tool names follow a consistent snake_case verb pattern, mostly verb_noun (get_greeting, fetch_weather, add_note, list_notes). 'calculate' is a lone verb but still fits the predictable style.

    Tool Count5/5

    Five tools is a reasonable size for a simple utility server. Each tool has a clear purpose and none feel redundant or excessive.

    Completeness4/5

    Core functionality for each utility is present, but note management lacks delete or update operations. This is a minor gap for a simple note-taking feature, not a critical omission.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A demonstration MCP server showcasing tools (calculator, file operations, weather, timestamp), resources (server config, system info, documentation), and reusable prompt templates for code review, documentation, and debugging.
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      This MCP server provides tools like weather lookup and follows the Model Context Protocol for tool calling, resource sharing, and prompt templates.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to call weather tools, read resources, and use prompt templates for live weather data integration.
      2,530 npm
      MIT