Execute raw SQL queries against SQL Server and return the results.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
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.

Run the server with dnx:
For a specific version:
Package: RawSqlMcp on NuGet
Databases are configured with environment variables under RawSqlMcp__Databases__.
SQLite:
PostgreSQL:
MySQL/MariaDB:
SQL Server:
Optional command timeout, in seconds:
[!INFO] The legacy
RawSqlMcp__ConnectionStrings__Default="..."format is obsolete. It still works for compatibility and is interpreted as SQL Server.
Register the server in an MCP client as a STDIO server:
The server exposes tools for listing configured database names, reading schema metadata, and executing raw, parameterized, and scalar SQL queries.

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/raw-sql-mcp)<a href="https://allmcps.com/mcp/raw-sql-mcp"><img src="https://allmcps.com/api/badge/raw-sql-mcp?style=directory" alt="Raw SQL MCP on AllMCPs" /></a>