This project builds a unified MCP server to query and chat with all your data sources using natural language through a unified interface powered by MindsDB and Cursor IDE.
MindsDB's federated query engine can:
- Understand complex questions in the context of organizations' data
- Retrieve knowledge across structured and unstructured data platforms
- Deliver actionable insights by translating retrieved data into predictions and recommendations
- Provide transparency into its thinking process with detailed reasoning logs
- Ensure data privacy by operating within secure, private environments
- Overview
- Features
- How It Works
- Installation
- Data Sources Integration
- MCP Server Integration
- Resources
- Contribute
The Unified MCP Server is a powerful solution that enables seamless federated queries across multiple data sources through natural language. By combining MindsDB's federated query capabilities with Cursor IDE's interface, users can interact with their data using simple conversational queries in one place.
- 🔍 Query multiple data sources with a single prompt
- 🧠 Context-aware AI answers tailored to your connected data
- 💬 Real-time chat interface using Cursor IDE
- 🔧 Modular design to easily add more data sources
- 🐳 Easy Docker-based deployment
- User submits a query to Cursor Agent.
- The client sends user query to the MCP server.
- The MCP server sends the query to the federated query engine.
- The federated query engine computes and returns the results to the MCP server.
- The MCP server returns the results to the client via the host (Cursor).
- The AI Agent synthesizes a response based on the retrieved information/results.
- User gets back the generated response.
Before installation, ensure you have the following installed and running:
- Docker
- Cursor IDE
Run this command to create a Docker container with MindsDB:
docker run --name mindsdb_container -e MINDSDB_APIS="http,mcp" \
-p 47334:47334 -p 47337:47337 mindsdb/mindsdbNow you can access the MindsDB editor by going to 127.0.0.1:47334 in your browser.
Start the Docker container you created above:
docker start mindsdb_containerStart an interactive shell in the container:
docker exec -it mindsdb_container shIn the shell, run the following commands to install dependencies for Gmail, Slack and GitHub handlers:
pip install .[gmail]
pip install .[slack]
pip install .[github]Exit the interactive shell:
exitRestart the container:
docker restart mindsdb_container-
Go to https://api.slack.com/apps and sign in with your Slack account.
-
Create a new app
From scratch. -
Go to
Basic InformationunderSettings.-
Under
App-Level Tokens, click onGenerate Token and Scopes. -
Name the token
socketand add theconnections:writescope. -
Copy and save the
xapp-...token - you'll need it to publish the chatbot.
-
-
Go to
Socket ModeunderSettingsand toggle the button toEnable Socket Mode. -
Go to
OAuth & PermissionsunderFeatures.-
Add the following Bot Token Scopes:
app_mentions:readchannels:historychannels:readchat:writegroups:historygroups:read(optional)im:historyim:readim:writempim:read(optional)users.profile:readusers:read(optional)
-
In the
OAuth Tokens for Your Workspacesection, click onInstall to Workspaceand thenAllow. -
Copy and save the
xoxb-...token - you'll need it to publish the chatbot.
-
-
Go to
App HomeunderFeaturesand click on the checkbox toAllow users to send Slash commands and messages from the messages tab. -
Go to
Event SubscriptionsunderFeatures.-
Toggle the button to
Enable Events. -
Under
Subscribe to bot events, click onAdd Bot User Eventand addapp_mentionandmessage.im. -
Click on
Save Changes.
-
-
You can now connect your app to the Slack channel:
-
Go to the channel where you want to use the bot.
-
Right-click on the channel and select
View Channel Details. -
Select
Integrations. -
Click on
Add an App.
-
After these steps are done, you can use tokens generated from points 3 and 5 to initialize the Slack handler in MindsDB.
To connect your data sources with MindsDB, go to the MindsDB editor running locally at 127.0.0.1:47334 and run the following command to integrate Slack:
CREATE DATABASE mindsdb_slack
WITH ENGINE = 'slack',
PARAMETERS = {
"token": "xoxb-...",
"app_token": "xapp-..."
};-
Create a Google Cloud Platform (GCP) Project:
-
Go to the GCP Console.
-
Create a new project.
-
Give your new project a name.
-
Click
Createto create the new project.
-
-
Enable the Gmail API:
-
In the GCP Console, select your project.
-
Navigate to
APIs & Services>Library. -
In the search bar, search for
Gmail. -
Click on
Gmail API, then clickEnable.
-
-
Create credentials for the Gmail API:
-
Navigate to
APIs & Services>Credentials. -
Click on the
Create Credentialsbutton and chooseOAuth client ID. -
If you haven't configured the OAuth consent screen before, you'll be prompted to do so now. Make sure to choose
ExternalforUser Type, and select the necessary scopes. Make sure to save the changes. -
Now, create the OAuth client ID. Choose
Web applicationfor theApplication Typeand give it a name. -
Add the following MindsDB URL to
Authorized redirect URIs:- For local installation, add http://localhost/verify-auth
- For Cloud, add http://cloud.mindsdb.com/verify-auth.
-
Click
Create.
-
-
Download the JSON file:
- After creating your credentials, click the download button (an icon of an arrow pointing down) on the right side of your client ID. This will download a JSON file, so you will use the location to it in the
credentials_fileparam.
- After creating your credentials, click the download button (an icon of an arrow pointing down) on the right side of your client ID. This will download a JSON file, so you will use the location to it in the
-
Add user authentication:
-
Navigate to
APIs & Services>OAuth consent screen>Audience. -
Under
Test usersadd your Google account and save.
-
Go to the MindsDB editor running locally at 127.0.0.1:47334 and run the following command to integrate Gmail:
CREATE DATABASE mindsdb_gmail
WITH ENGINE = 'gmail',
PARAMETERS = {
"credentials_file": "path/to/credentials.json",
"scopes": ['https://.../gmail.compose', 'https://.../gmail.readonly']
};When prompted, sign in with the Google account you added to the Test users in your app and you are good to go.
-
In your GitHub profile go to
Settings. -
In the left sidebar, click
<> Developer settings. -
In the left sidebar, under
Personal access tokens, clickFine-grained tokens. -
Click
Generate new token. -
Under
Token name, enter a name for the token. -
Click
Generate token.
Go to the MindsDB editor running locally at 127.0.0.1:47334 and run the following command to integrate GitHub:
CREATE DATABASE mindsdb_github
WITH ENGINE = 'github',
PARAMETERS = {
"repository": "username/repo",
"api_key": <YOUR_PERSONAL_ACCESS_TOKEN>
};No authentication is required for Hacker News.
Go to the MindsDB editor running locally at 127.0.0.1:47334 and run the following command to integrate Hacker News:
CREATE DATABASE mindsdb_hackernews
WITH ENGINE = 'hackernews';Follow these steps to integrate MindsDB MCP server with Cursor:
- Open Cursor and go to:
File→Preferences→Cursor Settings→MCP→Add new global MCP server
- To the
mcp.jsonfile add:
{
"mcpServers": {
"mindsdb": {
"url": "http://127.0.0.1:47337/sse"
}
}
}- Ensure that MindsDB is listed as an MCP server and toggle the button to connect server to host.
After completing all the above steps now we are ready to chat with our data through our unified MindsDB MCP server.
Open the Cursor chat window and select the Agent mode from the dropdown.
Ask questions over your data.
{chat screenshot images}
Get a FREE Data Science eBook 📖 with 150+ essential lessons in Data Science when you subscribe to our newsletter! Stay in the loop with the latest tutorials, insights, and exclusive resources. Subscribe now!
Contributions are welcome! Please fork the repository and submit a pull request with your improvements.




