Skip to main content
Glama
YunYouJun

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

ParametersJSON Schema
NameRequiredDescriptionDefault
stateYesTwo-letter state code (e.g. CA, NY)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Get weather alerts,' which implies a read-only operation, but does not disclose any behavioral traits such as rate limits, authentication needs, error handling, or what the alerts include (e.g., severity, types). This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get weather alerts for a state.' It is front-loaded with the core purpose, has zero waste, and is appropriately sized for the tool's simplicity. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what the tool returns (e.g., alert details, format), potential errors, or usage constraints. For a tool with no structured behavioral data, the description should provide more context to aid the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'state' parameter fully documented in the schema. The description does not add any meaning beyond what the schema provides, as it only mentions 'for a state' without detailing the parameter. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get weather alerts for a state.' It specifies the verb ('Get') and resource ('weather alerts'), and includes a scope ('for a state'). However, it does not explicitly differentiate from its sibling tool 'get-forecast,' which likely provides different weather data, so it misses full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention the sibling tool 'get-forecast' or any other tools, nor does it specify contexts, prerequisites, or exclusions for usage. This leaves the agent without clear direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-forecastWeather forecastC

Get weather forecast for a location

ParametersJSON Schema
NameRequiredDescriptionDefault
latitudeYesLatitude of the location
longitudeYesLongitude of the location

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Get[s] weather forecast' but doesn't elaborate on what the forecast includes (e.g., temperature, precipitation), time range, data source, rate limits, error handling, or authentication needs. This leaves significant gaps in understanding the tool's behavior beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence: 'Get weather forecast for a location.' It is front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a simple tool. Every part of the sentence contributes directly to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (weather forecasting with geographic parameters) and the absence of annotations and output schema, the description is incomplete. It doesn't explain what the forecast returns (e.g., data format, time periods), potential limitations, or how to interpret results. For a tool with no structured output information, more descriptive context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with both parameters (latitude and longitude) fully documented in the input schema. The description doesn't add any parameter-specific details beyond what the schema provides, such as format examples or usage tips. However, since the schema covers all parameters adequately, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get weather forecast for a location' specifies the verb ('Get') and resource ('weather forecast') with the target ('location'). It distinguishes from the sibling tool 'get-alerts' by focusing on forecasts rather than alerts, though the distinction isn't explicitly stated. The purpose is specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling tool 'get-alerts' or any other tools, nor does it specify prerequisites, constraints, or typical use cases. Without such context, the agent must infer usage based solely on the tool name and description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 2 tool updates
    • First observedget-alerts
    • First observedget-forecast

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 issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    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.
    56
    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.
    25 npm
    -
  • F
    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
    -