SQL Agent MCP Server
An MCP (Model Context Protocol) server that supports both MySQL and PostgreSQL.
It allows AI assistants (such as Claude) to connect directly to databases, execute SQL queries, and retrieve schema information.
Features
- MySQL & PostgreSQL support — Manage multiple database engines through a single server
- SSH tunnel connections — Secure connections to remote databases with both password and private key authentication
- Rich toolset — SQL query execution, table listing, schema retrieval, plus MySQL-specific admin commands (SHOW STATUS, SHOW PROCESSLIST, ANALYZE TABLE, etc.)
- YAML configuration — Easy multi-server setup via
config.yaml
- Lazy connections — SQLAgentManager creates database connections only when needed
Available Tools
sql_query — Execute SQL queries
get_server_list — List registered servers
get_table_list — List tables
get_table_schema — Get table schema information
- MySQL admin tools (status, variables, process list, index info, table analyze/optimize/check/repair)
Repository
https://github.com/ytyng/sql-agent-mcp-server