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
27.8K stars

MindsDB is an AI data solution that enables humans, AI, agents, and applications to query data in natural language and SQL, getting highly accurate answers across different data sources and types. It includes a Model Context Protocol (MCP) server that helps 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:

  1. Visit the Docker Desktop installation guide
  2. Follow the instructions to download and install MindsDB via Docker Desktop
  3. Once installed, the MindsDB server will be running and ready to use

Using Docker

For more flexibility and customization:

docker pull mindsdb/mindsdb
docker run -p 47334:47334 mindsdb/mindsdb

Detailed instructions can be found in the Docker installation guide.

Using PyPI

If you want to install MindsDB using Python's package manager:

pip install mindsdb

After installation, start the MindsDB server with:

python -m mindsdb

Connecting Your Data

MindsDB can connect to hundreds of data sources. Here's an example of connecting to a Postgres database:

-- Connect to demo postgres DB
CREATE DATABASE demo_postgres_db
WITH ENGINE = "postgres",
PARAMETERS = {
  "user": "demo_user",
  "password": "demo_password",
  "host": "samples.mindsdb.com",
  "port": "5432",
  "database": "demo",
  "schema": "demo_data"
};

Once connected, you can manipulate your data using standard SQL commands for joining, selecting, and transforming data.

Building AI Knowledge

Creating a Knowledge Base

Knowledge Bases in MindsDB are autonomous RAG systems that can process data from any supported source:

-- First create a knowledge base
CREATE KNOWLEDGE_BASE mindsdb.reviews_kb;

-- Now insert everything from the amazon reviews table into it
INSERT INTO mindsdb.reviews_kb (
  SELECT review as content FROM demo_pg_db.amazon_reviews
);

-- Check the status of your loads
SELECT * FROM information_schema.knowledge_bases;

-- Query the content of the knowledge base
SELECT * FROM mindsdb.reviews_kb;

Customizing Your Knowledge Base

You can customize various aspects of your knowledge base:

  • Select specific embedding models
  • Choose your preferred vector database
  • Adjust chunking and optimization parameters

By default, MindsDB handles these technical details automatically.

Searching Your Knowledge Base

Using SQL

Once your knowledge base is loaded, you can search for information:

-- Find reviews about Kindle
SELECT * FROM mindsdb.reviews_kb
WHERE content LIKE 'what are the best kindle reviews'
LIMIT 10;

Using Python SDK

First, install the MindsDB SDK:

pip install mindsdb_sdk

Then access your knowledge base in Python:

import mindsdb_sdk

# Connect to the MindsDB server
server = mindsdb_sdk.connect('http://127.0.0.1:47334')

# Access your knowledge base
my_kb = server.knowledge_bases.get('mindsdb.reviews_kb')

# Search for content
df = my_kb.find('what are the best kindle reviews').fetch()

Working with the MCP Server

The built-in MCP server enables your applications to connect to and query data across various sources. To use the MCP functionality:

  1. Ensure your MindsDB server is running
  2. Configure your MCP client application to connect to the MindsDB server endpoint
  3. Use the MCP protocol to send queries and receive responses

The MCP server handles the complexity of integrating different data sources and applying AI capabilities to provide unified responses to your queries.

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