# MindsDB MCP for AI Agents AI Agent Connect

> MindsDB MCP lets you manage machine learning models and predictive analytics directly through your AI client. You can execute SQL to create models, run predictions on live data, and audit your ML pipeline. It bridges the gap between your databases and AI, making it easy to query results from complex models without switching tabs or learning new APIs.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_wo8z4btUozCcWNcaSyNerjmMILAoiY0Mm4LOh9m9/ai-agent-connect
- **Tags:** machine-learning, sql-ml, predictive-analytics, model-deployment, data-integration

## Description

MindsDB lets you stop jumping between your SQL console and your Python notebooks just to see if your data actually tells you anything useful. Instead of the usual headache of moving data back and forth to run a regression, you just ask your AI agent to do it for you. This Connector connects your MindsDB instance to your agent, turning your database into a live prediction engine where you can create new models based on your Snowflake data or predict next month's revenue using a specific SQL query. It handles the heavy lifting of ML orchestration, letting you focus on the actual insights rather than the plumbing. Whether you're checking the health of your cluster or auditing the accuracy of a trained predictor, everything happens in one conversation. It makes managing your entire ML lifecycle feel like just another part of your daily data work. You'll find it's a lot easier to keep your models updated and your data pipelines clean when you can interact with them as naturally as you do with your code. It's one of the best ways to get actual results out of your data without the friction of manual model deployment. You can find this and other tools in the Vinkius catalog to build out your full data stack.

## Tools

### list_databases
See all external databases like Snowflake or Postgres connected to MindsDB. This helps you audit your data pipeline boundaries.

### execute_sql_query
Run SQL commands like CREATE MODEL or SELECT...PREDICT on your data. It lets you trigger model training and get live predictions in one step.

### list_views
See all virtual data views and SQL mappings in a specific project. Use this to find pre-built data transformations instead of writing new ones.

### list_models
View all trained AI tables and models ready for querying in a project. Use this to check which algorithms are finished training.

### get_model
Fetch a specific trained AI prediction engine to see its details. This helps you identify which models are ready for production.

### get_status
Check the current health and version of your MindsDB cluster. Use this to verify your environment is active and up to date.

## Prompt Examples

**Prompt:** 
```
Which ML models are currently available in my project?
```

**Response:** 
```
I've pulled the list of trained models for you. Here's what's ready:

| Model Name | Status | Purpose |
| :--- | :--- | :--- |
| `home_price_predictor` | Complete | Estimates real estate prices |
| `sales_forecaster` | Training | 65% complete |
| `churn_model` | Complete | Predicts customer retention |

Would you like me to run a prediction on one of the completed models?
```

**Prompt:** 
```
Run a prediction for a 2000 sqft house in the 'mindsdb' project.
```

**Response:** 
```
I've executed that prediction for you. 

**Result:** $385,000 

**Breakdown:** 
- **Square Footage:** High weight (0.82) 
- **Location Trend:** Moderate weight (0.15) 

Would you like to see the prediction for a different size?
```

**Prompt:** 
```
Check the health of my MindsDB cluster.
```

**Response:** 
```
The cluster is looking good. 

- **Status:** Active 
- **Version:** 1.2.4 
- **Uptime:** 14 days 

Everything seems to be running smoothly. Is there anything else you need to check?
```

## Capabilities

### Run SQL to create and train new ML models
Execute commands like CREATE MODEL to start training jobs directly from your agent.

### Fetch live predictions from your trained models
Query your models to get real-time results on specific data points.

### Check the status of your ML training jobs
See which models are finished, in progress, or ready for production.

### List all connected data sources like Snowflake or Postgres
View all the external databases currently linked to your MindsDB instance.

### View virtual data views for complex transformations
Browse existing SQL mappings that act as proxy tables for your data.

### Get real-time health and version stats for your cluster
Verify that your MindsDB environment is active and running the correct version.

## Use Cases

### Monitoring training progress
A Data Scientist needs to know if a model is done training. They ask the agent to list models and check the progress of the 'sales_forecaster'.

### Adding price predictors to apps
A developer wants to add a price predictor to a web app. They use the agent to run a SELECT...PREDICT query and get the results back as JSON.

### Generating forward-looking reports
A BI analyst needs a report on next week's stock. They ask the agent to combine current inventory data with a prediction from a trained model.

### Checking cluster health
An admin needs to check if the database is down. They ask the agent to get the cluster status to see the version and health.

## Benefits

- Run ML commands like CREATE MODEL to skip manual model deployment steps.
- Get instant predictions on your data without leaving your chat interface.
- Monitor your ML lifecycle and training progress to stay on top of model accuracy.
- Audit your data pipeline boundaries by listing all connected sources.
- Verify your environment is healthy and up to date for quick cluster diagnostics.
- Access complex data transformations easily by browsing your virtual views.

## How It Works

The bottom line is you get a direct line between your AI agent and your full machine learning pipeline.

1. Subscribe to the MindsDB MCP in your AI client.
2. Enter your MindsDB API URL and API Key.
3. Start asking your agent to run SQL queries or manage ML models.

## Frequently Asked Questions

**Can I use the MindsDB MCP to train new models?**
Yes, you can use the Connector to trigger 'CREATE MODEL' commands via SQL. This lets your agent start the training process for you based on the data sources you've already connected.

**Does the MindsDB MCP support Snowflake and Postgres?**
Yes, it allows you to see and interact with any external databases you've connected to MindsDB, including Snowflake, PostgreSQL, and ClickHouse.

**How do I run a prediction using this Connector?**
You can simply ask your agent to run a SELECT statement that includes a PREDICT clause. It will query your trained models and return the results directly in the chat.

**Can I see my model training progress?**
Yes, you can ask the agent to list your models. It will show you which ones are complete and provide status updates on those currently in the training phase.

**Is the MindsDB MCP good for BI reporting?**
It's great for BI because it lets you combine historical data and future predictions in a single query, making it much faster to generate forward-looking reports.

**How do I keep my queries from crashing the agent?**
When running large queries, just ask your agent to include a LIMIT clause. This ensures the results stay within the context limits while still giving you the data you need.

**Can I train a machine learning model using SQL through my agent?**
Yes. Use the `execute_sql_query` tool with the 'CREATE MODEL' statement. Your agent will dispatch the command to MindsDB, which will automatically handle the data processing and training of your predictor asynchronously.

**How do I connect an external database like PostgreSQL to MindsDB using the agent?**
The `execute_sql_query` tool supports the 'CREATE DATABASE' syntax. You can command your agent to link a new data source by providing the connection parameters, allowing MindsDB to query your existing data natively.

**Can my agent retrieve the status of an ongoing model training?**
Absolutely. Use the `get_model` tool by providing the model name and project. Your agent will report the current training state, accuracy metrics, and any errors encountered during the AI generation process.