mcp-server-mysql-schema
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., "@mcp-server-mysql-schema show columns of users table in myapp"
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.
mcp-server-mysql-schema
MySQL Schema MCP Server — explore tables, columns, foreign keys, indexes, and relationships through the Model Context Protocol. Works with opencode, Claude Desktop, Cursor, and any MCP-compatible AI client.
No more writing SHOW TABLES and DESCRIBE manually. Ask your AI assistant "what tables are in this database?", "show me the foreign keys of the orders table", or "find all columns named 'status'" — and get structured JSON responses.
Quick Start
# Install
npx mcp-server-mysql-schema
# Or clone
git clone git@github.com:rendi-febrian/mcp-server-mysql-schema.git
cd mcp-server-mysql-schema
npm install && npm run buildopencode Configuration
{
"mcp": {
"mysql-schema": {
"type": "local",
"command": ["node", "/path/to/mcp-server-mysql-schema/dist/index.js"],
"environment": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your-password"
},
"enabled": true
}
}
}Claude Desktop / Cursor / Other MCP Clients
{
"mcpServers": {
"mysql-schema": {
"command": "node",
"args": ["/path/to/mcp-server-mysql-schema/dist/index.js"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your-password"
}
}
}
}Related MCP server: easy-mysql-mcp
Features
Tools
Tool | Description | Example |
| List all non-system databases with charset |
|
| All tables — engine, row count, auto-increment, comments |
|
| All views in a database |
|
| Columns: type, nullable, default, key, extra, comment |
|
| FK relationships — all DB, per-table, incoming/outgoing |
|
| Indexes: name, columns, seq, unique, type, comment |
|
| Full PK/FK map across all tables |
|
| Search table and column names by keyword |
|
Resources
URI | Content |
| All tables in the database |
| Full relationship map |
| Column details |
| Index details |
| Foreign key details |
Security
100% read-only. Every query targets information_schema only. No SELECT on user tables. No INSERT, UPDATE, DELETE, or DDL. The server cannot modify any data.
Why Not Just Use MySQL MCP?
MySQL MCP | Schema MCP (this) | |
Purpose | Run arbitrary SQL | Introspect database structure |
Query target | Any table / any query |
|
Write access | Optional (configurable) | Never |
Structured tools | Single | 8 focused tools |
Resources | Table-level | Table + FK + relationship maps |
Best for | Data CRUD, ad-hoc queries | Schema discovery, ERD, migrations |
Requirements
Node.js >= 18
MySQL 5.7+ or MariaDB 10.2+
MySQL user with
SELECToninformation_schema(default)
Environment Variables
Variable | Required | Default | Description |
| No |
| MySQL host |
| No |
| MySQL port |
| No |
| MySQL user |
| No |
| MySQL password |
| No | — | Default database for resource URIs |
Architecture
src/
├── index.ts # MCP server entry point (raw Server)
├── db.ts # MySQL connection pool
├── schema.ts # information_schema queries
├── tools/
│ ├── tables.ts # schema_databases, schema_tables, schema_views
│ ├── detail.ts # schema_table_detail
│ ├── foreignKeys.ts # schema_foreign_keys
│ ├── indexes.ts # schema_indexes
│ ├── relationships.ts # schema_relationships
│ └── search.ts # schema_search
└── resources/
└── index.ts # schema:// URIsNo ORM, no migrations, no configuration files — just raw information_schema queries over mysql2.
Contributing
See CONTRIBUTING.md.
License
Available Tools
8 toolsschema_databasesA
List all non-system MySQL databases with charset and collation
Inputs: no named parameters.
schema_foreign_keysB
List foreign key relationships for a database or specific table (incoming + outgoing)
Inputs: database (required), table, direction.
schema_indexesA
List all indexes for a table with columns, uniqueness, and type
Inputs: table (required), database (required).
schema_relationshipsB
Full relationship map across all tables in a database: primary keys, foreign keys, and references
Inputs: database (required).
schema_searchB
Search across table and column names in a database
Inputs: keyword (required), database (required).
schema_table_detailB
Show columns, types, defaults, nullable, keys, and comments for a table
Inputs: table (required), database (required).
schema_tablesA
List all tables in a database with engine, row count, size estimates, and comments
Inputs: database (required).
schema_viewsB
List all views in a database
Inputs: database (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: databases, foreign keys, indexes, relationships, search, table details, tables, and views. No two tools overlap in function.
All tool names follow a consistent 'schema_noun' pattern using snake_case, making it easy to predict what each tool does.
With 8 tools, the server is well-scoped for MySQL schema exploration. Each tool covers a distinct aspect without excessive granularity.
The set covers essential schema exploration: databases, tables, columns, indexes, foreign keys, relationships, views, and search. Missing stored procedures or events, but these are not core to schema inspection.
Maintenance
Related MCP Connectors
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
The AI that understands raw data: Schema over your tables and databases, as MCP tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query MySQL databases with read-only access by default, supporting table listing, structure inspection, and SQL queries with optional write operation control.12 npmMIT
- AlicenseAqualityCmaintenanceEnables AI assistants to inspect and query a MySQL database through safe, structured tools, including schema discovery and read-only queries.957 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with MySQL databases, including listing tables, viewing schemas, and executing read-only SQL queries through natural language.7-
- AlicenseNot gradedqualityDmaintenanceEnables schema introspection and safe read-only queries on MySQL databases, supporting table/column discovery, relationship exploration, and controlled SELECT queries.17 npmMIT