Raw SQL MCP

Official registry Data and databases

Execute raw SQL queries against SQL Server, SQLite, PostgreSQL, MySQL, and MariaDB.

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

NUGET package RawSqlMcp
Claude Code
claude mcp add raw-sql-mcp -e 'RawSqlMcp__Databases__Default__Provider=<RawSqlMcp__Databases__Default__Provider>' -e 'RawSqlMcp__Databases__Default__ConnectionString=<your rawsqlmcp__databases__default__connectionstring>' -e 'RawSqlMcp__ConnectionStrings__Default=<your rawsqlmcp__connectionstrings__default>' -- dnx RawSqlMcp@0.1.0 --yes
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "raw-sql-mcp": {
            "command": "dnx",
            "args": [
                "RawSqlMcp@0.1.0",
                "--yes"
            ],
            "env": {
                "RawSqlMcp__Databases__Default__Provider": "<RawSqlMcp__Databases__Default__Provider>",
                "RawSqlMcp__Databases__Default__ConnectionString": "<your rawsqlmcp__databases__default__connectionstring>",
                "RawSqlMcp__ConnectionStrings__Default": "<your rawsqlmcp__connectionstrings__default>"
            }
        }
    }
}

Environment variables

  • RawSqlMcp__Databases__Default__Provider Database provider. Values: sqlserver, sqlite, postgres, postgresql, mysql, mariadb.
  • RawSqlMcp__Databases__Default__ConnectionString secret Connection string for the named database.
  • RawSqlMcp__ConnectionStrings__Default secret Obsolete. Use provider and connection string database settings instead.

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. Raw SQL MCP
  2. Installation
  3. Configuration
  4. Usage

Raw SQL MCP

Raw SQL MCP is a STDIO MCP server for executing raw SQL against SQL Server, SQLite, PostgreSQL, MySQL, and MariaDB.

[!IMPORTANT] Use it carefully. The server does not protect you from destructive queries, expensive queries, SQL injection, missing pagination, or unsafe data exposure. Always review and approve queries before running them.

Installation

Run the server with dnx:

dnx RawSqlMcp

For a specific version:

dnx RawSqlMcp@0.0.2

Package: RawSqlMcp on NuGet

Configuration

Databases are configured with environment variables under RawSqlMcp__Databases__.

SQLite:

export RawSqlMcp__Databases__Local__Provider="sqlite"
export RawSqlMcp__Databases__Local__ConnectionString="Data Source=/absolute/path/app.db"

PostgreSQL:

export RawSqlMcp__Databases__Reporting__Provider="postgres"
export RawSqlMcp__Databases__Reporting__ConnectionString="Host=localhost;Port=5432;Database=reporting;Username=postgres;Password=postgres"

MySQL/MariaDB:

export RawSqlMcp__Databases__Shop__Provider="mysql"
export RawSqlMcp__Databases__Shop__ConnectionString="Server=localhost;Port=3306;Database=shop;User ID=mysql;Password=mysql"

SQL Server:

export RawSqlMcp__Databases__Default__Provider="sqlserver"
export RawSqlMcp__Databases__Default__ConnectionString="Server=localhost,1433;Database=master;User Id=sa;Password=Your_password123;TrustServerCertificate=True"

Optional command timeout, in seconds:

export RawSqlMcp__CommandTimeout=30

[!INFO] The legacy RawSqlMcp__ConnectionStrings__Default="..." format is obsolete. It still works for compatibility and is interpreted as SQL Server.

Usage

Register the server in an MCP client as a STDIO server:

{
  "servers": {
    "raw-sql-mcp": {
      "command": "dnx",
      "args": ["RawSqlMcp"],
      "env": {
        "RawSqlMcp__Databases__Default__Provider": "sqlserver",
        "RawSqlMcp__Databases__Default__ConnectionString": "Server=localhost,1433;Database=master;User Id=sa;Password=Your_password123;TrustServerCertificate=True"
      }
    }
  }
}

The server exposes tools for listing configured database names, reading schema metadata, and executing raw, parameterized, and scalar SQL queries.

Frequently asked questions

What is Raw SQL MCP?

Execute raw SQL queries against SQL Server, SQLite, PostgreSQL, MySQL, and MariaDB.

How do I install Raw SQL MCP?

It runs on your machine. In Claude Code: claude mcp add raw-sql-mcp -e 'RawSqlMcp__Databases__Default__Provider=<RawSqlMcp__Databases__Default__Provider>' -e 'RawSqlMcp__Databases__Default__ConnectionString=<your rawsqlmcp__databases__default__connectionstring>' -e 'RawSqlMcp__ConnectionStrings__Default=<your rawsqlmcp__connectionstrings__default>' -- dnx RawSqlMcp@0.1.0 --yes. For other clients, paste the JSON configuration from this page into their MCP settings.

Does Raw SQL MCP need an API key?

Yes. It expects RawSqlMcp__Databases__Default__ConnectionString, RawSqlMcp__ConnectionStrings__Default, which you set in its configuration.

Is Raw SQL MCP open source?

Yes. Its code is on GitHub under the AGPL-3.0 license.

Who maintains Raw SQL MCP?

It is published by KifoPL. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.