Loki MCP
Loki MCP is a read-only MCP server for querying 1mg's diagnostics (phlebo/sample-collection) logistics platform, covering hubs, orders, batches, riders, and day-tracking data.
Reference Data
Fetch valid enumeration values for order statuses, task statuses, rider statuses/types, order categories, etc.
Hub Management
Search PAC (Phlebo Activity Center) hubs by name/code, with filters for type, status, and business client.
Retrieve full details for a specific hub by ID.
Order Management
Search diagnostics orders by hub, date (DD/MM/YYYY), status, category, slot, rider, pincode, and more.
Get aggregate order counts broken down by status for a hub and day.
Retrieve full details of a single order (tests, slot, status) by internal numeric ID.
View chronological status-change history of an order.
Batch Management
Search diagnostics batches/consignments for a given day (YYYY-MM-DD).
View aggregate batch and assignment metrics for a day.
Retrieve full batch details including constituent orders and assignments.
Rider & Phlebo Management
Search phlebos/riders by name, phone, code, status, or type.
Retrieve full profile of a single rider by numeric ID.
List all phlebos attached to one or more PAC hubs, optionally filtered by rider type.
Day Tracking & KPIs
Get daily KPI snapshots (assigned/completed/cancelled counts, distance, SLA breaches) for a phlebo on a given date.
View chronological task timelines (shift start, login, task sequence, SLA status).
View planned route waypoints and actual GPS paths (with speed, battery %, and coolbox temperature).
Access the "Track Phlebos" board — all phlebos at a hub on a date with live status, availability, battery, location, task counts, and coolbox temperature.
Attendance
Get attendance roll-up (total present/absent) for one or more hubs on a specific date.
Retrieve day-by-day attendance status and hours worked for a rider across an entire month.
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., "@Loki MCPsearch for delayed orders in hub Mumbai-Central"
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.
Loki MCP — Diagnostics (Droplet)
Read-only MCP server over Loki / Thor, scoped to 1mg's diagnostics (phlebo
sample-collection) logistics — not the pharmacy delivery surface. Every
order/batch tool targets the diagno endpoints. Diagnostics hubs are PACs
(Phlebo Activity Centers, business_client="droplet", type="PAC") and riders
are phlebos.
It talks to the same gateway the Thor admin UI uses (https://thor.1mg.com/1mg_api),
so no VPN or host setup is needed beyond a valid login token.
Tools
Tool | Surface | What it does |
| enums | Valid |
| hubs | Find a PAC hub id from name/code (defaults to |
| hubs | Full hub detail by id |
| orders | Diagnostics orders for a PAC on a day — hub_id + day_query required |
| orders | Order counts by status (all/placed/completed/…) for a PAC+day |
| orders | Full order detail by numeric id (tests, slot, status) |
| orders | Date-keyed status history of an order |
| batches | Diagnostics batches (consignments) for a day |
| batches | Aggregate batch/assignment metrics for a day |
| batches | Full batch detail (orders + assigned_in_batch) |
| riders | Search riders/phlebos (shared infra) |
| riders | Full rider detail by numeric id |
| riders | Phlebos attached to a PAC (optionally by type) |
| day tracking | Daily KPI summary (assigned/completed/distance/breach) |
| day tracking | Chronological day timeline (shift, login, task sequence) |
| day tracking | Planned route waypoints + locations |
| day tracking | Actual GPS pings (speed, battery, coolbox temp) |
| day tracking | "Track Phlebos" board for a PAC+date |
| attendance | total_present / total_absent for hub(s) on a date |
| attendance | Day-by-day attendance + hours for a rider/month |
All tools are read-only (readOnlyHint: true).
Date-format gotchas (they differ by surface)
Orders (
loki_search_orders,loki_count_orders_by_status):day_queryisDD/MM/YYYY.Batches (
loki_search_batches,loki_get_batch_metrics):dateisYYYY-MM-DD.Phlebo day-tracking/attendance:
dateisYYYY-MM-DD;phlebo_id/rider_idis the numeric rider id.Order detail/timeline: take the order's numeric
id(from search rows), not theNNN-NNNdisplayorder_id.
Related MCP server: DB2ST MCP
Auth
Thor authenticates with the authTokenThor JWT cookie. It is short-lived, so the
server reads it fresh on every call — refreshing never needs a restart.
Open https://thor.1mg.com while logged in.
DevTools → Application → Cookies → copy the
authTokenThorvalue.Paste it into the token file:
echo 'PASTE_TOKEN_HERE' > ~/.loki_token
When calls start returning 401/403, just overwrite ~/.loki_token with a fresh value.
Env var | Default | Purpose |
|
| Path to token file |
| — | Token fallback if no file |
|
| Gateway base |
Setup
cd loki-mcp
uv sync
echo 'PASTE_TOKEN_HERE' > ~/.loki_token
uv run python server.py # smoke test (Ctrl-C to stop)Register in Claude Code
claude mcp add loki -- /Users/abhishekjain/1mg-claude-code/toy-ptojects/loki-mcp/.venv/bin/python \
/Users/abhishekjain/1mg-claude-code/toy-ptojects/loki-mcp/server.pyNotes
hub_idis mandatory for order/batch/phlebo lookups. Resolve PAC names → ids withloki_search_hubs.See the date-format gotchas above — orders use
DD/MM/YYYY, batches/phlebo useYYYY-MM-DD.Intentionally read-only; no write/action tools (assign, auto_assign, etc.) are exposed.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/abhijain864/loki-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server