# MindsDB (AI Database & Predictors) MCP

> MindsDB (AI Database & Predictors) connects your AI client directly to a database that runs machine learning predictions via SQL. You can execute complex queries, train models on demand, and audit data sources—all through natural language conversation.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** machine-learning, sql-ml, predictive-analytics, model-deployment, data-integration

## Description

This MCP lets you treat your entire database and its built-in AI models like one giant spreadsheet. Instead of jumping between an ML platform and a traditional SQL client, you just talk to your agent. You use standard SQL commands, but they suddenly gain the power to run predictions—for example, predicting housing prices or customer churn right inside a `SELECT` statement. Need to know what data sources are connected? Just ask, and it will list everything from Snowflake tables to PostgreSQL databases. This full control over both your raw data structure and the algorithms running on it makes complex analysis straightforward. If you're building out an advanced AI pipeline, Vinkius hosts this MCP so that any compatible client can access these powerful features immediately.

## Tools

### list_databases
Lists all external databases connected through MindsDB to your instance.

### list_models
Retrieves a list of trained AI tables (models) available within a specific project.

### get_model
Fetches detailed information about an explicitly trained AI prediction engine.

### execute_sql_query
Runs arbitrary SQL statements, allowing you to create models or run predictions within the MindsDB context.

### list_views
Lists virtual data views and structural mappings used for complex data transformations.

### get_status
Returns active cluster diagnostic information, confirming the current version and operational health of MindsDB.

## Prompt Examples

**Prompt:** 
```
List all ML models in the 'mindsdb' project
```

**Response:** 
```
I've retrieved your AI models from the 'mindsdb' project. Highlights include 'home_price_predictor' (Status: Complete), 'sales_forecaster' (Status: Training, 45%), and 'customer_churn_model'. Which one would you like to check the accuracy for?
```

**Prompt:** 
```
Execute SQL: SELECT price, price_explain FROM mindsdb.home_price_predictor WHERE sqft = 2500
```

**Response:** 
```
Executing prediction query… The predicted price for a 2500 sqft home is $450,000. Explanation: The model heavily weighted the square footage and recent neighborhood sales trends. Would you like to run this prediction for a different set of features?
```

**Prompt:** 
```
Show me all connected databases in my MindsDB instance
```

**Response:** 
```
I've identified 3 connected data sources: 'production_pg' (PostgreSQL), 'snowflake_warehouse' (Snowflake), and 'marketing_sheets' (Google Sheets). I can list the available tables for any of these sources if you'd like.
```

## Capabilities

### Audit connected data sources
Lists all external databases linked to MindsDB, letting you verify your entire data pipeline boundary.

### Run predictive SQL queries
Executes custom SQL that incorporates machine learning functions, retrieving predicted values alongside historical data.

### Manage ML models and algorithms
Checks which trained AI tables are available for querying predictions or retrieves details on a specific prediction engine.

### Create new predictive models
Runs commands to train brand-new machine learning models directly from your agent's SQL prompt.

### Check system health and status
Retrieves diagnostic information about the MindsDB cluster, confirming its operational version and availability.

## Use Cases

### Forecasting next quarter's sales
A BI Analyst needs to know if their current inventory levels can support a 15% growth projection. They ask the agent to run SQL: `SELECT * FROM mindsdb.sales_forecaster WHERE region = 'West'`. The tool runs the prediction and returns not just historical sales, but the predicted revenue for next quarter.

### Troubleshooting data flow
A Software Developer finds that a new feature is failing due to an unknown dependency. They use `list_databases` first to see every connected source and then run `get_status` to confirm the cluster's version, quickly isolating if the issue is internal or external.

### Training on demand
A Data Scientist needs a new predictor for customer churn. Instead of running through a separate ML CLI tool, they use `execute_sql_query` to run a `CREATE MODEL ... PREDICT` command directly from the agent's chat prompt.

### Auditing data integrity
An engineer needs to verify that their application is only reading from approved sources. They use `list_views` to see all proxy tables and then run `list_models` to ensure the correct, final version of the prediction engine is active.

## Benefits

- Predict outcomes directly in your workflow. Instead of running a prediction on an external dashboard, you use `execute_sql_query` to wrap the model call right into your standard SELECT statement, fetching predicted data instantly.
- Audit everything at once. Use `list_databases` to verify every single source feeding into your system—whether it's Snowflake or PostgreSQL—without manual console work.
- Monitor ML status hands-free. Check which algorithms are ready for use by calling `list_models`, so you don't have to guess if a model is still training or fully deployed.
- Stay connected to the core system. Run `get_status` anytime to confirm your MindsDB environment is healthy and running the correct version, eliminating guesswork about connectivity.
- Build complex data pipelines easily. Use `list_views` to see all the virtual mappings that simplify messy source data into clean tables for analysis.

## How It Works

The bottom line is: you use natural conversation to perform advanced data science tasks that used to require multiple dedicated tools.

1. First, subscribe to this MCP and enter your MindsDB API URL and required credentials.
2. Next, tell your AI client what data you need. You can ask it to list connected databases or run a prediction query.
3. Finally, the agent executes the SQL against the MindsDB engine, returning both structured results and the machine-generated predictions.

## Frequently Asked Questions

**How do I check if my AI models are ready to use with MindsDB (AI Database & Predictors) MCP?**
You use the `list_models` tool. This shows you exactly which trained algorithms are available in your current project and whether they're still training or fully complete.

**Can I connect MindsDB (AI Database & Predictors) MCP to multiple types of databases?**
Yes, this MCP can list connections for various sources. You use the `list_databases` tool to see if your client supports everything from PostgreSQL to Snowflake.

**What is the difference between running an SQL query and using MindsDB (AI Database & Predictors) MCP?**
A standard SQL query reads existing data. Using this MCP lets you run predictions, meaning your query executes a calculation based on trained ML models, generating new, predicted data points.

**Is the MindsDB (AI Database & Predictors) MCP secure?**
The MCP manages connections to external sources like PostgreSQL and Snowflake. All actions are routed through your agent, allowing you to audit which data views are being accessed using `list_views`.

**Do I need to run a separate command line tool to use MindsDB (AI Database & Predictors) MCP?**
No. You interact with this entire system conversationally through your AI client, using the natural language interface that invokes the necessary tools.