Weather MCP Server
Handles environment configuration for the MCP server, managing settings like API URLs and model selection.
Provides source control integration for cloning and managing the MCP server codebase.
Hosts the MCP server repository for distribution and collaboration.
Uses Node.js as the runtime environment for the MCP server, with v18+ required for operation.
Manages dependencies and provides scripts for running, testing, and diagnosing the MCP server.
Leverages Ollama's LLM capabilities to provide weather information through a 'get-weather' tool that retrieves weather data for any city.
Implements the MCP server using TypeScript for type-safe code organization and 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., "@Weather MCP Serverwhat's the forecast for Tokyo tomorrow?"
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.
🌦️ Weather MCP Server Demo
A Model Context Protocol (MCP) compatible server that provides weather information using Ollama's LLM capabilities. This server exposes a get-weather tool that can be used by MCP clients to retrieve weather information for any city.
🛠 Prerequisites
Node.js v18+
Ollama installed and running locally
Ollama model:
llama3(or configure your preferred model)
Related MCP server: Weather MCP
🚀 Complete Setup & Installation
✅ Step 1: Clone and Install
git clone https://github.com/codewith1984/weather-mcp-server-typescript.git
cd weather-mcp-server
npm install⚙️ Step 2: Setup Environment
# Copy environment template
cp .env.example .envEdit the .env file to contain:
OLLAMA_API_URL=http://localhost:11434/api/generate
OLLAMA_MODEL=llama3🤖 Step 3: Install and Setup Ollama
# Install Ollama (if not already installed)
# Visit https://ollama.com/ for installation instructions
# Start Ollama service
ollama serve
# In another terminal, pull the model
ollama pull llama3
# Verify Ollama is working
curl http://localhost:11434/api/versionStep 4: Test Ollama Connection
# Test if Ollama can generate responses
curl http://localhost:11434/api/generate -d '{
"model": "llama3",
"prompt": "Hello world",
"stream": false
}'Step 5: Run Diagnostics
# Run diagnostic to check if everything is working
npm run diagnose🎯 Running the MCP Server
Start the Server
npm startExpected output:
🚀 MCP Weather Server starting... 📡 Ollama URL: http://localhost:11434/api/generate 🤖 Model: llama3 ✅ MCP Server connected and ready!
🔍 Testing with MCP Inspector
Method 1: CLI Inspector
# Install MCP Inspector globally
npm install -g @modelcontextprotocol/inspector
# Run inspector
mcp-inspector
# Follow the web interface instructions⚙️ Configuration
Environment Variables (.env file)
OLLAMA_API_URL=http://localhost:11434/api/generate
OLLAMA_MODEL=llama3Performance Tuning
The server is optimized for quick responses:
15-second timeout for HTTP requests Aggressive Ollama parameters for faster generation Fallback from HTTP API to CLI if needed
##🔧 Troubleshooting
Quick Diagnosis
# Run the diagnostic script
npm run diagnoseCommon Issues & Solutions
Issue: "Request timed out" errors
# Check if Ollama is running
ps aux | grep ollama
# Start Ollama if not running
ollama serve
# Check if model is available
ollama list | grep llama3
# If model not found, pull it
ollama pull llama3Issue: "Request timed out" errors
# Check if Ollama is running
ps aux | grep ollama
# Start Ollama if not running
ollama serve
# Check if model is available
ollama list | grep llama3
# If model not found, pull it
ollama pull llama3Issue: "Model not found" errors
# List available models
ollama list
# Pull the required model
ollama pull llama3
# Or try a smaller model for faster responses
ollama pull llama3:8bIssue: Connection errors
# Verify Ollama is accessible
curl http://localhost:11434/api/version
# Check if port 11434 is open
netstat -an | grep 11434
# Restart Ollama service
pkill ollama
ollama serveIssue: MCP Inspector connection fails
# Make sure your server is running
npm start
# Check the working directory path is correct
pwd
# Verify tsx is available
npm list tsxPerformance Tips
# Use a smaller model for faster responses
ollama pull llama3:8b
# Update .env to use the smaller model
echo "OLLAMA_MODEL=llama3:8b" >> .env
# Monitor system resources
top -p $(pgrep ollama)📁 Project Structure
weather-mcp-server/
├── .env # Environment configuration
├── .env.example # Environment template
├── .gitignore # Git ignore rules
├── main.ts # MCP server implementation
├── ollamaClient.ts # Ollama API client
├── diagnose.ts # Diagnostic tool
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file✅ Success Checklist
Complete this checklist to ensure everything is working:
Node.js v18+ installed Ollama installed and running (ollama serve) Model downloaded (ollama pull llama3) Project dependencies installed (npm install) Environment configured (.env file exists) Diagnostic passes (npm run diagnose) MCP server starts successfully (npm start) MCP Inspector connects successfully Weather tool responds to test quer
🚀 Quick Start Commands
# Complete setup in one go
git clone https://github.com/your-username/weather-mcp-server.git
cd weather-mcp-server
npm install
cp .env.example .env
ollama serve &
ollama pull llama3
npm run diagnose
npm start🤝 Contributing
Fork the repository
Create a feature branch: git checkout -b feature-name
Make your changes
Test with MCP Inspector
Submit a pull request
Available Tools
1 toolget-weatherC
Tool to get the weather for a given city
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | The city to get the weather for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic function without mentioning any behavioral traits like rate limits, error handling, authentication requirements, data freshness, or response format. For a tool with zero annotation coverage, this leaves critical gaps in understanding how it behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at just one sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential information. Every word earns its place in this minimal but complete statement of function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (simple read operation) but complete lack of annotations and no output schema, the description is insufficient. It doesn't explain what weather data is returned, in what format, or any behavioral constraints. The description should provide more context about the operation's scope and results to compensate for the missing structured information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the single parameter 'city' fully documented in the schema. The description adds no additional parameter semantics beyond what the schema already provides. According to the rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('get') and resource ('weather'), and specifies the target ('for a given city'). It's not tautological and communicates the core function effectively. However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, preventing a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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, prerequisites, or contextual constraints. It simply states what the tool does without any usage context. This is a significant gap in helping an agent make informed decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as getting weather for a city, making it distinct by default.
A single tool inherently has perfect naming consistency, as there are no other tools to compare against. The name 'get-weather' follows a clear verb-noun pattern, which is appropriate for its function.
One tool is too few for a weather server's apparent scope, which typically involves multiple operations like forecasts, alerts, or historical data. This minimal set feels incomplete and may limit agent functionality.
The tool surface is severely incomplete for a weather domain. It only provides current weather for a city, lacking essential operations such as forecasts, alerts, historical data, or multi-location queries, which will likely cause agent failures.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.859Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.1
- AlicenseBqualityDmaintenanceA simple Model Context Protocol server that provides real-time weather data to AI agents like GitHub Copilot, allowing users to get current weather information for any city through natural language queries.23297MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides weather information using the Open-Meteo API, allowing users to get current weather for specific cities and retrieve weather data for date ranges.Apache 2.0
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/codewith1984/weather-mcp-server-typescript'
If you have feedback or need assistance with the MCP directory API, please join our Discord server