Mandi Price Advisor MCP Server
Sends price alerts to users via Telegram Bot API when threshold is crossed.
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., "@Mandi Price Advisor MCP Serverwhat is the modal price of onion in Pune market?"
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.
Mandi Price Advisor — MCP Server
An MCP server that gives farmers and traders daily mandi (wholesale market) commodity prices across India, lets them compare markets, and — critically — sets price alerts that message them on Telegram when a threshold is crossed.
This goes beyond fetch-only MCP wrappers: the scheduler acts on the user's behalf over time, making the system genuinely agentic.
Architecture
Claude / any MCP client
│ tools · resources · prompts
▼
MCP Server (Streamable HTTP)
├── Tools: get_mandi_price, compare_markets, get_price_trend,
│ set_price_alert, list_my_alerts, cancel_alert
├── Resources: mandi://commodity/{name}/state/{state}/latest
│ mandi://commodity/{name}/market/{market}/history
└── Prompts: daily_selling_advisory
│
├── SQLite (cache, alerts, price history)
├── api.data.gov.in (verified mandi dataset)
└── APScheduler → Telegram Bot APIKey design decision: Price facts are always fetched from data.gov.in or read from a validated SQLite cache — never generated or interpolated by an LLM. The LLM's only job is understanding the user's request and phrasing the response.
Related MCP server: Market Brief
Data Source (Verified)
Field | Value |
Dataset | Current Daily Price of Various Commodities from Various Markets (Mandi) |
Publisher | Ministry of Agriculture and Farmers Welfare |
Resource ID |
|
Endpoint |
|
Fields |
|
Update cadence | Once per day (not real-time) |
Get a free API key instantly at data.gov.in — no approval wait.
Quick Start
1. Install dependencies
cd mandi-advisor-mcp
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
pip install -r requirements.txt2. Configure environment
copy .env.example .env # Windows
# cp .env.example .env # macOS/LinuxEdit .env:
DATA_GOV_IN_API_KEY=your_key_from_datagovin
TELEGRAM_BOT_TOKEN=your_token_from_BotFather3. Set up Telegram
Message @BotFather on Telegram →
/newbotCopy the bot token into
.envMessage your bot
/start— the bot replies with yourchat_id(background polling starts automatically when the server runs)Use that
chat_idwhen callingset_price_alert
4. Run the MCP server
python -m mcp_server.serverServer starts on http://0.0.0.0:8000 with Streamable HTTP transport. The alert scheduler and Telegram /start bot polling run in the background.
5. Connect from Cursor / Claude Desktop
Add to your MCP client config:
{
"mcpServers": {
"mandi-advisor": {
"url": "http://localhost:8000/mcp"
}
}
}MCP Surface
Tools
Tool | Description |
| Latest min/max/modal price for a commodity, optionally by state/market |
| Compare modal prices across states to find the best market |
| Modal price trend over N days from cached history |
| Action tool — Telegram alert when threshold is crossed |
| List active alerts for a chat ID |
| Cancel an alert by ID |
Resources
mandi://commodity/{commodity}/state/{state}/latestmandi://commodity/{commodity}/market/{market}/history
Prompts
daily_selling_advisory(commodity, location?, state?, market?)— "Should I sell today?" briefing grounded in fetched data
Alert Behavior
User calls
set_price_alert(commodity="Onion", market="Pune", threshold_price=2000, direction="above", telegram_chat_id="123456")Alert stored in SQLite
Scheduler (every 6h) batch-fetches prices for all watched commodity/market pairs
On threshold cross → Telegram message sent, alert marked fired (one-shot)
Example notification:
🔔 Price Alert: Onion at Pune market is now ₹2,100/quintal (as of 2026-07-27), above your ₹2,000 alert.
Running Tests
pytest eval/ -vTests cover:
API response parsing and httpx-mocked fetch/caching
Alert threshold edge cases (
above/below, exact threshold, missing data)Cache hit/expiry behavior
End-to-end scheduler with mocked Telegram
MCP tool registration and prompt location resolution
Telegram
/startbot handler
Deployment
Deploy to Railway, Render, or similar always-on host (alerts require a persistent scheduler).
Docker:
docker build -t mandi-advisor-mcp .
docker run -p 8000:8000 --env-file .env mandi-advisor-mcpRailway / Render: use the included railway.toml or render.yaml with the Dockerfile.
python -m mcp_server.serverSet environment variables on the host. Recommended: ALERT_CHECK_INTERVAL_HOURS=6, CACHE_TTL_SECONDS=21600, TELEGRAM_POLLING_ENABLED=true.
Disclaimers
Prices are sourced from the Government of India's daily mandi price dataset and update once per day, not in real time. Always confirm final prices at the actual market before making a selling decision.
This tool does not execute trades or transactions — it only informs and alerts.
Project Structure
mandi-advisor-mcp/
├── mcp_server/ # MCP tools, resources, prompts, server entrypoint
├── data_layer/ # data.gov.in client, SQLite, alert logic
├── scheduler/ # APScheduler alert checker
├── notifications/ # Telegram Bot API wrapper
├── eval/ # Tests and API response fixtures
└── requirements.txtLicense
MIT
This server cannot be installed
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 Servers
- Flicense-qualityDmaintenanceProvides real-time crop price data from Indian government sources and agricultural web search capabilities. Enables AI chatbots to access comprehensive agricultural market information and news for farming-related queries.Last updated
- Alicense-qualityDmaintenanceTurn 40+ data sources into a daily Wall Street-style market briefing, delivered to your Telegram, automatically.Last updated1MIT

Alumnx MCP Serverofficial
Alicense-qualityDmaintenanceProvides agricultural intelligence tools for pest/disease lookup, government scheme discovery, and SME knowledge retrieval via semantic search.Last updatedMIT- AlicenseAqualityBmaintenanceProvides LLMs with real-time access to Indian agricultural commodity prices across 3,000+ markets via the government's Agmarknet database.Last updated5MIT
Related MCP Connectors
Track prices & price history on any online shop, with alerts and an API
Real-time crypto prices from Binance, Coinbase, Kraken, OKX, and Bybit
Keyless prediction-market data across 12 venues plus paper-trading of crypto spot, futures, and PM.
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/lalit3001/mandi-advisor-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server