This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a repository containing Model Context Protocol (MCP) servers written in TypeScript. The repository contains two MCP server implementations:
- weather-mcp - A weather information server that provides access to US weather data
- bfl-mcp - A Black Forest Labs integration server (currently empty/placeholder)
Both servers are built using the @modelcontextprotocol/sdk and provide tools through the MCP protocol.
- Location:
weather-mcp/ - Purpose: Provides weather alerts and forecasts for US locations
- API Integration: Uses the National Weather Service (NWS) API
- Tools:
get_alerts: Get weather alerts for a US stateget_forecast: Get weather forecast for coordinates
- Location:
bfl-mcp/ - Purpose: Placeholder for Black Forest Labs integration
- Status: Empty implementation ready for development
# Build weather-mcp
cd weather-mcp && npm run build
# Build bfl-mcp
cd bfl-mcp && npm run build# Install dependencies for weather-mcp
cd weather-mcp && npm install
# Install dependencies for bfl-mcp
cd bfl-mcp && npm installweather-mcp/
├── src/
│ ├── index.ts # Main server entry point
│ ├── vars.ts # Constants (API base URLs, user agent)
│ ├── helpers.ts # Utility functions and types
│ └── tools/
│ ├── get_alerts.ts # Weather alerts tool implementation
│ └── get_forecast.ts # Weather forecast tool implementation
├── build/ # Compiled JavaScript output
├── package.json
└── tsconfig.json
- Uses
McpServerfrom@modelcontextprotocol/sdk/server/mcp.js - Communicates via
StdioServerTransport - Tools are registered using
server.tool()method
- Target: ES2022
- Module: Node16
- Output directory:
./build - Strict mode enabled
- All API requests wrapped in try-catch blocks
- Graceful error responses returned to MCP clients
- Console error logging for debugging
- The weather-mcp server integrates with the US National Weather Service API
- Only supports US locations (latitude/longitude coordinates)
- Requires proper User-Agent header for API requests
- API rate limiting and error handling implemented
- Tools are implemented as separate modules in
src/tools/ - Each tool exports a
ToolCallbackfunction - Zod schemas used for parameter validation
- Consistent response format with content arrays
- TypeScript compilation to
build/directory - Executable permissions set on build output
- ES modules configuration (
"type": "module")
To test the MCP servers after building:
# Run weather server
./weather-mcp/build/index.js
# Test with MCP client (Claude Desktop, etc.)
# Add server configuration pointing to build/index.js