Get the FREE Ultimate OpenClaw Setup Guide →

mcp-demo

Enterprise-grade MCP (Model Context Protocol) server demonstrating bare-metal and framework-based implementations with full HTTP/stdio transport support

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tylerjhayden-mcp-demo node dist/servers/bare-metal/index.js \
  --env WEATHER_API_KEY="OpenWeatherMap API key"

How to use

This MCP server implements the MCP (Model Context Protocol) pattern in TypeScript and provides four parallel implementations (bare-metal, FastMCP, EasyMCP, and mcp-framework) to compare approaches while exposing the same capabilities. The server supports three core capabilities: calculate (mathematical expression evaluation with security controls), get_weather (fetching current weather data via OpenWeatherMap), and file access (read operations from the filesystem). It is designed to be run in different transports (stdio for local desktop usage and HTTP/SSE for remote access), with instrumentation for observability and security patterns integrated across implementations. To use it, build the server, start it in HTTP mode or stdio mode, and interact with the capabilities through the same MCP API surface. The repository also demonstrates how tools and resources are discovered and invoked, and how to register capability handlers across the various implementations. For Claude Code users, the project shows how to add the server as a Claude Code tool and verify the connection via the provided list commands. In short, you can test compute operations (calculate), fetch weather data (get_weather), and access files via the same tooling interface, while comparing how different MCP server implementations handle routing, validation, and capability execution.

To run the server locally, ensure you have the weather API key configured in the environment, start the server, and then issue MCP calls (for example via tools/call with calculate or get_weather) over the chosen transport. If you are using Claude Code integration, you can register the server as a Claude Code tool and verify connectivity with a list call. The README also covers how to perform manual HTTP testing and how to switch between development and production modes.

How to install

Prerequisites

  • Node.js 20+ (with npm or pnpm)
  • pnpm 8+ (recommended for this project)
  • OpenWeatherMap API key (free tier OK)

Installation steps

  1. Clone the repository git clone <repository-url> mcp-demo
  2. Navigate to the project cd mcp-demo
  3. Install dependencies (across all implementations) pnpm install
  4. Set up environment variables cp .env.example .env

    Edit .env and add WEATHER_API_KEY with your OpenWeatherMap API key

Build and run (example for the Bare-metal server)

  1. Build the TypeScript sources pnpm build
  2. Run the server in node (dist path may vary by output) node dist/servers/bare-metal/index.js

Claude Code integration (optional)

  • Build the server and register with Claude Code as shown in the README examples.

Notes

  • If using the EasyMCP implementation, be aware it may be unstable due to package exports.
  • If you switch transports, ensure the appropriate environment is configured (e.g., HTTP/SSE requires express and related middleware).

For more details, follow the Quick Start section in the README to switch between development and production modes and to test capabilities via the provided tooling examples.

Additional notes

Tips and caveats:

  • WEATHER_API_KEY must be configured in .env (or environment) for get_weather to function.
  • The server supports two transports: Stdio (local desktop usage) and HTTP/SSE (remote access). Some implementations may enable auto-discovery and tooling enhancements; see /tools and /resources patterns across implementations.
  • EasyMCP is noted as potentially unstable; prefer Bare-metal or FastMCP for stable development workflows.
  • If you plan to test manually, you can run in development mode with TRANSPORT_MODE=http pnpm dev and in production mode with pnpm build followed by pnpm start.
  • Claude Code users can add the server as a tool and then verify connectivity with claude mcp list.
  • The repository emphasizes security (input validation), observability, and reliability across all implementations; expect validation and routing to be framework- and implementation-specific but functionally equivalent at the MCP API level.

Related MCP Servers

Sponsor this space

Reach thousands of developers