Tool

Query databases with natural language via MCP protocol

Fabi's MCP server lets AI assistants and dev tools chat directly with your data, delegating SQL/Python analysis end-to-end via token or OAuth authentication.

Works with fabi

46
Spark score
out of 100
Updated 6 months ago
Source checked never checked
Version 1.0.0

Add to Favorites

Why it matters

Enable AI assistants and development tools to perform autonomous data analysis by connecting to Fabi's AI agent through the Model Context Protocol, allowing natural language queries to be automatically translated into SQL/Python code, executed against databases, and returned as formatted results.

Outcomes

What it gets done

01

Create persistent analysis threads that maintain query history and generated code context

02

Submit natural language data requests that autonomously discover schemas, generate queries, and validate execution

03

Poll for long-running analysis results that continue processing in the background

04

Save AI-generated analysis cells to Smartbooks for dashboard publishing and team collaboration

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Overview

Fabi

Fabi's MCP server lets AI assistants and development tools chat directly with your data through four tools - create_thread, submit_chat, get_chat_result, and save_to_smartbook. It authenticates via a token or OAuth, and submit_chat delegates full analysis to Fabi's autonomous agent, which discovers data sources, generates and validates SQL or Python, and returns results. Reach for it when you want an MCP-capable AI assistant or tool to query and analyze your data without leaving the client - test the request in the Fabi AI Analyst Agent UI first to confirm it behaves as expected.

What it does

Fabi's MCP server connects Fabi.ai's AI data-analysis capabilities to any MCP client - development tools, AI assistants, or a custom interface - through four tools: create_thread, submit_chat, get_chat_result, and save_to_smartbook. It authenticates either with a token generated at the Fabi settings page or via an OAuth flow, and once connected it is described as the fastest way to let an AI assistant chat directly with your data.

When to use - and when NOT to

Use it when you want an AI assistant or development tool to query and analyze your data without leaving the MCP client - submit_chat delegates the whole task to Fabi's autonomous agent, which discovers relevant data sources, uses RAG to find the right table and column schemas, generates SQL or Python, validates it with a dry run, executes it, and formats the result. The docs recommend first trying the request in the Fabi AI Analyst Agent UI to confirm it behaves as expected before wiring it into MCP, and if a local agent is involved, restarting it after any tool configuration change.

Inputs and outputs

A session starts with create_thread (optional title parameter), which returns a thread UUID backing a Smartbook for SQL/Python analysis and persisting the analysis history and generated code. submit_chat takes that thread_uuid plus a natural-language message (for example, "show top 10 customers by revenue"), with optional context_cell_uuids and context_dataframes to build on previous analyses, and returns a request UUID and initial status. Because submit_chat can return early after a 45-second timeout while the analysis keeps running in the background, get_chat_result is polled periodically with that request_uuid to retrieve the processing status or the completed results with a data preview. save_to_smartbook (given thread_uuid) converts pending AI-generated chat cells into executable Smartbook cells for dashboard publishing or collaboration - only needed for persisting or sharing, since regular analyses are already viewable in the chat history.

Integrations

Token authentication is generated from the Fabi.ai settings page and is the recommended method for programmatic access; OAuth authentication is also supported for user-based integrations. An MCP client connects to the server via npx mcp-remote pointed at Fabi's MCP endpoint with a bearer token in the Authorization header:

{
  "mcpServers": {
    "fabi": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://app.fabi.ai/mcp",
        "--header",
        "Authorization: Bearer <your-fabi-mcp-token>"
      ]
    }
  }
}

Tokens should be stored securely (environment variables or a secret manager, never committed to version control), rotated regularly, and scoped to a single application or user.

Who it's for

Developers and teams who want an AI assistant or MCP-capable tool to query and analyze their data directly - generating and validating SQL or Python, running it, and optionally publishing the results as a shareable Smartbook dashboard - without building a custom data-analysis integration for every client.

Source README

MCP Server

Connect to Fabi through the Model Context Protocol (MCP) server

Overview

Fabi.ai provides an MCP (Model Context Protocol) server that allows you to integrate Fabi's AI data analysis capabilities directly into your development workflow or your client/interface of choice. The MCP server enables AI assistants and development tools to interact with Fabi.ai, creating threads, submitting chat requests, and saving Smartbooks programmatically.

The Fabi MCP server is the single fastest way for you to implement an AI assistant to chat directly with your data.

Authentication

The Fabi MCP server supports two authentication methods:

Token authentication

Token authentication is the recommended method for programmatic access. You can generate MCP tokens from your Fabi.ai settings:

OAuth authentication

OAuth authentication is also supported for user-based integrations. Follow the OAuth flow to authenticate your application and use the following URL: https://app.fabi.ai/mcp

Configuration

To connect to the Fabi MCP server, add the following configuration to your MCP client settings:

{
  "mcpServers": {
    "fabi": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://app.fabi.ai/mcp",
        "--header",
        "Authorization: Bearer <your-fabi-mcp-token>"
      ]
    }
  }
}

Replace <your-fabi-mcp-token> with the token you generated from the settings page.

Available tools

The Fabi MCP server provides the following tools for interacting with Fabi.ai:

Create a thread (create_thread)

Creates a new data analysis session (backed by a Smartbook) for SQL/Python queries. Used to start analyzing database tables, running queries, or exploring data. The thread will persist your analysis history and generated code.

Parameters:

  • title (optional): Title for the analysis session

Returns: Thread UUID for subsequent operations

Submit chat (submit_chat)

Delegate a data analysis task to the Fabi autonomous agent. Takes a description of what you want in natural language - Fabi will independently handle all complexity: discovering data sources, using RAG to find relevant table/column schemas and semantics, generating SQL/Python code, validating queries with dry runs, executing them, and formatting results.

Parameters:

  • thread_uuid: UUID of the thread from create_thread
  • message: Natural language data analysis request (e.g., 'show top 10 customers by revenue')
  • context_cell_uuids (optional): Previous cell UUIDs to reference in this analysis
  • context_dataframes (optional): Variable names of dataframes to use as context

Returns: Request UUID and initial status

Get chat result (get_chat_result)

Poll for the result of a long-running chat analysis request. Used by the agent when submit_chat returns early due to timeout (after 45 seconds). The chat continues processing in the background - call this periodically to check if results are ready.

Parameters:

  • request_uuid: UUID of the chat request (returned by submit_chat)

Returns: Processing status or completed results with data preview

Save to Smartbook (save_to_smartbook)

Save AI-generated cells from chat history to the Smartbook for dashboard publishing or collaboration. Used by the agent to persist, publish, or share the analysis as a dashboard. This accepts pending chat results and converts them into executable Smartbook cells. Regular analyses are already viewable in chat history and don't need saving.

Parameters:

  • thread_uuid: UUID of the thread to save

Returns: Confirmation of saved Smartbook cells

Usage examples

Basic workflow

  1. Create a thread to start a new analysis session
  2. Submit chat requests with natural language queries
  3. Get chat results to retrieve analysis outputs
  4. Save to Smartbook (optional) to persist results for sharing

Example: Analyzing sales data

// 1. Create a new thread
const thread = await mcp.callTool('fabi', 'create_thread', {
  title: 'Sales Analysis Q4 2024'
});

// 2. Submit an analysis request
const request = await mcp.callTool('fabi', 'submit_chat', {
  thread_uuid: thread.uuid,
  message: 'Show top 10 customers by revenue in Q4 2024'
});

// 3. Get the results
const results = await mcp.callTool('fabi', 'get_chat_result', {
  request_uuid: request.uuid
});

// 4. Save to Smartbook for sharing
await mcp.callTool('fabi', 'save_to_smartbook', {
  thread_uuid: thread.uuid
});

Troubleshooting

  • First try using the AI Analyst Agent in the Fabi UI to ensure it works as expected.
  • If using token-based authentication, make sure you're using a valid token
  • If using a local agent, restart the agent after configuring the tools

Best practices

Token security

  • Store MCP tokens securely and never commit them to version control
  • Use environment variables or secure secret management
  • Rotate tokens regularly for enhanced security
  • Each token should only be used by one application or user

Error handling

  • Implement retry logic for get_chat_result when status is "processing"
  • Handle timeout scenarios gracefully
  • Validate thread UUIDs before making subsequent calls

Performance

  • Use context_cell_uuids and context_dataframes to build on previous analyses
  • Only call save_to_smartbook when you need to persist results
  • Batch related queries in the same thread for better context

Source: https://docs.fabi.ai/advanced_features_and_dev_tools/mcp_server

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.