fastmcp-sqltools
Enables SQL database access to MySQL, including listing tables, retrieving schema, and executing queries.
Enables SQL database access to PostgreSQL, including listing tables, retrieving schema, and executing queries.
Enables SQL database access to SQLite, including listing tables, retrieving schema, and executing queries.
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., "@fastmcp-sqltools list all tables"
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.
FastMCP SQL Tools
mcp-name: io.github.atarkowska/fastmcp-sqltools
A Model Context Protocol (MCP) server built with FastMCP that provides SQL database access with support for PostgreSQL, MySQL, and SQLite.
Features
list_tables: List all tables in the database
get_table_schema: Get detailed schema information for a table including columns, types, constraints, and indexes
execute_query: Execute any SQL query (INSERT, UPDATE, DELETE, DDL, etc.)
execute_safe_query: Execute read-only SELECT queries with additional safety checks
Related MCP server: mcp-sqlite3
Supported Databases
PostgreSQL: Full support via asyncpg
MySQL: Full support via aiomysql
SQLite: Full support via aiosqlite
The server automatically detects the database type from the DATABASE_URL environment variable.
Configuration
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"sql-mcp-tools": {
"command": "uvx",
"args": [
"fastmcp-sqltools"
],
"env": {
"DATABASE_URL": "<your-database-url>"
}
}
}
}Database URL Format
The DATABASE_URL should be in one of the following formats:
PostgreSQL:
postgresql://user:password@host:port/databaseorpostgres://user:password@host:port/databaseMySQL:
mysql://user:password@host:port/databaseSQLite:
sqlite:///path/to/database.db(use three slashes for absolute path)
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.
Available Tools
4 toolsexecute_queryB
Execute a SQL query and return results. WARNING: This can execute any SQL including DDL and DML statements.
Inputs: query (required), params. Returns: result
execute_safe_queryA
Execute a read-only SQL query (SELECT only). This is safer than execute_query as it prevents data modification.
Inputs: query (required), params. Returns: result
get_table_schemaB
Get the schema (column definitions) for a specific table.
Inputs: table_name (required), schema. Returns: result
list_tablesB
List all tables in the specified schema.
Inputs: schema. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: execute_query for any SQL, execute_safe_query for read-only, get_table_schema for column definitions, and list_tables for table listing. No ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case, e.g., execute_query, list_tables. No deviations.
Four tools is appropriate for a SQL tool server covering query execution, safe querying, schema retrieval, and table listing. Well-scoped.
Core operations are present, but missing a tool to list schemas (list_tables requires a schema parameter), which could cause agent failures. DDL is covered via execute_query.
Related MCP Connectors
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides safe, configurable SQL database access via MCP tools, enabling schema introspection, predefined queries, and structured updates with multi-backend support.2MIT
- AlicenseNot gradedqualityDmaintenanceExposes sqlite3 database functionality as MCP tools, enabling SQL query execution, schema management, and CRUD operations.48 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive SQLite database interaction through MCP, enabling CRUD operations, custom SQL queries, and database exploration.660 npm130MIT
- AlicenseNot gradedqualityDmaintenanceEnables database interaction (MySQL, PostgreSQL, SQL Server) via MCP, supporting SQL queries and command execution.29 npmMIT