# fastmcp-sqltools [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/atarkowska/fastmcp-sqltools  
**GitHub Stars:** 1  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/fastmcp-sqltools

## Description
An MCP server that provides [describe what your server does]

## Tools
Capabilities this server exposes over MCP:

- **list_tables** — List all tables in the specified schema.
- **get_table_schema** — Get the schema (column definitions) for a specific table.
- **execute_query** — Execute a SQL query and return results.
WARNING: This can execute any SQL including DDL and DML statements.
- **execute_safe_query** — Execute a read-only SQL query (SELECT only).
This is safer than execute_query as it prevents data modification.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "fastmcp-sqltools": {
    "command": "uvx",
    "args": ["fastmcp-sqltools"],
    "env": {
      "DATABASE_URL": ""
    }
  }
}
```

**Requires environment variables:** `DATABASE_URL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What fastmcp-sqltools MCP server does

The fastmcp-sqltools MCP server gives an MCP-compatible client access to a configured SQL database. It supports PostgreSQL, MySQL, and SQLite, with the database engine selected from the format of the DATABASE_URL environment variable.

Its capabilities cover both database discovery and query execution. An agent can enumerate tables in a schema, retrieve column and structural details for a table, run unrestricted SQL, or use a read-only path for SELECT statements. This makes the server suitable for database exploration, schema-aware analysis, and tasks that require SQL execution from an agent.

## How it works

The server is built with FastMCP and communicates with an MCP client using the server configuration supplied by that client. Database connections use asyncpg for PostgreSQL, aiomysql for MySQL, and aiosqlite for SQLite.

The connection target is provided through DATABASE_URL. PostgreSQL URLs may use either the postgresql or postgres scheme. MySQL uses the mysql scheme, while SQLite uses sqlite:/// followed by the database path. The server identifies the database type from this URL rather than requiring a separate database-type setting.

## Setup and configuration

Install or launch the package with uvx and register it as an MCP server in the client configuration. The documented Claude Desktop configuration invokes `fastmcp-sqltools` as the uvx package and passes DATABASE_URL through the environment.

Example connection formats are:

- `postgresql://user:password@host:port/database`
- `postgres://user:password@host:port/database`
- `mysql://user:password@host:port/database`
- `sqlite:///path/to/database.db`

For SQLite, three slashes are used for an absolute path. Replace the placeholder credentials, host, port, database name, or file path with the target database connection details.

## Tools and capabilities

The fastmcp-sqltools MCP server exposes four tools:

- `list_tables` lists tables in a specified schema.
- `get_table_schema` returns table structure, including columns, types, constraints, and indexes.
- `execute_query` runs arbitrary SQL. It supports statements such as INSERT, UPDATE, DELETE, and DDL in addition to queries.
- `execute_safe_query` runs read-only SELECT statements and applies additional safety checks intended to prevent data modification.

Use `get_table_schema` before generating SQL when the agent needs current column or constraint information. Prefer `execute_safe_query` for inspection and reporting tasks where writes are not required.

## Limitations and notes

The fastmcp-sqltools MCP server does not make every query read-only. `execute_query` can modify data or database structure, so exposing it to an agent requires care and appropriate database permissions. The safer tool is limited to SELECT queries and is intended for read-only access.

The provided configuration requires a valid DATABASE_URL. Connection behavior and available operations also depend on the selected database engine and the permissions of the configured database account. The documented setup specifically shows Claude Desktop, while the server uses the standard MCP process configuration through uvx.

_Full upstream README: https://allmcps.com/mcp/fastmcp-sqltools/readme_

