0:00
/
0:00

Build an MCP Server to Connect to 200+ Data Sources

A unified MCP server for all your data (100% local)

Organizational data lives everywhere—Slack, Gmail, SQL, Drive, and whatnot!

We built an MCP server that can connect to 200+ such data sources, and it is 100% local.

Our tech stack:

  • MindsDB to power our unified MCP server (31k stars on GitHub).

  • Cursor as the MCP host.

  • Docker to self-host the MCP server.

Here's the workflow:

  • User submits a query

  • Agent connects to the MindsDB MCP server to find tools

  • Agent selects an appropriate tool based on the user query and invokes it

  • Finally, it returns a contextually relevant response

We have added a video above that gives a complete walkthrough of this demo.

Now, let's dive into the code!


Docker Setup

MindsDB provides Docker images that can be run in Docker containers.

Install MindsDB locally using the Docker image by running the command in your terminal.

Start MindsDB GUI

After installing the Docker image, go to 127.0.0.1:47334 in your browser to access the MindsDB editor.

Through this interface, you can connect to over 200 data sources and run SQL queries against them.

Integrate Data Sources

Let's start building our federated query engine by connecting our data sources to MindsDB.

We use Slack, Gmail, GitHub and Hacker News as our federated data sources.

Integrate MCP Server with Cursor

After building the federated query engine, let's unify our data sources by connecting them to MindsDB's MCP server.

Go to: File → Preferences → Cursor Settings → MCP → Add new global MCP server.

In the JSON file, add the following 👇

Done! Our MindsDB MCP server is live and connected to Cursor!

The MCP server offers two tools:

  • list_databases: Lists all data sources connected to MindsDB.

  • query: Answers user queries on the federated data.

Apart from Claude and Cursor, the MindsDB MCP server also works with the new OpenAI MCP integration:

The usage of list_databases is depicted below. We asked it to list all the data sources it can access and retrieved the four data sources we connected earlier:

Below is another usage, where we asked it to list the available Slack channels.

While this is quite basic, we have shown a much more sophisticated usage in the video attached at the top.

  • We fetched info from Hacker News.

  • We generated a nicely formatted summary of the fetched details and sent that as a message to Slack.

  • We asked the MCP server to fetch the latest email from Gmail, and it did that:

  • and more.

Watch the video above for a detailed walkthrough.

You can find the code to reproduce this demo in the GitHub repo →

Thanks for reading!