MindsDB MCP server

MindsDB allows applications to answer questions over large-scale federated data—spanning databases, data warehouses, and SaaS applications.
Back to servers
Setup instructions
Provider
MindsDB
Release date
Apr 01, 2025
Language
Python
Stats
35.5K stars

MindsDB's MCP server enables humans, AI, agents, and applications to get highly accurate answers across large-scale data sources. It allows you to connect, unify, and respond to questions over federated data spanning databases, data warehouses, and SaaS applications.

Installation Options

Using Docker Desktop

The fastest and recommended way to get started with the MindsDB MCP server is using Docker Desktop:

  1. Visit the Docker Desktop installation guide
  2. Follow the step-by-step instructions to deploy MindsDB on your machine
  3. Once installed, the MCP server will be available for your applications to connect to

Using Docker

For more flexibility and customization options:

  1. Go to the Docker installation guide
  2. Follow the instructions to set up MindsDB using Docker
  3. This method gives you more control over the configuration

Core Capabilities

Connect Your Data

MindsDB allows you to connect to hundreds of enterprise data sources:

-- Example of connecting to a MySQL database
CREATE DATABASE mysql_connection
WITH ENGINE = 'mysql',
PARAMETERS = {
    "user": "your_username",
    "password": "your_password",
    "host": "your_host",
    "port": 3306,
    "database": "your_database"
};

For a complete list of supported data sources, visit the data integrations documentation.

Unify Your Data

MindsDB allows you to prepare and unify data before generating responses:

Knowledge Bases

Create knowledge bases to index and organize unstructured data:

-- Example of creating a knowledge base
CREATE KNOWLEDGE BASE my_kb
WITH ENGINE = 'chromadb',
STORAGE = 's3',
PARAMETERS = {
    "bucket": "your-bucket",
    "region": "us-east-1"
};

Views

Create unified views across different data sources:

-- Example of creating a view joining data from different sources
CREATE VIEW combined_customer_data AS
SELECT c.customer_id, c.name, o.order_id, o.amount
FROM mysql_db.customers c
JOIN postgres_db.orders o
ON c.customer_id = o.customer_id;

Jobs

Schedule data synchronization and transformation tasks:

-- Example of creating a job to update data hourly
CREATE JOB refresh_data_hourly
BEGIN
    INSERT INTO target_table
    SELECT * FROM source_table
    WHERE update_date > '{{LAST_RUN}}';
END
EVERY HOUR;

Respond From Your Data

Agents

Configure specialized agents to answer questions over your data:

-- Example of creating an agent
CREATE AGENT customer_support_agent
USING
    MODEL = 'openai.gpt-4',
    KNOWLEDGE_BASE = 'support_kb',
    PROMPT TEMPLATE = 'Answer customer support questions based on our documentation: {{question}}';

Using the MCP Protocol

MindsDB's MCP (Model Context Protocol) server allows seamless interaction with your data:

# Python example of connecting to MindsDB MCP server
from mcp_client import MCPClient

# Initialize client
client = MCPClient(url="http://localhost:8000/api/mcp")

# Send a query
response = client.query(
    "What were our top-selling products last quarter?",
    context={"database": "sales_data"}
)

# Process the response
print(response.content)

For more detailed information on using the MCP protocol, visit the MCP documentation.

Advanced Configuration

Environment Variables

Configure the MindsDB server using environment variables:

# Set these variables before starting the server
export MINDSDB_DB_PATH=/path/to/storage
export MINDSDB_LOG_LEVEL=INFO
export MINDSDB_API_PORT=8000

Custom API Settings

Modify the API behavior by adjusting the configuration:

# Example configuration (config.yaml)
api:
  http:
    host: 0.0.0.0
    port: 8000
  cors:
    origins: ["*"]
  rate_limiting:
    enabled: true
    limit: 100
    period: 60

For additional configuration options and examples, refer to the MindsDB documentation.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mindsdb" '{"command":"npx","args":["-y","mindsdb"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mindsdb": {
            "command": "npx",
            "args": [
                "-y",
                "mindsdb"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mindsdb": {
            "command": "npx",
            "args": [
                "-y",
                "mindsdb"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later