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)
claude mcp add --transport stdio fig -- npx -y @figlabs/fig-mcpCode language: bashNext: Inside Claude Code, run /fig:connect to authenticate.
Claude Desktop
./scripts/package-mcpb.shCode language: bashNext: Drag fig-1.0.0.mcpb into Claude Desktop, then add your token in extension settings.
Claude Cowork
./scripts/package-plugin.shCode language: bashNext: Settings → Plugins → Upload local plugin → fig-plugin-1.0.0.zip, then run /fig:connect.
Standalone HTTP
npm install && npm run build && npm startCode language: bashNext: 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.
Tool arguments
auth: { accessToken, sessionId } in tool call paramsHTTP Authorization header
Authorization: Bearer <token> (HTTP transport)Environment variable
FIG_ACCESS_TOKEN=fig_...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_askAsk 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_monitorManage 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 | executionsmonitorId · 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_defineManage 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_contextname · 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_statusCheck 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.
"What is our total revenue?""Show monthly revenue trend over the past year""Compare channels by gross margin""Is discount rate correlated with order volume?""What if we cut discounts by 50%?""Forecast revenue for next quarter""Why is our return rate increasing?""Show unit economics: AOV, basket size, CLV, margin""Cohort retention analysis by first purchase month""What % of customers drive 80% of revenue?"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: jsonSetup Tools
Connection & Auth Tools
These tools handle the initial connection lifecycle. Most users only ever invoke them through /fig:connect.
fig_signupReturns the Fig signup URL and onboarding instructions for new users.
fig_connect_initStart the auth flow with an email — returns 'signup_required' or 'login_required'.
fig_connect_authenticateComplete authentication with email + password. Saves an MCP API key to ~/.fig/config.json.
fig_save_instanceSave custom admin-flow and auth URLs for self-hosted Fig deployments.
fig_disconnectClear saved credentials and instance config from ~/.fig/config.json.
fig_agent_executeExecute 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:connectConnect your Fig account to Claude. Guided signup + auth flow.
/fig:statusCheck connection status, instance URL, and data source count.
/fig:analyzeRun strategic analysis — growth, concentration, or variance.
/fig:discoverGet AI-generated strategic suggestions tailored to your data.
/fig:check-anomaliesCheck all monitors for detected anomalies and RCA results.
/fig:setup-monitorSet up a new monitoring rule for anomaly detection.
/fig:add-metricDefine a new metric in the knowledge graph via the KG Builder agent.
/fig:add-contextAdd business context — fiscal years, definitions, naming rules.
/fig:list-contextsList all business context definitions in the KG.
/fig:metric-explorerExplore metrics and their relationships in the knowledge graph.
/fig:list-sourcesView all connected data sources, their type, and sync status.
/fig:sync-dataTrigger and track a data source sync to refresh metrics and tables.
/fig:magic-onboardingAutomated wizard — company detection, file upload, metric tree generation.
/fig:gap-analysisCompare your KG against an industry template to find missing metrics, domains, and relationships.
/fig:kg-healthGet your knowledge graph health score, gaps, and high-leverage improvements.
/fig:ontologyInspect the KG schema — node types, properties, and relationships.
/fig:templatesView industry templates that recommend metrics and domains for your business type.
/fig:saved-promptsBrowse and run reusable analysis prompts.
/fig:add-promptSave 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_URLhttp://localhost:8005AUTH_BASE_URLhttp://localhost:8080FIG_ACCESS_TOKEN—CLIENT_TYPEmcpMCP_TRANSPORThttpMCP_HTTP_HOST0.0.0.0MCP_HTTP_PORT7333MCP_HTTP_PATH/mcpREQUEST_TIMEOUT_MS15000AUTH_CACHE_TTL_MS60000FIG_EXPOSE_ALL_TOOLSfalseBring 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.