Skip to main content
Glama
YunYouJun

Starter MCP Server

by YunYouJun

starter-mcp-server

A modern MCP (Model Context Protocol) server starter template with CLI support.

Features

  • 🚀 Dual Mode: Works as both MCP server and CLI tool

  • 🔧 Built-in Tools: Weather alerts and forecasts (NWS API)

  • ♻️ Code Reuse: Shared business logic between MCP and CLI

  • 📦 Type Safe: Full TypeScript support

  • Tested: Comprehensive test coverage

  • 🎯 Simple: Minimal architecture, easy to extend

Quick Start

# Install dependencies
pnpm install

# Build the project
pnpm build

# Run as MCP server (default)
node dist/cli.mjs

# Or use CLI commands
node dist/cli.mjs get-alerts CA
node dist/cli.mjs get-forecast 39.7456 -97.0892

# Quick start with npm scripts
pnpm cli:help      # Show help
pnpm cli:alerts    # Example: Get CA alerts
pnpm cli:forecast  # Example: Get forecast
pnpm demo          # Run full demo

CLI Usage

# Start MCP server (no arguments)
node dist/cli.mjs

# Get weather alerts for a state
node dist/cli.mjs get-alerts CA

# Get weather forecast for a location
node dist/cli.mjs get-forecast 39.7456 -97.0892

# Show help
node dist/cli.mjs --help

For detailed CLI documentation, see CLI_USAGE.md.

MCP Server Configuration

Add to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/starter-mcp-server/dist/index.mjs"]
    }
  }
}

Or use via npx:

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "starter-mcp-server@latest"]
    }
  }
}

Development

# Run tests
pnpm test

# Type check
pnpm typecheck

# Lint
pnpm lint

# Debug with MCP Inspector
pnpx @modelcontextprotocol/inspector node dist/index.mjs

Project Structure

src/
├── lib/
│   └── weather.ts          # Core business logic
├── tools/
│   ├── get-alerts.ts       # MCP tool registration
│   └── get-forecast.ts
├── cli.ts                  # CLI entry point
├── server.ts               # MCP Server instance
└── index.ts                # MCP Server entry point

Adding New Tools

See CLI_USAGE.md for detailed instructions.

Quick overview:

  1. Add business logic in src/lib/

  2. Register MCP tool in src/tools/

  3. Add CLI command in src/cli.ts (optional)

  4. Update src/index.ts to register the tool

Architecture Analysis

For a detailed analysis of the project architecture and design decisions, see ARCHITECTURE_ANALYSIS.md.

Release

# First release
pnpm publish

# Future releases
pnpm run release

References

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

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/YunYouJun/starter-mcp-server'

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