Starter MCP Server
This server provides weather information powered by the National Weather Service (NWS) API, functioning as both an MCP server and a CLI tool.
Get Weather Alerts (
get-alerts): Retrieve active weather alerts for a US state using a two-letter state code (e.g.,CA,NY)Get Weather Forecast (
get-forecast): Retrieve a weather forecast for a specific location using latitude (β90 to 90) and longitude (β180 to 180) coordinatesDual operation modes: Run as a standalone CLI tool or integrate with MCP clients like Claude Desktop
Extensible architecture: Easily add new tools by following the existing project structure
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Starter MCP Servershow me how to configure the server in mcp.json"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 demoCLI 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 --helpFor 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.mjsProject 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 pointAdding New Tools
See CLI_USAGE.md for detailed instructions.
Quick overview:
Add business logic in
src/lib/Register MCP tool in
src/tools/Add CLI command in
src/cli.ts(optional)Update
src/index.tsto 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 releaseReferences
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
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