Skip to main content
Glama
Starter MCP Server

Starter MCP Server

by YunYouJun

starter-mcp-server

npm version npm downloads bundle JSDocs License

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

Related MCP server: MCP TypeScript Template

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

Available Tools

2 tools
get-alertsWeather alertsC

Get weather alerts for a state

Inputs: state (required).

get-forecastWeather forecastC

Get weather forecast for a location

Inputs: latitude (required), longitude (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: one retrieves weather alerts for a state, and the other retrieves weather forecasts for a location. There is no overlap in functionality, making it easy for an agent to select the correct tool based on the need.

    Naming Consistency4/5

    Both tools follow a consistent verb_noun pattern with 'get' as the verb, but they use kebab-case (get-alerts, get-forecast) instead of the more common snake_case. This minor deviation is still readable and predictable, though not perfectly aligned with typical conventions.

    Tool Count2/5

    With only 2 tools, the server feels thin for a weather domain that could include more operations like historical data, radar images, or air quality. While it covers basic alerts and forecasts, the scope is limited and may not support comprehensive agent workflows.

    Completeness2/5

    The tool set is severely incomplete for a weather server, lacking essential operations such as current conditions, historical data, or multi-day forecasts. Agents will face dead ends when trying to perform common weather-related tasks beyond the two provided tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A template repository for building Model Context Protocol (MCP) servers with TypeScript, featuring full TypeScript support, testing setup, CI/CD pipelines, and modular architecture for easy extension.
      5 npm
      Creative Commons Attribution Non Commercial Share Alike 4.0 International
    • A
      license
      Not graded
      quality
      B
      maintenance
      A starter template for building remote Model Context Protocol servers using TypeScript, providing modern tooling and best practices while leveraging the MCP TypeScript SDK.
      61
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A template project for quickly building Model Context Protocol (MCP) servers using TypeScript and the official SDK. It includes pre-configured examples for tools and resources to help developers jumpstart their custom MCP server development.
      71 npm
      -
    • A
      license
      B
      quality
      D
      maintenance
      A TypeScript MCP server boilerplate providing example tools and resources for rapid development of custom Model Context Protocol servers.
      8
      ISC