Python Weather MCP Server
Enables reading, creating, and modifying Google Sheets documents through Google Drive integration
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., "@Python Weather MCP Serverwhat's the weather in Tokyo right now?"
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.
Python Simple MCP Tutorial
This project demonstrates a simple weather server using the mcp library. It exposes a tool that returns real weather data for a given location using the OpenWeatherMap API.
MCP (Model Context Protocol) is a universal standard that enables AI agents (LLMs) to access data, tools and services. In this case, we will build a "server" that fetches real weather data for an LLM to interact with.
Setting Up
This project uses uv for package management. Go here for instructions on how to install uv.
uv venvActivate the virtual environment:
source .venv/bin/activateInstall dependencies.
uv syncRelated MCP server: weather mcp
API Key Setup
This project uses the OpenWeatherMap API to fetch real weather data. You'll need to:
Sign up for a free account at OpenWeatherMap
Get your API key from the dashboard
Set the environment variable:
export OPENWEATHER_API_KEY=your_api_key_hereHow To Run
To test the weather MCP server, execute the following command:
mcp dev src/mcp_weather.pyThen wait a while for to load, and click the link to "open inspector with token pre-filled". This will give you a UI you can use to test the MCP server right in your browser.
Deep Dive
How does our AI agent know how to use this MCP tool? Well, in short, it gets serialized into a JSON schema.
FastMCP automatically registers the get_weather function as a tool, extracting the schema from the function signature and docstring.
{
"name": "get_weather",
"description": "Get current weather for a location",
"inputSchema": {
"type": "object",
"properties": {
"location": { "type": "string" }
},
"required": ["location"]
}
}Then, the AI agent that we use (e.g. Claude Desktop, Cursor, or our own implementation) will know about these tools and know how to invoke them via prompt engineering. It will be turned into a prompt similar to this:
You have access to these tools:
- get_weather: Get current weather for a location
To use: <tool_call>{"name": "get_weather", "parameters": {"location": "Tokyo"}}</tool_call>MCP Clients: Interacting with MCP Servers
If you want your AI agent to interact with MCP servers, you need an MCP client. Some UI tools (Claude Desktop and Cursor) have this built-in for you already. But you can do this programmatically via code as well.
What it usually boils down to is declaring your MCP server in a config file with instructions on how to access it. In the case of Claude Desktop, it looks something like this:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": ["run", "[...]", "/[PATH_TO_PROJECT]/src/mcp_weather.py"],
"env": {
"OPENWEATHER_API_KEY": "your_api_key_here"
}
}
}
}(This example is simplified — refer to https://modelcontextprotocol.io/quickstart/user for more details)
And this will live inside the claude_desktop_config.json file which you can access via the Developer settings. But you can also take a shortcut and install it right away by running this command (which will just create the entry in the config file for you):
mcp install server.pyYou will need to restart Claude desktop to see the tool in your "search and tools" section.
For options on implementing MCP clients in code:
Using Third-Party MCP Servers (Google Sheets Example)
If your goal is to build powerful and useful AI agents, then you're probably more interested in using existing MCP servers rather than creating your own. There's a huge list of available servers here from both first-party and third-party developers: https://github.com/modelcontextprotocol/servers
It's also really easy to use in Claude Desktop. For this example, let's try integrating Google Sheets access (not just to read, but to create and modify).
Follow the instructions on https://github.com/xing5/mcp-google-sheets.
Set up Google access:
Create a Google Cloud account and project.
Create a service role and save the JSON to disk somewhere.
Create a folder in Google drive, and share its permission to the service account email.
Enable Drive and Sheets API in the GCP project.
Then set up the MCP server in Claude desktop (replace the environment variables):
{
"google-sheets": {
"command": "uvx",
"args": ["mcp-google-sheets@latest"],
"env": {
"SERVICE_ACCOUNT_PATH": "[...]/keys/service-account-xxx.json",
"DRIVE_FOLDER_ID": "XXX"
}
}
}This will now make Google Sheets available as a tool. The uvx command also lets you run it without having to clone the Github project or install any dependencies/environments.
Setting Up uv and uvx commands
On MacOS/Linux, Claude desktop might complain that it can't find uv or uvx when you try to start the server. You might just have to create a symlink to the binary.
sudo ln -s ~/.local/bin/uv /usr/local/bin/uv
sudo ln -s ~/.local/bin/uvx /usr/local/bin/uvxAvailable Tools
1 toolget_weatherC
Get current weather for a location
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Get current weather' which implies a read operation, but doesn't specify data sources, accuracy, rate limits, error handling, or response format. This leaves significant gaps in understanding how the tool 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 with a single, clear sentence that front-loads the essential information. There's no wasted verbiage, making it efficient and easy to parse.
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 lack of annotations, low schema coverage, and no output schema, the description is incomplete. It doesn't provide enough context about behavior, parameters, or results for a tool that fetches dynamic data like weather, leaving the agent with insufficient 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?
Schema description coverage is 0%, and the description doesn't add any parameter details beyond what's implied by 'location'. It doesn't explain the 'city' parameter's format, constraints, or examples, failing to compensate for the low schema coverage.
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 ('current weather for a location'), making it easy to understand what it does. However, since there are no sibling tools, it doesn't need to differentiate from alternatives, so it doesn't reach the highest score of 5.
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 it does without any usage instructions or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- First observed
get_weather
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'get_weather' has a clearly defined and distinct purpose that cannot be confused with any other tool in this set.
The naming follows a consistent verb_noun pattern with 'get_weather'. While there is only one tool, it adheres perfectly to a predictable naming convention without any deviation or mixing of styles.
A single tool for a weather server feels too thin and under-scoped for the apparent domain. Weather services typically offer more functionality such as forecasts, historical data, or location-based searches, making this count insufficient for comprehensive coverage.
The tool surface is severely incomplete for a weather domain. While 'get_weather' provides current conditions, there are significant gaps such as missing forecast retrieval, historical weather data, or location search capabilities, which will likely cause agent failures in broader weather-related tasks.
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
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
1An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
- UnifAPIOAuthcom.unifapi
Hosted MCP server for live public-data APIs and Skills for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides weather and web search tools, orchestrated by a LangGraph agent with OpenAI for natural language interaction.8-
- FlicenseNot gradedqualityDmaintenanceA lightweight Model Context Protocol (MCP) server that gives AI assistants the ability to fetch real-time weather data for any city using the OpenWeatherMap API.1-
- FlicenseNot gradedqualityCmaintenanceA minimal MCP server that provides weather data using Open-Meteo API, designed as a teaching tool for improving AI agent tool interfaces.-
- FlicenseNot gradedqualityCmaintenanceAn MCP server that provides current weather conditions and forecasts via OpenWeatherMap API to AI agents.-
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/EmanManco/mcpPythonWeather'
If you have feedback or need assistance with the MCP directory API, please join our Discord server