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., "@Maharashtra Medicine MCP ServerWhich medicines are expiring within the next 30 days?"
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.
Maharashtra Medicine MCP Server — Cloudflare Workers
FastMCP server for Maharashtra wholesale medicine purchase analysis, deployed as a Python Worker on Cloudflare's global edge network.
Project Structure
medicine-mcp-server/
├── src/
│ └── worker.py ← FastMCP server (all 10 tools)
├── data/
│ └── maharashtra_wholesale_medicine_purchase.csv ← upload to R2, not deployed
├── .github/
│ └── workflows/
│ └── deploy.yml ← GitHub Actions auto-deploy
├── wrangler.toml ← Cloudflare Workers config
├── pyproject.toml ← Python deps + pywrangler config
└── README.mdArchitecture
MCP Client (Claude Desktop / mcp-remote)
│ HTTPS (Streamable HTTP transport)
▼
Cloudflare Workers Edge
┌─────────────────────────────┐
│ on_fetch() │
│ │ │
│ ▼ │
│ MedicineServer │
│ (Durable Object) │
│ │ │
│ ├─ FastMCP tools ──────►│ env.GEMINI_API_KEY (Secret)
│ │ │
│ └─ _get_df() ──────────►│ env.MEDICINE_DATA (R2 bucket)
└─────────────────────────────┘CSV data lives in Cloudflare R2 — fetched once per Worker isolate, then cached in memory for the lifetime of the isolate.
Gemini API key is stored as a Cloudflare Secret — never in source code.
Transport is Streamable HTTP at
/mcp— the current MCP spec standard.
One-Time Setup
Prerequisites
# Node.js 18+ (for wrangler CLI)
node --version
# Python 3.11+ and uv
pip install uv
uv tool install pywrangler
# Wrangler CLI
npm install -g wrangler
# Authenticate wrangler with your Cloudflare account
npx wrangler loginStep 1 — Clone & configure
git clone https://github.com/YOUR_ORG/medicine-mcp-server.git
cd medicine-mcp-serverOpen wrangler.toml and uncomment + fill in your account_id:
account_id = "abc123..." # from dash.cloudflare.com → OverviewStep 2 — Create the R2 bucket
npx wrangler r2 bucket create medicine-mcp-dataStep 3 — Upload the CSV to R2
npx wrangler r2 object put medicine-mcp-data/maharashtra_wholesale_medicine_purchase.csv \
--file ./data/maharashtra_wholesale_medicine_purchase.csvVerify the upload:
npx wrangler r2 object get medicine-mcp-data/maharashtra_wholesale_medicine_purchase.csv \
--file /tmp/verify.csv && wc -l /tmp/verify.csvStep 4 — Store your Gemini API key as a secret
npx wrangler secret put GEMINI_API_KEY
# Paste your key when prompted (get one free at https://aistudio.google.com/app/apikey)Step 5 — Deploy
uv run pywrangler deployYour server is now live at:
https://medicine-mcp-server.<your-account>.workers.dev/mcpGitHub Actions Auto-Deploy
Every push to main triggers an automatic deploy via .github/workflows/deploy.yml.
Add these two secrets in your GitHub repo (Settings → Secrets and variables → Actions):
Secret | Where to find it |
| dash.cloudflare.com → My Profile → API Tokens → Create Token → "Edit Cloudflare Workers" template |
| dash.cloudflare.com → Overview → API section |
After adding secrets, any git push origin main will auto-deploy.
Local Development
# Start local dev server (uses local R2 simulation — no real R2 calls)
uv run pywrangler dev
# Server available at http://localhost:8787/mcp
# Test with MCP Inspector: npx @modelcontextprotocol/inspector http://localhost:8787/mcpConnecting Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"medicine": {
"command": "npx",
"args": [
"mcp-remote",
"https://medicine-mcp-server.<your-account>.workers.dev/mcp"
]
}
}
}Available Tools
# | Tool | Purpose |
1 |
| Search by product / manufacturer / supplier / buyer |
2 |
| Full line-items for one or more invoices |
3 |
| Filter by drug schedule (H, H1, X, G, OTC) |
4 |
| Medicines expiring within N days |
5 |
| Spend & invoice summary for a supplier |
6 |
| Purchase history & schedule mix for a buyer |
7 |
| Ranked products by taxable amount / quantity |
8 |
| CGST / SGST / IGST breakdown by invoice/supplier/buyer |
9 |
| Cold-chain & Schedule X items |
10 |
| Free-form NL question answered by Gemini |
Updating the CSV
To replace the CSV with a newer file:
npx wrangler r2 object put medicine-mcp-data/maharashtra_wholesale_medicine_purchase.csv \
--file ./data/your_new_file.csv
# The Worker's in-memory cache resets automatically on the next isolate cold-start.
# Force an immediate reset by redeploying:
uv run pywrangler deployUseful Commands
# Stream live logs from production
uv run pywrangler tail
# List R2 objects
npx wrangler r2 object list medicine-mcp-data
# List secrets
npx wrangler secret list
# Delete a secret
npx wrangler secret delete GEMINI_API_KEYThis server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.