Skip to content

EdEngineering/mcp-example-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Example Server 🔧

A simple Model Context Protocol (MCP) server built with the official TypeScript SDK that demonstrates the three MCP primitives: Tools, Resources, and Prompts.

What is MCP?

Model Context Protocol is an open protocol by Anthropic that standardizes how LLMs connect to external tools and data sources. Think of it as USB-C for AI integrations — build once, works with any MCP-compatible host (Claude Desktop, Cursor, OpenClaw, etc.).

Architecture

┌─────────────┐   JSON-RPC   ┌──────────────────┐
│  MCP Host   │ ◄──────────► │  MCP Server      │
│  (LLM app)  │   stdio/SSE  │  (this project)  │
└─────────────┘              └──────────────────┘

Three Primitives

Primitive Purpose Example in this server
Tools Functions the LLM can invoke get_system_info, generate_password, convert_timestamp
Resources Data the LLM can read config://server
Prompts Reusable prompt templates summarize-system

Tools

get_system_info

Returns current system info: hostname, platform, CPU, memory, uptime, load average.

generate_password

Generate a random cryptographically-secure password.

Parameters:

  • length (4-128, default 16)
  • uppercase (default true)
  • lowercase (default true)
  • numbers (default true)
  • symbols (default false)

convert_timestamp

Convert between Unix timestamp and human-readable date.

Parameters:

  • value — Unix timestamp (number) or ISO date string

Quick Start

# Install dependencies
npm install

# Run the server (stdio transport)
npm start

# Or use the MCP Inspector for testing
npm run inspect

Using with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "system-info": {
      "command": "node",
      "args": ["/path/to/mcp-example-server/index.js"]
    }
  }
}

Using with OpenClaw

Add to your openclaw.json under mcp.servers:

{
  "mcp": {
    "servers": {
      "system-info": {
        "command": "node",
        "args": ["index.js"],
        "cwd": "/path/to/mcp-example-server"
      }
    }
  }
}

License

MIT

About

Example MCP server — system info, password generator & timestamp converter tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors