# mcp-sql-rust [Health: Active]

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

## Description
Token-efficient MCP server for MySQL, PostgreSQL, and SQLite

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/rzlco666/mcp-sql-rust), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
curl -fsSL https://raw.githubusercontent.com/rzlco666/strut-stack-sql/main/install.sh | bash
```

2. Start the server:

```sh
strut-stack-sql                          # stdio, read-only
```

3. Start the server:

```sh
strut-stack-sql --http 127.0.0.1:8080
```

## Documentation

## What mcp-sql-rust does

The mcp-sql-rust MCP server gives MCP-compatible agents access to MySQL, PostgreSQL, and SQLite from one executable. It is designed to keep tool responses compact: query results use a column-oriented `{cols, rows, meta}` structure, with limits on returned rows and bytes.

The default operating mode exposes three tools: `search_objects`, `execute_sql`, and `analyze_query_performance`. Running the binary with `--full-tools` enables additional tools; DDL aliases also require `--allow-ddl`. The project is distributed under the MIT license and can run independently of the wider StrutStack ecosystem.

## How it works

The mcp-sql-rust MCP server accepts MCP requests through standard input/output or Streamable HTTP. HTTP mode is enabled with `--http`, such as `--http 127.0.0.1:8080`, and provides `/mcp` plus a `/healthz` endpoint.

SQL passes through an AST-based guard before the server checks out a database connection. The guard rejects multi-statement input and applies write and complexity controls. The default command is read-only; `--allow-writes` enables write access. Client-side timeouts are supported alongside PostgreSQL `statement_timeout` and MySQL `max_execution_time` controls.

Results are intentionally structured for agent use rather than displayed as conventional row-by-row text. This reduces repeated column names in tool output while preserving metadata in the response.

## Setup and configuration

Install the released binary with the project’s shell installer:

```bash
curl -fsSL https://raw.githubusercontent.com/rzlco666/strut-stack-sql/main/install.sh | bash
strut-stack-sql --version
```

The installer places the executable in `~/.local/bin` and creates the `mcp-sql-rust` compatibility alias. That directory must be available on `PATH`. Homebrew, Scoop, winget, Docker, and Cargo installation paths are also documented by the project.

Set `DATABASE_URL` to the target connection string, for example a PostgreSQL URL in a project `.env` file. Credentials are not needed for startup: without this variable, the process uses an in-memory SQLite database so MCP initialization can complete, but it cannot run queries against the intended external database. Cursor can launch the binary directly, or use the supplied workspace launcher to load a nested `apps/api/.env` file.

## Tools and capabilities

- Search database objects with `search_objects`.
- Execute SQL with `execute_sql`.
- Inspect query performance with `analyze_query_performance`.
- Enable additional tools with `--full-tools`.
- Use PostgreSQL, MySQL, or SQLite through the same binary.
- Choose stdio or Streamable HTTP transport.

The `mcp-sql-rust MCP server` is a fit for agents that need controlled database inspection or carefully enabled mutations. Review the project’s security and tool documentation before enabling writes or DDL.

## Limitations and notes

The server does not guarantee that a configured database is reachable at startup; the documented launcher intentionally does not block startup on a dead database. The fallback in-memory SQLite database can make initialization succeed without proving that production credentials or connectivity are correct.

Write operations are not available in the default read-only mode. DDL aliases have an additional `--allow-ddl` requirement, and the full tool set is not enabled unless `--full-tools` is supplied. The project reports benchmark measurements in its documentation but explicitly does not claim a QPS leaderboard.

_Full upstream README: https://allmcps.com/mcp/mcp-sql-rust/readme_

