MindsDB MCP server

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

MindsDB's MCP server enables humans, AI, agents, and applications to get highly accurate answers across sprawled and large-scale data sources. The Model Context Protocol (MCP) server built into MindsDB allows your applications to connect, unify, and respond to questions over federated data spanning databases, data warehouses, and SaaS applications.

Installation Options

Using Docker Desktop

This is the fastest and recommended way to get started with MindsDB's MCP server:

  1. Visit the Docker Desktop installation guide
  2. Follow the instructions to download and set up Docker Desktop
  3. Pull and run the MindsDB container which includes the MCP server

Using Docker

For more flexibility and customization options:

# Pull the latest MindsDB image
docker pull mindsdb/mindsdb

# Run MindsDB with the MCP server enabled
docker run -p 47334:47334 -p 47335:47335 mindsdb/mindsdb

The MCP server will be available on port 47335 by default.

Using PyPI

For those who want to install directly via Python:

pip install mindsdb

After installation, start the MindsDB server:

python -m mindsdb

Using the MCP Server

Connecting to Data Sources

Before using the MCP server, you need to connect your data sources:

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

MindsDB supports hundreds of data sources including databases, data warehouses, and SaaS applications.

Unifying Data

After connecting your data sources, you can create unified views:

-- Create a view that joins data from multiple sources
CREATE VIEW unified_customer_data AS
SELECT c.*, o.order_id, o.order_date, o.amount
FROM mysql_connection.customers AS c
JOIN postgres_connection.orders AS o
ON c.customer_id = o.customer_id;

Creating Knowledge Bases

For unstructured data, you can create knowledge bases:

-- Create a knowledge base from documents
CREATE KNOWLEDGE BASE product_documentation
FROM files_connection.product_manuals;

Setting Up MCP Agents

To interact with your data through the MCP server, create and configure agents:

-- Create an agent that can answer questions about your data
CREATE AGENT customer_support_agent
USING
    CONNECTION = openai_connection,
    KNOWLEDGE BASE = product_documentation,
    DATABASE = unified_customer_data,
    MODEL = 'gpt-4';

Interacting with the MCP Server

You can interact with the MCP server using the MCP protocol:

// Example JavaScript client
const mcp = require('mcp-client');

const client = new mcp.Client({
    host: 'localhost',
    port: 47335,
});

// Connect to the MCP server
await client.connect();

// Send a query to an agent
const response = await client.query({
    agent: 'customer_support_agent',
    query: 'What are the total sales for customer ID 12345?'
});

console.log(response);

Automating Tasks with Jobs

You can schedule data synchronization and transformation tasks:

-- Create a job to refresh a view daily
CREATE JOB refresh_unified_data
BEGIN
    REFRESH VIEW unified_customer_data;
END
SCHEDULE EVERY 1 DAY;

Monitoring and Management

To check the status of your MCP server and agents:

-- List all available agents
SELECT * FROM information_schema.agents;

-- List all running jobs
SELECT * FROM information_schema.jobs;

Additional Resources

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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