Skip to main content
Glama
KNithin1976
by KNithin1976

agri-mcp

An MCP (Model Context Protocol) server that gives Claude access to live agricultural weather data via the OpenWeather API. Designed to run as a local tool server for Claude Desktop.

Features

  • get_weather — Get current weather conditions (temperature, description, humidity) for any city

  • get_forecast — Get a multi-day weather forecast for any city

Related MCP server: OpenWeatherMap MCP Server

Requirements

Setup

1. Clone / create the project folder

mkdir agri-mcp
cd agri-mcp

2. (Optional) Create a virtual environment

python -m venv venv
venv\Scripts\activate

3. Install dependencies

pip install mcp httpx python-dotenv

4. Add your OpenWeather API key

Create a .env file in the project root (only needed for local/standalone testing — Claude Desktop passes env vars directly from its config):

OPENWEATHER_API_KEY=your_api_key_here

5. Test the server standalone

python main.py

The server communicates over stdio, so it won't print anything visible — if it doesn't immediately crash, it's working. Press Ctrl+C to stop it.

Connecting to Claude Desktop

Edit your Claude Desktop config file:

notepad "%APPDATA%\Claude\claude_desktop_config.json"

Add the following (adjust the path to match where main.py actually lives on your machine):

{
  "mcpServers": {
    "agri-data": {
      "command": "python",
      "args": [
        "C:\\Users\\YOUR_USERNAME\\PycharmProjects\\PythonProject\\agri-mcp\\main.py"
      ],
      "env": {
        "OPENWEATHER_API_KEY": "your_api_key_here"
      }
    }
  }
}

Then fully quit Claude Desktop (not just close the window — end the process from Task Manager or system tray) and reopen it. Check Settings → Developer (or the MCP servers panel) to confirm agri-data shows as connected.

Project Structure

agri-mcp/
├── main.py          # MCP server entry point and tool definitions
├── .env             # Local environment variables (not committed)
└── README.md

Troubleshooting

Issue

Fix

Server disconnected in Claude Desktop

Check the config JSON structure — command, args, and env must be nested inside mcpServers.agri-data, not at the top level

python not recognized

Disable the Python App Execution Alias in Windows Settings, or use the full path to python.exe

Old config still showing after edit

Fully quit Claude Desktop (Task Manager → End Task) and reopen — closing the window alone doesn't reload the config

OPENWEATHER_API_KEY is not set error

Confirm the key is present in both the config's env block and/or your local .env file

Security Note

Do not commit your .env file or claude_desktop_config.json with a real API key to version control. If a key is ever accidentally exposed (e.g. shared in a screenshot or chat), regenerate it from your OpenWeather account dashboard.

License

MIT

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time weather data and 5-day forecasts using OpenWeatherMap API. Supports querying by city name, country code, or geographic coordinates with detailed climate information including temperature, humidity, wind, and UV index.
    21
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides weather data integration using the OpenWeatherMap API, enabling users to fetch current weather conditions, hourly and daily forecasts, weather alerts, and geocoding services for any location worldwide.
    59
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/KNithin1976/mcp-farmers'

If you have feedback or need assistance with the MCP directory API, please join our Discord server