atarkowska avatar

Fastmcp Sqltools

atarkowska/fastmcp-sqltools

Connects to PostgreSQL, MySQL, or SQLite databases through a single DATABASE_URL environment variable and exposes four tools: list_tables for discovery, get_table_schema for inspecting columns and constraints, execute_query for writes and DDL, and execute_safe_query for read-only selects with safety guards. Built with FastMCP and async database drivers (asyncpg, aiomysql, aiosqlite). You'd reach for this when you want Claude to query and modify databases directly without writing custom scripts. The server auto-detects database type from your connection string, so switching between PostgreSQL for production and SQLite for local testing just means changing one environment variable.

GitHub stars
1
tools
4
transport
STDIO
last updated
Jan 5, 2026

Tools

4 tools

Public tool metadata for what this MCP can expose to an agent.

list_tablesList all tables in the database

List all tables in the database

No parameter schema in public metadata yet.

get_table_schemaGet detailed schema information for a table including columns, types, constraints, and indexes

Get detailed schema information for a table including columns, types, constraints, and indexes

No parameter schema in public metadata yet.

execute_queryExecute any SQL query (INSERT, UPDATE, DELETE, DDL, etc.)

Execute any SQL query (INSERT, UPDATE, DELETE, DDL, etc.)

No parameter schema in public metadata yet.

execute_safe_queryExecute read-only SELECT queries with additional safety checks

Execute read-only SELECT queries with additional safety checks

No parameter schema in public metadata yet.

Sponsors

Readme

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

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:


View the full README on GitHub

Details

Repository
github.com/atarkowska/fastmcp-sqltools
Category
Databases
Package
fastmcp-sqltools
Transport
STDIO
Registry
MCP registry, active

Related Databases MCP servers

View all
1stucchi avatarDB MCP Serverstucchi/db-mcp-serverDatabase MCP server for MySQL, PostgreSQL, MongoDB, and SQLite with SSH tunneling support.0stars
2amansingh63 avatarDBHub Analyticsamansingh63/dbhub-analyticsMCP server for Databricks, BigQuery, PostgreSQL, MySQL, SQL Server, SQLite, MariaDB0stars
3thinair avatarDataco.thinair/dataPostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.0stars
4shyamolkonwar avatarRivtorshyamolkonwar/rivtor-cliDeploy full-stack apps (frontend, backend, Postgres, Redis) from your agent and get live URLs.0stars
5daedalus avatarMcp Psycopg2daedalus/mcp-psycopg2MCP server exposing psycopg2 PostgreSQL database adapter functionality0stars
6mironovisa avatardatamcp — Hosted Model Context Protocol for Databases, APIs, and Agent Memoryio.github.mironovisa/datamcpPostgreSQL, MySQL, OpenAPI/Swagger, and shared Agent Memory with scoped access.0stars