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.
This is the fastest and recommended way to get started:
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.
If you want to install MindsDB using Python's package manager:
pip install mindsdb
After installation, start the MindsDB server with:
python -m mindsdb
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.
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;
You can customize various aspects of your knowledge base:
By default, MindsDB handles these technical details automatically.
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;
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()
The built-in MCP server enables your applications to connect to and query data across various sources. To use the MCP functionality:
The MCP server handles the complexity of integrating different data sources and applying AI capabilities to provide unified responses to your queries.
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.
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"
]
}
}
}
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.
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.