Fig

MCP Server Docs

Bring Fig's Causal Intelligence Into Claude

The Fig MCP server exposes your data warehouse, knowledge graph, monitors, and analytics agents as tools any MCP-compatible AI assistant can call. Install in 30 seconds, then ask any business question — with structured metrics, SQL lineage, and follow-up prompts in every response.

Installation

Install Fig in Any MCP Client

Fig ships as an MCP server, a Claude Desktop MCPB extension, a Claude Cowork plugin, and a standalone HTTP server. Pick your client and run a single command.

Claude Code (CLI)

One-liner
claude mcp add --transport stdio fig -- npx -y @figlabs/fig-mcp
Code language: bash

Next: Inside Claude Code, run /fig:connect to authenticate.

Claude Desktop

MCPB Extension
./scripts/package-mcpb.sh
Code language: bash

Next: Drag fig-1.0.0.mcpb into Claude Desktop, then add your token in extension settings.

Claude Cowork

Plugin
./scripts/package-plugin.sh
Code language: bash

Next: Settings → Plugins → Upload local plugin → fig-plugin-1.0.0.zip, then run /fig:connect.

Standalone HTTP

Self-hosted
npm install && npm run build && npm start
Code language: bash

Next: Server listens on http://0.0.0.0:7333/mcp. Configure ADMIN_FLOW_BASE_URL and AUTH_BASE_URL in .env.

New to Fig? Run /fig:connect after install — it walks you through signup at app.figlabs.ai/signup and auto-saves your credentials.

Authentication

Auth Priority Chain

Fig resolves auth in this order — first match wins. You almost never need to manage this manually; /fig:connect writes~/.fig/config.json for you.

1

Tool arguments

auth: { accessToken, sessionId } in tool call params
2

HTTP Authorization header

Authorization: Bearer <token> (HTTP transport)
3

Environment variable

FIG_ACCESS_TOKEN=fig_...
4

Local config file

~/.fig/config.json (written by /fig:connect)

Default Tools

4 Semantic Tools Cover 95% of Use Cases

These high-level facade tools handle async patterns, thread continuity, and structured result formatting internally. Set FIG_EXPOSE_ALL_TOOLS=true to also expose 98+ granular tools.

fig_ask

Ask any business question

The primary analysis tool. Pass a natural-language question and Fig runs the full async analysis pipeline — knowledge-graph lookup, SQL generation, execution, and structured response with metrics, data tables, chart specs, insights, and follow-up prompts. Threads continue automatically.

Parameters

question · stringrequiredYour business question in natural language.
threadId · stringContinue a previous thread. Usually auto-managed.
newThread · booleanSet true to start a fresh analysis.

Examples

  • "What is our total revenue this quarter?"
  • "Compare channels by gross margin"
  • "Why is our return rate increasing?"
  • "Cohort retention analysis by first purchase month"
  • "What % of customers drive 80% of revenue?"
fig_monitor

Manage automated monitors and anomalies

Create, list, pause, and inspect scheduled monitors. Detects spikes, dips, and trend changes against your metrics, then auto-investigates root causes when anomalies fire.

Parameters

action · stringrequiredlist | create | get | update | delete | pause | resume | anomalies | investigate | executions
monitorId · stringRequired for get/update/delete/pause/resume/executions.
payload · objectMonitor config for create/update (name, cron, sql, value_columns, datasource, rca_instructions).
description · stringDescription of the anomaly to investigate.
anomalyId · stringSpecific anomaly/run ID to investigate.
limit · numberMax results (default 50).

Examples

  • fig_monitor(action: "list")
  • fig_monitor(action: "anomalies", limit: 20)
  • fig_monitor(action: "investigate", monitorId: "mon_123", description: "Revenue dropped 35% on Feb 14")
fig_define

Manage business knowledge in the KG

Add metrics, business contexts, and domain definitions that improve every future analysis. The KG Builder validates formulas against your real schema, identifies base tables, and persists canonical definitions.

Parameters

action · stringrequiredlist_metrics | define_metric | list_contexts | add_context | update_context | delete_context
name · stringMetric or context name.
description · stringHuman-readable description.
formula · stringSQL or natural-language formula for define_metric.
context · stringBusiness context text for add/update_context.
contextId · stringContext ID for update_context / delete_context.
universal · booleanIf true, context applies to ALL analyses.

Examples

  • fig_define(action: "list_metrics")
  • fig_define(action: "define_metric", name: "Revenue Per Employee", formula: "SUM(TOTAL_AMOUNT) / COUNT(DISTINCT EMPLOYEE_KEY)")
  • fig_define(action: "add_context", name: "Fiscal Year", context: "FY starts April 1, ends March 31", universal: true)
fig_status

Check connection health and data sources

Returns the live connection state, instance URL, auth status, user ID, data source count, and client type. Use it as the pre-flight check before any other tool call.

Parameters

(none) · Takes no parameters.

Examples

  • fig_status()

What fig_ask Can Answer

10 Question Patterns, One Tool

Fig classifies your question, picks the right analysis algorithm, and returns structured output — never just a number, never just prose.

Metrics
"What is our total revenue?"
Exact figures with formatted values and MoM changes
Trends
"Show monthly revenue trend over the past year"
Time series data with growth rates and chart specs
Comparisons
"Compare channels by gross margin"
Ranked breakdown with dimensional analysis
Correlations
"Is discount rate correlated with order volume?"
Pearson r, p-value, and statistical significance
What-If
"What if we cut discounts by 50%?"
Scenario projection with revenue impact
Forecasting
"Forecast revenue for next quarter"
Trend-based projection with confidence intervals
Root Cause
"Why is our return rate increasing?"
Diagnostic breakdown with contributing factors
Composite
"Show unit economics: AOV, basket size, CLV, margin"
Multi-metric dashboard with cross-references
Cohort
"Cohort retention analysis by first purchase month"
Cohort matrix with retention percentages
Pareto
"What % of customers drive 80% of revenue?"
80/20 analysis with customer segmentation

Response Shape

{
  "status": "complete",
  "threadId": "abc-123",
  "narrative": "## Revenue Analysis\n\nTotal revenue is **$22.5M**...",
  "analysis": {
    "title": "Revenue Analysis",
    "summary": "Revenue grew 12% MoM...",
    "metrics": [{ "label": "Sales Amount", "value": 22519070, "formatted": "$22.5M", "change": "+3.2%" }],
    "data_tables": [{ "table_id": "table_1", "columns": [...], "rows": [...], "source_sql": "SELECT ..." }],
    "chart_specs": [{ "chart_type": "bar", "title": "Revenue by Channel", "x_axis": {...}, "y_axis": {...} }],
    "insights": ["Revenue increased 3.2% MoM driven by Vending Machines channel.", ...],
    "follow_up_prompts": ["Break down Vending Machines by product category", ...],
    "sql_queries": ["SELECT channel_name, SUM(total_amount) ..."],
    "tables_used": ["awzomx-prototypes.cpg_retail.fact_orders"]
  }
}
Code language: json

Setup Tools

Connection & Auth Tools

These tools handle the initial connection lifecycle. Most users only ever invoke them through /fig:connect.

fig_signup

Returns the Fig signup URL and onboarding instructions for new users.

fig_connect_init

Start the auth flow with an email — returns 'signup_required' or 'login_required'.

fig_connect_authenticate

Complete authentication with email + password. Saves an MCP API key to ~/.fig/config.json.

fig_save_instance

Save custom admin-flow and auth URLs for self-hosted Fig deployments.

fig_disconnect

Clear saved credentials and instance config from ~/.fig/config.json.

fig_agent_execute

Execute the analytics agent synchronously over SSE — for power users that need direct streaming.

/fig: Slash Commands

19 Guided Workflows in Claude Code

Slash commands wrap multi-tool workflows behind a single trigger — Claude follows the command's playbook (preflight → tool calls → presentation) and reports back. Available in Claude Code and Claude Cowork plugin contexts.

/fig:connect

Connect your Fig account to Claude. Guided signup + auth flow.

/fig:status

Check connection status, instance URL, and data source count.

/fig:analyze

Run strategic analysis — growth, concentration, or variance.

/fig:discover

Get AI-generated strategic suggestions tailored to your data.

/fig:check-anomalies

Check all monitors for detected anomalies and RCA results.

/fig:setup-monitor

Set up a new monitoring rule for anomaly detection.

/fig:add-metric

Define a new metric in the knowledge graph via the KG Builder agent.

/fig:add-context

Add business context — fiscal years, definitions, naming rules.

/fig:list-contexts

List all business context definitions in the KG.

/fig:metric-explorer

Explore metrics and their relationships in the knowledge graph.

/fig:list-sources

View all connected data sources, their type, and sync status.

/fig:sync-data

Trigger and track a data source sync to refresh metrics and tables.

/fig:magic-onboarding

Automated wizard — company detection, file upload, metric tree generation.

/fig:gap-analysis

Compare your KG against an industry template to find missing metrics, domains, and relationships.

/fig:kg-health

Get your knowledge graph health score, gaps, and high-leverage improvements.

/fig:ontology

Inspect the KG schema — node types, properties, and relationships.

/fig:templates

View industry templates that recommend metrics and domains for your business type.

/fig:saved-prompts

Browse and run reusable analysis prompts.

/fig:add-prompt

Save a reusable analysis prompt for future runs.

Some commands (gap-analysis, kg-health, ontology, templates, sync-data, saved-prompts, add-prompt, magic-onboarding) require FIG_EXPOSE_ALL_TOOLS=true.

Power User Mode

98+ Granular Tools (Opt-In)

Set FIG_EXPOSE_ALL_TOOLS=true to expose every backend endpoint as an individual MCP tool. Use when you need fine-grained control or are building an automated pipeline.

Analysis

analysis_start, analysis_status — async analysis primitives

Threads

threads_list, threads_get, threads_delete — direct thread management

Monitoring

monitoring_* — individual monitor CRUD operations

Anomalies & RCA

anomalies_*, rca_* — granular anomaly and root-cause endpoints

Knowledge Graph

metrics_list, metrics_neighbors, business_context_* — direct KG access

Data Sources

data_sources_list, data_source_sync_start, data_source_sync_status, data_source_sync_details

Discovery

discovery_start, discovery_status, discovery_result — schema exploration

Intelligence

intelligence_health, intelligence_run_gap_analysis, intelligence_templates, intelligence_ontology_schema

Onboarding

fig_onboard_start, fig_upload_file, fig_upload_sheets, fig_onboard_analyze

Prompts

prompt_create, prompt_list, prompt_get, prompt_update, prompt_delete

Configuration

Environment Variables

Configure the server's transport, endpoints, and capabilities. All variables are optional — defaults match a local dev setup.

ADMIN_FLOW_BASE_URL
http://localhost:8005
Fig admin-flow-agent URL
AUTH_BASE_URL
http://localhost:8080
Fig auth backend URL
FIG_ACCESS_TOKEN
API key (alternative to /fig:connect)
CLIENT_TYPE
mcp
Output format (mcp, web, spreadsheet)
MCP_TRANSPORT
http
Transport mode (http or stdio)
MCP_HTTP_HOST
0.0.0.0
HTTP listen host
MCP_HTTP_PORT
7333
HTTP listen port
MCP_HTTP_PATH
/mcp
HTTP endpoint path
REQUEST_TIMEOUT_MS
15000
Request timeout in ms
AUTH_CACHE_TTL_MS
60000
Auth validation cache TTL
FIG_EXPOSE_ALL_TOOLS
false
Expose all 98+ granular tools

Bring Fig Into Your AI Workflow

Free forever — no credit card required. Install the MCP server in 30 seconds, run /fig:connect, and ask your first business question.