MindsDB provides an MCP (Model Context Protocol) server that enables connecting, unifying, and responding to questions over large-scale federated data sources including databases, data warehouses, and SaaS applications. It allows both humans and AI applications to get accurate answers across diverse data sources.
This is the fastest and recommended way to get started with MindsDB:
Visit the MindsDB Docker Desktop installation guide: Docker Desktop Setup
Follow the instructions to install and configure MindsDB through Docker Desktop
For more flexibility and customization options:
Visit the MindsDB Docker installation guide: Docker Setup
Follow the step-by-step instructions to deploy MindsDB using Docker commands
MindsDB can connect to hundreds of enterprise data sources:
-- Example of connecting 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"
};
Visit the data integrations documentation for specific connection details for each supported data source.
MindsDB offers tools to prepare and unify data before generating responses:
-- Example of creating a knowledge base
CREATE KNOWLEDGE BASE my_docs
FROM files
(PATH = 's3://my-bucket/documents/*.pdf');
-- Example of creating a unified view across different data sources
CREATE VIEW customer_orders AS
SELECT c.customer_id, c.name, o.order_id, o.amount
FROM mysql_db.customers AS c
JOIN postgres_db.orders AS o
ON c.customer_id = o.customer_id;
MindsDB provides mechanisms to get answers from your data:
-- Example of creating an agent
CREATE AGENT sales_assistant
USING
KNOWLEDGE_BASE = 'sales_docs',
MODEL = 'gpt-4',
PROMPT_TEMPLATE = 'You are a sales assistant. Answer questions about our products based on the following context: {{context}}. Question: {{question}}';
The MCP (Model Context Protocol) server is built into MindsDB, allowing applications to connect and get responses from your data.
Connect to the MCP endpoint (typically http://localhost:47334/api/mcp/v1)
Example request to ask a question:
{
"message": "What were our sales in Q1 2023?",
"context": {
"data_sources": ["sales_database", "revenue_reports"]
}
}
You can check the status of your MindsDB server by accessing:
http://localhost:47334/api/status
View connected databases:
SHOW DATABASES;
View available models:
SHOW MODELS;
View running jobs:
SHOW JOBS;
You can automate data synchronization and transformations using jobs:
-- Example of creating a job to refresh a view daily
CREATE JOB refresh_customer_data
BEGIN
REFRESH VIEW customer_data;
END
START '2023-01-01 00:00:00'
END '2024-01-01 00:00:00'
EVERY 1 DAY;
For more detailed information about using MindsDB's MCP server, visit the MCP documentation.
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.
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 > 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"
]
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"mindsdb": {
"command": "npx",
"args": [
"-y",
"mindsdb"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect