# OpenTHC MCP

> OpenTHC lets your AI agent manage every step of cannabis compliance, from tracking plants in cultivation to logging B2B transfers or verifying lab results for retail sales. It connects all regulatory data sources—including inventory, licenses, and transactions—into one chat interface, giving you full control over your seed-to-sale workflow.

## Overview
- **Category:** supply-chain
- **Price:** Free
- **Tags:** seed-to-sale, cannabis-compliance, inventory-management, lab-testing, b2b-transfers

## Description

**OpenTHC lets your AI agent manage every step of cannabis compliance, from tracking plants in cultivation to logging B2B transfers or verifying lab results for retail sales.** It connects all regulatory data sources—including inventory, licenses, and transactions—into one chat interface. You'll get full control over the entire seed-to-sale workflow without ever jumping between five different portals. 

### Compliance & Legal Status

When you need to verify if an operation is legal or authorized, your AI client uses `list_licenses` to pull up active cannabis operating licenses, detailing their specific types and expiration dates. You can check company legitimacy by calling `list_companies`, which retrieves a list of all registered legal entities in the network, showing their current status and license holders. For quick reference with trading partners or regulatory bodies, `list_contacts` provides verified contact information for both agencies and other companies within the OpenTHC system.

### Cultivation & Product Catalog

The process starts on the plant floor. To track growth, your agent calls `list_plants`, which lists all plants currently in cultivation, showing their growth stage, strain variety, and exact physical facility location. You can plan harvests using `list_sections`, which provides a list of every facility area—like drying chambers or processing rooms—and the environmental parameters for that space. For genetic context, `list_varieties` gives details on registered cannabis strains, including genetics type (THC/CBD dominant) and breeder information. Finally, you can review the entire commercial catalog using `list_products`, which retrieves all saleable goods data, including SKU numbers, potency percentages (THC/CBD), and regulatory classifications.

### Inventory & Movement Tracking

Managing materials requires precision. To track real-time stock, your AI client uses `list_inventory`, listing every tracked item with its lot number, quantity, storage location, and full chain of custody history. When goods move between businesses, you can process B2B transfers using `list_b2b_transactions`. This tool retrieves all incoming and outgoing wholesale shipment orders, including the required manifests and current fulfillment status for each transfer. For retail operations, your agent handles daily sales analysis by calling `list_b2c_transactions`, which lists every single point-of-sale transaction, giving you sale details, tax breakdowns, and confirmations of inventory deductions.

### Quality Control & Validation

Quality control data is pulled together through two systems. You can start by listing all collected lab samples using `list_lab_samples`. Then, to validate a product's readiness for market, your agent accesses the full Certificates of Analysis (CoA) via `list_lab_results`, verifying potency, terpene profiles, and contaminant test results for every sample.

This system links everything. You don't just check licenses; you verify that licensed entities are handling correctly inventoried plants, which move through compliant B2B transfers, end up in a product catalog, and eventually sell via logged retail transactions—all while their quality is backed by verified lab results.

## Tools

### list_b2b_transactions
Retrieves all incoming and outgoing wholesale transfer orders, including manifests and fulfillment status.

### list_b2c_transactions
Lists every retail sale transaction, providing sale details, tax breakdown, and inventory deduction confirmations.

### list_companies
Retrieves a list of all registered legal entities in the compliance network, including their status and license holders.

### list_contacts
Provides contact information for verified trading partners and regulatory agencies within the OpenTHC system.

### list_inventory
Lists every tracked item, including lot number, quantity, storage location, and chain of custody history.

### list_lab_results
Provides Certificates of Analysis (CoA) details, showing potency, terpene profile, and contaminant test results for samples.

### list_lab_samples
Lists all collected lab samples, indicating the associated inventory lot, type, and current testing status.

### list_licenses
Retrieves a list of active cannabis licenses, including their specific types, expiration dates, and regulatory conditions.

### list_plants
Lists all plants currently in cultivation, showing growth stage, strain variety, and physical facility location.

### list_products
Retrieves the complete catalog of saleable goods, including SKU data, potency percentages (THC/CBD), and regulatory classifications.

### list_sections
Lists all facility areas—like processing rooms or drying chambers—and their environmental parameters for spatial planning.

### list_varieties
Provides details on registered cannabis strains, including genetics type (THC/CBD dominant) and breeder information.

## Prompt Examples

**Prompt:** 
```
List all our active cannabis licenses and verify which ones are expiring soon.
```

**Response:** 
```
I've fetched your regulatory licenses. You currently hold 3 active licenses: Cultivation License #CU-2024-0891 (expires 2026-12-31), Processing License #PR-2024-0345 (expires 2025-06-30 — expiring in 89 days), and Retail License #RT-2024-1122 (expires 2027-03-15). Would you like me to prepare a renewal checklist for the Processing license?
```

**Prompt:** 
```
Show me all plants currently in flowering stage in Room 3 and estimate harvest readiness.
```

**Response:** 
```
Running cultivation query... I found 127 active plants in Room 3 (Flowering Chamber). Breakdown: 85 Blue Dream plants (Week 6 of 8 flowering — harvest estimated 2025-04-21), 42 OG Kush plants (Week 4 of 9 — harvest estimated 2025-05-05). All plants are within compliance plant count limits. Environmental logs show optimal conditions. Would you like nutrient schedules or trimming crew assignments for the upcoming Blue Dream harvest?
```

**Prompt:** 
```
Check inventory levels for all THC-dominant flower products and show me pending lab results.
```

**Response:** 
```
Cross-referencing inventory and lab testing... Current THC flower stock: 14.2 kg of Blue Dream (Lot BD-2025-0412), 8.7 kg OG Kush (Lot OG-2025-0398), and 3.1 kg Sour Diesel (Lot SD-2025-0445). Pending lab results: 2 batches awaiting clearance — Lot BD-2025-0419 (potency panel, results expected 2025-04-10) and Lot OG-2025-0421 (full pesticide panel, results expected 2025-04-12). All currently available stock has valid CoAs. Should I flag any inventory nearing expiration?
```

## Capabilities

### Verify regulatory licenses
Check if a company or facility has active and valid cannabis operating licenses.

### Track real-time inventory levels
Query current stock, lot numbers, locations, and chain of custody history across all stored materials.

### Process B2B transfer records
List incoming and outgoing wholesale shipment orders, including associated manifests and fulfillment statuses.

### Analyze daily retail sales
Retrieve point-of-sale transaction history for tax reporting and purchase limit enforcement.

### Review lab testing results
Access Certificates of Analysis (CoA) to verify potency, contaminants, and quality control data for products.

## Use Cases

### Approving a cross-state shipment
A Supply Chain Coordinator needs to ship product. They first use `list_companies` to ensure the receiving partner is registered. Next, they check `list_licenses` for both locations' operating status. Finally, they query `list_b2b_transactions` to generate a shipment manifest and confirm compliance.

### Handling a product recall
A Compliance Officer suspects contamination. They run `list_lab_samples` to identify the affected batch IDs, then cross-reference those IDs with `list_inventory` to pinpoint every physical location where that lot number exists.

### Running end-of-day sales reconciliation
A Dispensary Operator needs to close out the day. They use `list_b2c_transactions` for total revenue and tax figures, then check `list_products` to ensure all sold SKUs are correctly accounted for in the inventory deduction.

### Planning a harvest cycle
A Cultivation Manager needs to know which crops are ready. They use `list_plants` to see growth stages, then consult `list_varieties` to get strain-specific harvesting data and estimate the yield for planning.

## Benefits

- Verify legality instantly. Instead of checking multiple state and federal registries, simply ask for `list_licenses` to confirm a facility's active status before any operation begins.
- Know where every gram is stored. Use `list_inventory` combined with `list_sections` to get real-time stock counts tied to specific physical rooms in the facility.
- Speed up compliance audits. By querying `list_lab_results`, you get immediate access to all CoAs and quality control data, eliminating manual report compilation.
- Manage logistics effortlessly. Use `list_b2b_transactions` to track a wholesale shipment's status—from 'draft' to 'received'—without logging into the partner portal.
- Maximize sales efficiency. Checking `list_b2c_transactions` gives you immediate insights into daily purchase patterns and helps enforce regulatory sale limits.

## How It Works

The bottom line is you tell your AI client what data you need, and it pulls the correct compliance information from the OpenTHC system without you ever seeing a complex dashboard.

1. Subscribe to the OpenTHC server and provide your required CRE credentials (CRE code, service key, etc.).
2. Connect your preferred AI client (Claude, Cursor, etc.) using the MCP protocol.
3. Start asking questions in natural language. Your agent runs the necessary tools—like `list_lab_results` or `list_inventory`—and delivers the compiled answer.

## Frequently Asked Questions

**How do I check if my facility is licensed using list_licenses?**
You ask your agent to call `list_licenses`. It returns a full ledger of all active permits (Cultivation, Processing, Retail), including the expiration date and any specific regulatory conditions attached.

**What is the difference between list_inventory and list_products?**
`list_products` gives you the catalog data—the name, SKU, and percentage. `list_inventory` tells you what stock actually exists right now (lot number, quantity) at a specific location.

**Can I use list_b2b_transactions to track missing goods?**
Yes. You run `list_b2b_transactions` to see the manifest and expected quantities. Then, you can compare that with a subsequent query on `list_inventory` to confirm if the physical stock matches the records.

**How does list_lab_results help me sell product?**
`list_lab_results` provides the official CoA. Your agent uses this data to prove that the potency and contaminant levels of a specific lot meet state and federal sale standards.

**When should I run `list_companies` before initiating B2B transfers?**
You must first verify your legal network status using `list_companies`. This ensures that all associated license holders, distributors, and facilities are correctly registered within the compliance engine. Running this tool confirms you have the proper IDs to start any regulated transfer or transaction.

**If I need to know the physical location of my inventory items, how do I use `list_sections`?**
`list_sections` defines your facility's operational zones—like specific cultivation rooms or processing areas. By cross-referencing this data with `list_inventory`, you can assign a precise physical coordinate to every lot number and track material movement across the site.

**If a sample hasn't cleared testing, how does running `list_lab_samples` help me manage the QA queue?**
`list_lab_samples` tracks the full lifecycle of a submitted sample. You can check its status and see which test panels are pending or have failed, letting you know exactly when a batch is cleared for use, regardless of inventory levels.

**When setting up a new crop record, how does `list_varieties` help me track strain data for plants?**
`list_varieties` gives you the genetic backbone for your cultivation. By referencing specific varieties (e.g., genetics type or breeder info), you ensure that every plant recorded via `list_plants` is correctly linked to its source and regulatory profile.

**Can my AI automatically check if a cannabis batch has passed laboratory testing before I approve a sale?**
Yes! Use the `list_lab_results` tool to fetch all Certificates of Analysis (CoA) and review potency, terpene profiles, and contaminant test results. Your AI agent will respond with complete pass/fail determinations and analytical data linked to specific inventory lots. Always verify CoA clearance before creating B2B transfer orders or retail sales to ensure regulatory compliance.

**How do I quickly list all active plants in a specific cultivation room to check growth stages and predict harvest windows?**
Simply ask the agent to run the `list_plants` action. It will compile all active plant records with their POP/PIP tags, current growth stage (vegetative, flowering, harvesting), strain variety, and estimated harvest dates. For facility-specific filtering, cross-reference with the `list_sections` tool to identify the target cultivation room GID and request plants assigned to that spatial zone.

**Does the OpenTHC integration permit modifying or destroying inventory records?**
No. The current tool set focuses strictly on read-only querying and analytical operations — listing companies, verifying licenses, inspecting inventory, reviewing lab results, and tracking B2B/B2C transactions. State alteration operations (creating, adjusting, or destroying inventory) are not currently exposed, assuring your compliance records remain secure against destructive queries. This design prioritizes audit readiness and regulatory reporting safety.