MindsDB MySQL MCP Server
Integrates with Google embedding models to facilitate the creation and semantic searching of MindsDB knowledge bases.
Allows connecting external MongoDB instances as data sources within MindsDB for data integration and querying.
Uses the MySQL protocol to interface with MindsDB and enables connecting external MySQL databases as data sources for SQL query execution.
Integrates with Ollama embedding models to facilitate the creation and semantic searching of MindsDB knowledge bases.
Integrates with OpenAI embedding models to facilitate the creation and semantic searching of MindsDB knowledge bases.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MindsDB MySQL MCP Server search the documentation knowledge base for 'how to configure authentication'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MindsDB MySQL MCP Server
MCP server for MindsDB that connects via MySQL protocol (port 47335), providing reliable tools for Claude Code and Desktop.
Why MySQL over SSE/HTTP?
MySQL protocol is stable and well-tested
No async event loop issues (the "this event loop is already running" errors)
Better error messages and debugging
Works reliably with knowledge base queries
Related MCP server: MySql MCP Server
Installation
cd mcp/mindsdb-mysql
npm install
npm run buildConfiguration
Environment Variables
Variable | Default | Description |
|
| MindsDB server host |
|
| MindsDB MySQL port |
|
| Username (use your MindsDB Cloud email for cloud instances) |
| (empty) | Password (required for MindsDB Cloud) |
Claude Code (~/.claude.json)
{
"mcpServers": {
"mindsdb": {
"type": "stdio",
"command": "node",
"args": [
"/path/to/mindsdb-mysql/dist/index.js"
],
"env": {
"MINDSDB_HOST": "localhost",
"MINDSDB_PORT": "47335",
"MINDSDB_USER": "mindsdb",
"MINDSDB_PASSWORD": ""
}
}
}
}For MindsDB Cloud, use your email as MINDSDB_USER and your password for MINDSDB_PASSWORD.
Claude Desktop (claude_desktop_config.json)
Same configuration, add to the mcpServers object.
Available Tools (11)
1. query - Execute SQL
Execute any MindsDB SQL query. Use this for custom queries not covered by other tools.
query(sql: string, database?: string): QueryResult2. list_databases - List Data Sources
List all databases/data sources in MindsDB.
list_databases(): string[]3. list_knowledge_bases - List KBs
List all knowledge bases in MindsDB.
list_knowledge_bases(): KnowledgeBase[]4. describe - Describe Any Object
Describe a model, table, or knowledge base. Returns column information.
describe(name: string, database?: string): Description5. search_kb - Search Knowledge Base
Search a knowledge base using hybrid semantic + keyword search.
search_kb(
kb_name: string,
question: string,
limit?: number, // default: 10
alpha?: number, // default: 0.5 (0=keyword, 1=semantic)
min_relevance?: number, // default: 0
metadata_filter?: Record<string, string>
): SearchResult[]6. insert_kb - Insert Data into Knowledge Base
Insert data into a knowledge base from a source query.
insert_kb(
kb_name: string,
source_query: string, // e.g., "SELECT id, content FROM mydb.docs"
batch_size?: number, // default: 1000
threads?: number, // default: 1
skip_existing?: boolean // default: false
): { rows_inserted: number }7. create_kb - Create Knowledge Base
Create a new knowledge base with embedding model configuration.
create_kb(
name: string,
embedding_model: {
provider: string, // openai, azure, google, ollama
model_name: string,
api_key?: string
},
content_columns: string[],
metadata_columns?: string[],
id_column?: string,
reranking_model?: {...},
storage?: string // default: chromadb
): { kb_name: string }8. list_jobs - List Scheduled Jobs
List all scheduled jobs in MindsDB.
list_jobs(): Job[]9. create_job - Schedule Recurring Query
Create a scheduled job to run a query at regular intervals.
create_job(
name: string,
query: string, // SQL to execute
every: string, // e.g., "1 hour", "1 day"
start?: string, // ISO datetime
end?: string // ISO datetime
): { job_name: string }10. list_tables - List Tables
List all tables in a specific database.
list_tables(database: string): string[]11. connect_database - Connect External Data Source
Connect an external database as a data source in MindsDB.
connect_database(
name: string,
engine: string, // postgres, mysql, mongodb, etc.
parameters: {
host: string,
port: number,
database: string,
user: string,
password: string
}
): { database_name: string }Testing
With MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsOr with a remote MindsDB instance:
MINDSDB_HOST=your-mindsdb-host MINDSDB_PORT=47335 \
npx @modelcontextprotocol/inspector node dist/index.jsManual verification
After configuring Claude Code, restart and verify:
# In Claude Code, these tools should be available:
mcp__mindsdb__list_databases
mcp__mindsdb__list_knowledge_bases
mcp__mindsdb__search_kb
mcp__mindsdb__query
# ... etc.MindsDB SQL Reference
Knowledge Base Query
-- Semantic search
SELECT * FROM my_kb WHERE content = 'search phrase' LIMIT 10;
-- With relevance filter
SELECT * FROM my_kb WHERE content = 'query' AND relevance >= 0.5;
-- Hybrid search (keyword + semantic)
SELECT * FROM my_kb WHERE content = 'query' AND hybrid_search_alpha = 0.8;
-- Metadata filter
SELECT * FROM my_kb WHERE content = 'query' AND metadata_column = 'value';Output Columns
chunk_id:<id>:<chunk_number>of<total>:<start_char>to<end_char>chunk_content: The text contentrelevance: 0-1 score (higher = better match)distance: Vector distance (lower = closer)
Available Tools
11 toolsconnect_databaseC
Connect an external database as a data source in MindsDB.
Inputs: name (required), engine (required), parameters (required).
create_jobC
Create a scheduled job to run a query at regular intervals.
Inputs: name (required), query (required), every (required), start, +1 more.
create_kbC
Create a new knowledge base with embedding model configuration.
Inputs: name (required), embedding_model (required), content_columns (required), metadata_columns, +3 more.
describeC
Describe a model, table, or knowledge base. Returns column information and structure.
Inputs: name (required), database.
insert_kbC
Insert data into a knowledge base from a source query. Supports batch processing.
Inputs: kb_name (required), source_query (required), batch_size, threads, +1 more.
list_databasesB
List all databases/data sources in MindsDB.
Inputs: no named parameters.
list_jobsB
List all scheduled jobs in MindsDB.
Inputs: no named parameters.
list_knowledge_basesB
List all knowledge bases in MindsDB.
Inputs: no named parameters.
list_tablesC
List all tables in a specific database.
Inputs: database (required).
queryB
Execute any MindsDB SQL query. Use this for custom queries not covered by other tools.
Inputs: sql (required), database.
search_kbA
Search a knowledge base using hybrid semantic + keyword search. Returns relevant chunks with relevance scores.
Inputs: kb_name (required), question (required), limit, alpha, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools have distinct purposes, such as connect_database for data source connections and search_kb for hybrid searches. However, the 'describe' tool is somewhat ambiguous as it can describe models, tables, or knowledge bases, potentially overlapping with other tools like list_tables or list_knowledge_bases in providing structural information, which could cause minor confusion.
All tool names follow a consistent verb_noun pattern using snake_case, such as connect_database, create_job, and list_tables. This uniformity makes the tool set predictable and easy to understand, with no deviations in naming conventions across the 11 tools.
With 11 tools, the server is well-scoped for managing MindsDB's features like databases, jobs, knowledge bases, and queries. Each tool serves a clear purpose, such as list_databases for listing sources and query for custom SQL, making the count appropriate without being overwhelming or insufficient.
The tool set covers key MindsDB operations, including data source management (connect_database, list_databases), knowledge base handling (create_kb, insert_kb, search_kb), and job scheduling (create_job, list_jobs). A minor gap is the lack of update or delete tools for jobs or knowledge bases, but agents can likely work around this using the query tool for custom modifications.
Maintenance
Related MCP Connectors
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Hosted MySQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
PostgreSQL, MySQL, OpenAPI/Swagger, and shared Agent Memory with scoped access.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI models to perform MySQL database operations through a standardized interface, supporting secure connections, query execution, and comprehensive schema management.782 npm33MIT
- AlicenseAqualityNot gradedmaintenanceConnect and interact with MySQL databases seamlessly. Execute SQL queries, manage database connections, and retrieve data directly through AI assistants. Enhance your AI capabilities with structured access to your MySQL data.911 npm18-
- AlicenseAqualityCmaintenanceEnables LLMs to interact with MySQL databases through standardized protocol, supporting database management, table operations, data queries, and modifications with configurable permission controls.1569 npm1MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants like Claude Desktop directly to MySQL databases, enabling natural language interaction for schema inspection, data querying, CRUD operations, and database administration tasks.8 npmMIT