FastMCP SQL Tools

Serves SQL database access via MCP for PostgreSQL, MySQL, and SQLite, with table listing, schema details, and query execution.
  • typescript

1

GitHub Stars

typescript

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "atarkowska-fastmcp-sqltools": {
      "command": "uvx",
      "args": [
        "fastmcp-sqltools"
      ],
      "env": {
        "DATABASE_URL": "<your-database-url>"
      }
    }
  }
}

FastMCP SQL Tools is an MCP server that provides SQL database access via the Model Context Protocol. It supports PostgreSQL, MySQL, and SQLite, allowing you to list tables, inspect table schemas, execute arbitrary SQL queries, and safely run read-only queries through a dedicated MCP interface.

How to use

You run the FastMCP SQL Tools server as an MCP endpoint and connect to it with your MCP client. Once running, you can list all tables in your connected database, fetch detailed schema information for a table, execute any SQL statement, or perform safe, read-only SELECT queries. The server automatically detects the database type from the DATABASE_URL you provide and routes requests to the appropriate database driver.

How to install

Prerequisites: you need a runtime to execute the MCP server. The following example uses the uvx runner shown in the configuration snippet. You also need a database URL for your target database.

# Step 1: prepare configuration for your MCP client environment
# Step 2: set DATABASE_URL in your environment to point to your database
# Step 3: run the MCP server using the provided command

Additional sections

Configuration is done by adding an MCP server entry that uses the uvx runner to start the FastMCP SQL Tools process. The server reads the DATABASE_URL to determine the target database type (PostgreSQL, MySQL, or SQLite). Ensure your DATABASE_URL is set before starting the server.

{
  "mcpServers": {
    "sqltools": {
      "command": "uvx",
      "args": [
        "fastmcp-sqltools"
      ],
      "env": {
        "DATABASE_URL": "<your-database-url>"
      }
    }
  }
}

DATABASE_URL formats you can use include PostgreSQL, MySQL, and SQLite. For PostgreSQL, use:

  • postgresql://user:password@host:port/database
  • post://user:password@host:port/database For MySQL:
  • mysql://user:password@host:port/database For SQLite:
  • sqlite:///path/to/database.db (use three slashes for an absolute path)

Available tools

list_tables

Return a list of all tables present in the connected database.

get_table_schema

Provide detailed schema information for a specified table, including columns, data types, constraints, and indexes.

execute_query

Execute any SQL statement, including INSERT, UPDATE, DELETE, and DDL statements, against the connected database.

execute_safe_query

Execute read-only SELECT queries with safety checks to prevent modifications.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
FastMCP SQL Tools MCP Server - atarkowska/fastmcp-sqltools | VeilStrat