Formul8 Docs
User Guide

Integrations Guide

MCP tools, embeddable widget, API patterns, and third-party connections

Integrations Guide

Formul8 provides several integration points for connecting its capabilities to your existing tools and workflows. This guide covers MCP tools for AI code editors, the embeddable knowledge widget, API integration patterns, and third-party connections.


MCP Tools for Cursor and Claude Desktop

Formul8 provides a Model Context Protocol (MCP) server that exposes 65+ METRC cannabis tracking tools to AI code editors like Cursor and Claude Desktop. This allows you to query and interact with METRC data directly from your development environment.

What Is MCP?

The Model Context Protocol is a standard for connecting AI assistants to external tools and data sources. When you connect Formul8's MCP server to Cursor or Claude Desktop, the AI assistant gains the ability to call METRC API operations on your behalf.

Available Tools (65+)

The MCP server provides tools across all major METRC API categories:

CategoryExample ToolsCount
FacilitiesList facilities, get facility details3
PackagesList active/on-hold/inactive packages, create package, adjust package12
PlantsList vegetative/flowering plants, create planting, change growth phase10
Plant BatchesList batches, create batch, destroy plants8
StrainsList strains, create strain, update strain4
HarvestsList harvests, create harvest packages, finish harvest6
TransfersList incoming/outgoing transfers, get transfer details8
SalesList sales receipts, create sales receipt5
Lab ResultsGet lab results for package, list testing labs3
ItemsList items, create item4
ComplianceNeeds-attention analysis, audit-ready check, FIFO analysis2+

Analysis Skills

Beyond raw METRC API access, the MCP server includes 12 analysis skills that provide higher-level intelligence:

SkillWhat It Does
needs-attentionIdentifies packages, plants, and transfers that require immediate action
audit-readyEvaluates whether your facility data is audit-ready and flags gaps
fifoAnalyzes inventory for FIFO (First In, First Out) compliance
inventory-snapshotProvides a comprehensive inventory summary at a point in time
transfer-summarySummarizes transfer activity over a date range
package-historyTraces the full lifecycle of a specific package
compliance-checkRuns a series of compliance validations against current data
yield-analysisCalculates yield metrics from harvest data
sales-analysisSummarizes sales patterns and trends
strain-performanceCompares strain performance across harvests
waste-reportAnalyzes waste and destruction records
expiration-trackerIdentifies packages approaching lab test expiration

Connecting to Cursor

  1. Open Cursor settings
  2. Navigate to the MCP servers configuration
  3. Add the Formul8 MCP server:
{
  "mcpServers": {
    "formul8-metrc": {
      "command": "npx",
      "args": ["-y", "formul8-metrc-mcp"],
      "env": {
        "METRC_VENDOR_API_KEY": "your-vendor-key",
        "METRC_USER_API_KEY": "your-user-key"
      }
    }
  }
}
  1. Restart Cursor to activate the MCP connection
  2. The AI assistant can now call METRC tools when you ask questions about your cannabis data

Connecting to Claude Desktop

  1. Open Claude Desktop settings
  2. Navigate to MCP server configuration
  3. Add the server configuration (same format as Cursor above)
  4. Restart Claude Desktop

Example MCP Interactions

Once connected, you can ask your AI assistant questions like:

  • "List all active packages in my facility"
  • "Are there any packages that need attention?"
  • "Run an audit-ready check on my facility"
  • "Show me the FIFO analysis for my flower inventory"
  • "What is the yield analysis for my last 5 harvests?"

The AI assistant calls the appropriate MCP tools behind the scenes and presents the results in a readable format.

Vercel Edge API

The MCP server is also available as an HTTP API for custom integrations:

Base URL: https://metrc-mcp.vercel.app

EndpointMethodPurpose
/api/mcpPOSTMCP protocol endpoint for tool calls
/api/chatPOSTChat interface for natural language queries
/api/healthGETHealth check with tool count

Embeddable Knowledge Widget

The Future4200 knowledge widget (formul8future.js) can be embedded in your own website or application to provide AI-powered answers from the Future4200 knowledge base.

What It Does

The widget adds a chat bubble to your website. When a user clicks it, a chat panel opens where they can ask cannabis-related questions. Answers are sourced from 7,061 Future4200 forum threads with citations.

Embedding the Widget

Add the following script tag to your HTML:

<script src="https://future.formul8.ai/formul8future.js"></script>

The widget initializes automatically and places a chat bubble in the bottom-right corner of the page.

Customization

The widget supports configuration options passed as data attributes or through a JavaScript initialization call:

<script
  src="https://future.formul8.ai/formul8future.js"
  data-position="bottom-right"
  data-theme="dark"
></script>

Widget API

The widget communicates with the Future4200 knowledge API:

EndpointMethodAuthPurpose
/api/chatPOSTOptional API keyChat with Future4200 context and citations
/v1/chat/completionsPOSTOptional API keyOpenAI-compatible chat adapter
/api/threadsGETOptional API keySearch Future4200 threads directly

API Integration Patterns

OpenAI-Compatible Integration

Formul8's API follows the OpenAI Chat Completions format, making it compatible with any tool or library that supports the OpenAI API. See the API Reference for full details.

Drop-in replacement pattern:

If your application already uses the OpenAI API, you can switch to Formul8 by changing the base URL and API key:

# Before: OpenAI
client = OpenAI(api_key="sk-...")

# After: Formul8
client = OpenAI(
    api_key="YOUR_FORMUL8_API_KEY",
    base_url="https://chat.formul8.ai/v1"
)

All other code — message formatting, streaming, response parsing — remains the same.

Webhook Integration

The Dashboard (users.formul8.ai) processes Stripe webhooks for subscription events. If you need to integrate subscription changes into your own systems, you can configure Stripe webhooks in your Stripe dashboard to forward events to your own endpoints alongside Formul8's.

Key Stripe events handled:

  • checkout.session.completed — New subscription created
  • customer.subscription.updated — Plan upgrade/downgrade
  • customer.subscription.deleted — Subscription cancelled
  • invoice.payment_succeeded — Payment processed
  • invoice.payment_failed — Payment failed

Health Monitoring

All Formul8 services expose health endpoints for monitoring:

ServiceHealth URLAuth
Backend Gatewayhttps://chat.formul8.ai/healthNone
Dashboardhttps://users.formul8.ai/api/healthNone
MCP Serverhttps://metrc-mcp.vercel.app/api/healthNone

You can integrate these into your own monitoring systems (Datadog, PagerDuty, etc.) to track Formul8 service availability.


Integration with Cannabis Systems

Metrc Track-and-Trace

Formul8 integrates with Metrc through two pathways:

  1. Metrc Dashboard (metrc.formul8.ai) — Full UI dashboard with AI Copilot for interactive use
  2. MCP Tools — 65+ tools for programmatic access via Cursor, Claude Desktop, or the HTTP API

Both pathways require Metrc vendor and user API keys, configured at the account level.

POS Systems

The Command Center supports CSV import from common cannabis POS systems:

  • Dutchie
  • Treez
  • Flowhub

Export sales data from your POS system as CSV and import it into the Command Center for cross-facility analytics.

ERP and Accounting

Financial data can be imported into the Command Center via CSV for integration with:

  • QuickBooks
  • Sage
  • Custom ERP systems

Coming Soon

IntegrationStatusExpected
Document upload and storageComing soonTBD
Google Drive integrationComing soonTBD
BioTrack track-and-tracePlannedTBD

Future4200 Knowledge API

The Future4200 knowledge base is available through a standalone API for custom integrations.

Base URL: https://future.formul8.ai

Search Threads

curl https://future.formul8.ai/api/threads?q=winterization+ethanol

Returns matching threads from the 7,061-thread corpus with relevance scores.

Chat with Context

curl -X POST https://future.formul8.ai/api/chat \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What is the best winterization technique for crude ethanol extract?"
  }'

Returns an AI-generated answer with citations from relevant Future4200 threads.

OpenAI-Compatible

curl -X POST https://future.formul8.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "future4200",
    "messages": [
      {"role": "user", "content": "How do I troubleshoot a vacuum oven?"}
    ]
  }'

Rate Limits for Integrations

ServiceLimit
Backend API (authenticated)Per-tier limits (see Pricing & Plans)
Backend API (anonymous)500 messages per day per IP
Future4200 API100 requests per hour per IP
MCP ServerGoverned by METRC API rate limits

Next Steps


Last updated: 2026-02-18