Weather MCP Server
# Weather MCP Server
A Model Context Protocol (MCP) server that provides weather information.
## Installation
```bash
pnpm install
```
## Usage
### Start the Server
```bash
pnpm start
```
### Run Tests
```bash
pnpm test
```
### Using with MCP Inspector
To test your server with the MCP Inspector:
1. **Install the Inspector** (if not already installed):
```bash
npx @modelcontextprotocol/inspector
```
2. **Configure the connection**:
- Command: `npx`
- Args: `tsx main.ts`
- Or use the full command: `npx tsx /path/to/mcpWeather/main.ts`
3. **Test the tool**:
- Select the `fetch-Weather` tool
- Enter a city name (e.g., "Bogotá")
- Call the tool
## Tools
### fetch-Weather
Get the weather for a given location.
**Parameters:**
- `city` (string, required): City name like 'Bogotá'
**Example:**
```json
{
"city": "Bogotá"
}
```
**Response:**
```json
{
"content": [
{
"type": "text",
"text": "The weather in Bogotá is sunny"
}
]
}
```
## Important Notes
⚠️ **Zod Version**: This project uses Zod v3.23.8 to match the MCP SDK requirements. Do not upgrade to Zod v4 as it will cause parameter registration issues.
## Development
The server uses:
- **MCP SDK**: `@modelcontextprotocol/sdk` v1.20.0
- **Zod**: v3.23.8 (for parameter validation)
- **TSX**: v4 (for running TypeScript)
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool has a distinct purpose of fetching weather data for a location.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'fetch-Weather' follows a verb-noun pattern, though the capitalization is inconsistent, but this does not affect the score due to the single-tool context.
A single tool for a weather server is too few for the apparent scope, as it lacks basic operations like forecasts, historical data, or location searches. This minimal set limits functionality and is not well-scoped for typical weather-related tasks.
The tool surface is severely incomplete for a weather domain, covering only current weather fetching. There are significant gaps, such as missing forecasts, alerts, or multi-location queries, which will likely cause agent failures in broader weather-related workflows.