metrc-mcp
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., "@metrc-mcpWhich of our active packages are still awaiting lab results?"
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.
metrc-mcp
An MCP (Model Context Protocol) server for the METRC cannabis track-and-trace API, focused on the workflows a processor/manufacturer actually runs day to day: checking active package inventory, resolving tags, reconciling transfer manifests, and pulling lab test results.
I built this after several years running licensed processing operations, where "check METRC" is a dozen-times-a-day interruption. Wrapping the API as MCP tools lets an assistant answer questions like "which of our active packages are still awaiting lab results?" or "reconcile yesterday's incoming manifest against what we received" directly against the compliance system of record.
Scope
This deliberately does not wrap the full METRC API. METRC exposes a couple hundred endpoints across cultivation, retail, and processing; most integrations touch a small fraction. This server covers the processor slice:
Tool | What it does |
| Facilities visible to your user key, with license numbers |
| Active inventory with testing state and hold status |
| Full record for one package by tag label |
| Mark a zero-quantity package finished (write, gated) |
| The item catalog packages are created against |
| Manifests in and out |
| Test results for a package by numeric ID |
Cultivation (plants, harvests) and retail (sales receipts) endpoints are out of scope. Adding a domain means one new file in src/tools/.
Related MCP server: @smart-compost/mcp
Safety model
METRC is a legal record. Mistakes in it are compliance findings, not bugs.
Read-only by default. Write tools throw unless
METRC_ALLOW_WRITES=trueis set explicitly.Sandbox support. Set
METRC_SANDBOX=trueto target your state's sandbox instance. Do not enable writes against a production license until the workflow has been tested there.Bounded output. List tools cap at 100 rows and say so, rather than flooding the model's context with a busy facility's full inventory.
METRC auth, briefly
METRC deploys per state (api-ok.metrc.com, api-ca.metrc.com, ...) and authenticates with HTTP Basic where the username is the software vendor's API key and the password is the user's API key. The vendor key identifies the integrator; the user key determines which facilities you can see. Both are required. This trips up most first-time integrators, who expect a single bearer token.
Endpoint paths and payload fields can differ slightly between states and API versions. This server targets the v2 endpoints; if your state lags on a particular resource, the 404 error message will say which path failed.
Setup
npm install
npm run buildConfigure via environment (see .env.example):
METRC_STATE=ok # two-letter state code
METRC_VENDOR_API_KEY=... # from your METRC vendor account
METRC_USER_API_KEY=... # from your METRC user profile
METRC_LICENSE_NUMBER=... # optional default license
METRC_SANDBOX=true # strongly recommended to start
METRC_ALLOW_WRITES=false # keep false until testedRegister with an MCP client (Claude Desktop shown):
{
"mcpServers": {
"metrc": {
"command": "node",
"args": ["/path/to/metrc-mcp/dist/index.js"],
"env": {
"METRC_STATE": "ok",
"METRC_VENDOR_API_KEY": "...",
"METRC_USER_API_KEY": "...",
"METRC_SANDBOX": "true"
}
}
}
}Testing
npm testMETRC vendor sandbox access requires completing METRC's training and API User Agreement process, so this client is validated against a mocked METRC instance instead (test/mock-metrc.ts), with payloads shaped like the real v2 responses. The suite covers two layers:
Client tests — Basic auth construction (vendor key as username, user key as password), query serialization, 429 retry with backoff and eventual surfacing, normalization of METRC's inconsistent error shapes, and license resolution.
End-to-end stdio tests — the compiled server is spawned as a real MCP process and driven over JSON-RPC, the same path Claude Desktop uses. These verify tool registration, response summarization, readable tool-level errors, and that write tools are refused in read-only mode before any network call is attempted.
METRC_BASE_URL exists solely as the test hook that points the client at the mock.
Development
npm run dev # run from source via tsx
npm run build # compile to dist/The layering is: src/metrc/client.ts owns HTTP, auth, timeouts, and 429 retry; src/tools/* define MCP tools per domain and summarize responses; src/config.ts validates environment once at startup. Tool handlers never touch fetch directly.
License
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
- AlicenseAqualityDmaintenanceMCP server for running infrastructure health checks with TIBET provenance. It enables users to define, execute, and audit process health checks with dependency chaining and drift tracking.6MIT
- AlicenseAqualityBmaintenanceMCP server for Smart Compost platform that lets LLM agents list composting processes/devices and pull measurements as read-only tools.69Apache 2.0
- Alicense-qualityCmaintenanceA lightweight, local inventory-intelligence MCP server that enables querying structured inventory schemas with read-only, zero-config tools for stock levels, velocity metrics, and purchase orders.6MIT
- FlicenseCqualityAmaintenanceA production-ready MCP server for inventory and interaction with Alterios/LIMS instances, enabling project listing, readonly data queries via REST and script-services, and controlled write operations.100
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready
MCP server for managing Prisma Postgres.
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/AM253906/metrc-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server