mcpField
🌀
🌀️ FastMCP Weather Server

🌀️ FastMCP Weather Server

Local
github.com/abhilashsahooMedia & Design0Updated 73w ago

About 🌀️ FastMCP Weather Server

FastMCP Weather Server is a TypeScript MCP server that returns current weather for cities worldwide using OpenWeatherMap. It includes request progress reporting, structured logging, and CLI and visual tools for development and debugging.

Key features

  1. 01Retrieve current weather by city
  2. 02Return temperature, conditions, humidity, and wind
  3. 03Report request progress
  4. 04Provide structured logs
  5. 05Include CLI and visual debugging tools

Use cases

  1. 01Check current conditions in a city
  2. 02Retrieve weather details for an MCP client
  3. 03Test and debug weather requests
  4. 04Develop or build the TypeScript server

MCP support

Exposes a `get_weather` tool through MCP, accepting a city and returning current weather details. It can be configured for Claude Desktop, VS Code, and Cursor.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

🌀️ FastMCP Weather Server

A production-ready weather MCP server built with FastMCP and TypeScript that integrates seamlessly with Claude Desktop, VS Code, and Cursor.

✨ Features

  • 🌍 Real-time Weather Data - Get current weather for any city worldwide
  • πŸ”’ Type-Safe - Built with TypeScript and Zod validation
  • πŸ“Š Progress Reporting - Built-in progress tracking for weather requests
  • πŸ“ Structured Logging - Comprehensive logging with context
  • πŸ› οΈ Easy Testing - Built-in CLI tools for development and debugging
  • πŸ”Œ Universal Integration - Works with Claude Desktop, VS Code, and Cursor
  • ⚑ Fast Development - 5x faster than traditional MCP SDK

πŸš€ Quick Start

Prerequisites
  • Node.js 20.18.1 or higher (critical requirement)
  • OpenWeatherMap API key (free tier: 1,000 calls/day)
Installation
git clone https://github.com/abhilashsahoo/fastmcp-weather-server.git
cd fastmcp-weather-server
npm install
Setup
  1. Get your OpenWeatherMap API key:

  2. Create environment file:

    cp .env.example .env
    
  3. Add your API key to .env:

    OPENWEATHER_API_KEY=your_api_key_here
    
Development

Test your server:

npm run dev

Try the interactive CLI:

get_weather {"city": "London"}

Debug with visual interface:

npm run inspect

Build for production:

npm run build

πŸ”§ MCP Client Integration

Claude Desktop
  1. Find your config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add this configuration:

    {
      "mcpServers": {
        "weather": {
          "command": "npx",
          "args": ["tsx", "/absolute/path/to/fastmcp-weather-server/src/server.ts"],
          "env": {
            "OPENWEATHER_API_KEY": "your_actual_api_key_here"
          }
        }
      }
    }
    
  3. Restart Claude Desktop and test:

    What's the weather like in Tokyo?
    
VS Code
  1. Install the MCP extension
  2. Create .vscode/settings.json:
    {
      "mcp.servers": {
        "weather": {
          "command": "npx",
          "args": ["tsx", "./src/server.ts"],
          "cwd": "${workspaceFolder}",
          "env": {
            "OPENWEATHER_API_KEY": "your_actual_api_key_here"
          }
        }
      }
    }
    
Cursor IDE
  1. Create .cursor/mcp.json:
    {
      "servers": {
        "weather": {
          "command": "npx",
          "args": ["tsx", "./src/server.ts"],
          "env": {
            "OPENWEATHER_API_KEY": "your_actual_api_key_here"
          }
        }
      }
    }
    

πŸ“‹ Available Scripts

ScriptDescription
npm run devStart FastMCP development server with CLI
npm run inspectOpen visual debugging interface
npm run test-directTest server directly without CLI
npm run buildCompile TypeScript to JavaScript
npm startRun compiled server

πŸ› οΈ API Reference

Tools
get_weather

Get current weather information for any city worldwide.

Parameters:

  • city (string, required): City name (e.g., "London", "New York")

Returns:

  • Formatted weather data with temperature, conditions, humidity, and wind speed

Example:

{
  "city": "London"
}

Response:

🌀️ Weather in London:
🌑️ Temperature: 15°C (feels like 13°C)
☁️ Conditions: partly cloudy
πŸ’§ Humidity: 65%
πŸ’¨ Wind Speed: 3.2 m/s

πŸ› Troubleshooting

Common Issues
IssueSolution
Node.js version errorUpdate to Node.js 20.18.1+: winget upgrade OpenJS.NodeJS
Server not foundCheck absolute path in MCP client configuration
API key errorsVerify API key in .env and MCP client env section
Module resolution errorsDelete node_modules and run npm install
FastMCP CLI issuesTry npm run test-direct to test without CLI
Windows-Specific

Update Node.js via PowerShell:

# Using Chocolatey
choco upgrade nodejs

# Using Winget
winget upgrade OpenJS.NodeJS

# Using nvm-windows
nvm install 20.18.1 && nvm use 20.18.1
Testing Steps
  1. Test server directly: npm run test-direct
  2. Test with FastMCP CLI: npm run dev
  3. Test with visual interface: npm run inspect
  4. Test with Claude Desktop: Restart Claude and ask about weather

πŸ“Š Project Structure

fastmcp-weather-server/
β”œβ”€β”€ src/
β”‚   └── server.ts          # Main FastMCP server
β”œβ”€β”€ dist/                  # Compiled JavaScript (generated)
β”œβ”€β”€ .env                   # Environment variables (create from .env.example)
β”œβ”€β”€ .env.example           # Environment template
β”œβ”€β”€ .gitignore            # Git ignore rules
β”œβ”€β”€ package.json          # Dependencies and scripts
β”œβ”€β”€ tsconfig.json         # TypeScript configuration
└── README.md             # This file

🌟 Features in Detail

FastMCP Advantages
  • Zero Configuration: Server setup with single constructor
  • Built-in Testing: CLI and web interface included
  • Progress Reporting: Real-time progress updates
  • Structured Logging: Contextual logging with data objects
  • Type Safety: Zod schema validation
  • Error Handling: User-friendly error messages
Weather Data
  • Real-time Updates: Current conditions from OpenWeatherMap
  • Global Coverage: Weather for any city worldwide
  • Comprehensive Data: Temperature, humidity, wind, conditions
  • Rate Limiting: 1,000 free requests per day

πŸš€ Deployment

Development
npm run dev  # Test with FastMCP CLI
Production
npm run build  # Compile TypeScript
npm start      # Run compiled server
Environment Variables
VariableDescriptionRequired
OPENWEATHER_API_KEYOpenWeatherMap API keyYes
NODE_ENVEnvironment (development/production)No

πŸ“ˆ Performance

  • Requests: 1,000 weather calls/day (free tier)
  • Response Time: < 500ms average
  • Memory Usage: < 50MB
  • Client Support: Claude Desktop, VS Code, Cursor

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ”— Related Projects


Built with ❀️ using FastMCP and TypeScript

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.