Turn MySQL Into a REST API — and an MCP Server for Your AI Agent
Point Dataloom at your MySQL database, choose the tables worth exposing, and publish a documented REST API that your applications and your AI assistant can both use.
Free plan includes a hosted MCP server — no card required.
MySQL runs an enormous amount of the web, which means it also holds an enormous amount of data that other systems keep asking for. The usual answer is a small internal API — a few controllers, some pagination, an API key check, a README nobody updates. It works, and then it becomes something you maintain instead of something you use.
Dataloom gives you the same result without the code. Connect with your host, port, database, username and password, select the tables or views you want to publish, and Dataloom generates REST endpoints from your live schema, complete with interactive documentation and an OpenAPI description.
Nothing moves. Your MySQL server stays where it is, and Dataloom queries it directly when requests arrive. If you connect with a restricted user, the API is restricted in exactly the same way.
Connecting your MySQL database
Create a data source using your host, port (3306 unless you have changed it), database name and credentials, turning on SSL if your provider expects it. Dataloom verifies the connection before it saves anything, so misconfigured firewall rules surface right away instead of halfway through building an endpoint.
Dataloom then reads the schema from information_schema — tables, columns, data types, primary keys and foreign key relationships — and presents it for you to choose from. Selecting a table does not expose the whole database; only what you publish is reachable.
This works the same way with MariaDB and with managed MySQL services such as Amazon RDS, Azure Database for MySQL and PlanetScale, as long as Dataloom can reach the host and the credentials are valid.
What you get with MySQL
- Tables and views become endpoints
- Works with MySQL and MariaDB, self-hosted or managed
- SSL/TLS supported for managed providers
- Filtering, sorting and pagination built in
- Custom SQL endpoints with named :parameter binding (Starter and above)
- Backtick-quoted identifiers, so reserved words like `order` are safe
An example endpoint
Find in-stock products in a category, cheapest first.
GET /shop-api/products
?filter={"CategoryId":7,"StockOnHand":{"gt":0}}
&sort=Price&order=asc
&page=1&pageSize=20
X-API-Key: your_api_key{
"data": [
{ "id": 311, "Name": "Nano Filter 200", "Price": 249.00,
"CategoryId": 7, "StockOnHand": 34 },
{ "id": 287, "Name": "Nano Filter 400", "Price": 389.00,
"CategoryId": 7, "StockOnHand": 12 }
],
"meta": { "page": 1, "pageSize": 20, "totalCount": 41,
"totalPages": 3, "hasNextPage": true }
}Filtering, sorting and pagination work the same way on every endpoint, whatever the source. See the no-code API builder for how endpoints are put together.
Connect Claude to MySQL
Publishing an endpoint does two things at once: it creates a REST route, and it adds a tool to your workspace’s hosted MCP server. Your AI assistant picks the new tool up within about a minute, without you reconnecting anything or editing a config file.
In practice that means you can point Claude, ChatGPT or Cursor at your MySQL data and ask for what you want in plain language. The tool description carries the real column names from your schema, so filters and sorts are built against columns that genuinely exist rather than plausible-sounding guesses.
Access is bounded by design. The assistant sees only published endpoints, authenticates over OAuth 2.1 instead of a shared key, and can be revoked individually from your Dataloom workspace without disturbing your other integrations.
// mcp-config.json
{
"mcpServers": {
"dataloom": {
"url": "https://mcp.dataloom.cloud/w/your-workspace",
"transport": "http"
}
}
}Read more about the hosted MCP server, or follow the step-by-step setup guide.
MySQL questions, answered
Does this work with MariaDB?
Yes. MariaDB speaks the MySQL protocol and Dataloom connects to it the same way, reading schema information from information_schema.
What about tables named with reserved words?
They work. Dataloom quotes every identifier it puts into a query with backticks, so tables or columns called order, group or key behave normally.
Can I expose only some columns of a table?
Yes. When you build an endpoint you choose which columns it returns, and only those are ever included in a response or accepted in a filter.
Do I need to open my database to the public internet?
Dataloom needs network access to the host, so it must be reachable from Dataloom’s servers. Restrict it with provider firewall rules and a dedicated least-privilege user rather than opening it broadly.