db-oauth-mcp
Allows read-only SQL queries against MariaDB databases through OAuth 2.0 PKCE authentication, with per-user credentials that are short-lived and never touch disk.
Allows read-only SQL queries against MySQL databases through OAuth 2.0 PKCE authentication, with per-user credentials that are short-lived and never touch disk.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@db-oauth-mcp show me the top 10 customers by total orders"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
db-oauth-mcp
Node.js MCP server (TypeScript, distributed as a .mcpb Desktop Extension)
that lets Claude Desktop run read-only SQL against one or more databases,
gated by OAuth 2.0 PKCE. Credentials are per-user, short-lived, and never
touch disk.
Supported engines: MariaDB / MySQL and Microsoft SQL Server. A single OAuth session can expose any number of connections across either engine — the backend decides what to hand out.
This is the Node port of db-oauth-mcp (previously Go). Same OAuth contract, same tool surface, same behavior — but distributed as one platform-neutral zip with no code signing, no cross-compilation, and no native binary.
Status
Under construction. The Go implementation at v0.2.x remains the current recommendation until this repo tags v0.3.0.
Related MCP server: MCP OAuth Server
Development
Requires Node 18+ and pnpm 10+.
pnpm install
pnpm run typecheck
pnpm run test
pnpm run build
OAUTH_AUTHORIZE_URL=https://auth.example.com/mcp/authorize \
OAUTH_API_BASE_URL=https://api.example.com \
LOG_LEVEL=debug \
node dist/server.jsSee the Go repo README for the OAuth contract, tool documentation, and engine-specific safety rules, all of which are inherited verbatim here.
License
MIT. See LICENSE.
Available Tools
5 toolsconnection_statusA
Show whether you're connected and, for each available database connection, which user and engine it uses and when it expires.
disconnectA
Disconnect from all database connections. Revokes the current access token and clears cached credentials. The next tool call will require re-authentication.
list_connectionsA
List the database connections available in the current session. Returns the name (pass to query_database / list_schema via the connection argument), engine type (mariadb or mssql), and the databases each connection grants access to. Calling this will trigger authentication if not yet connected.
list_schemaA
List tables or describe a specific table's columns for a given connection. Pass connection with the name of the target (omit if only one connection exists). Call with no table argument to see all tables, or with table set to 'schema.table' (MariaDB uses database.table; MSSQL uses schema.table within the connection's initial catalog) to describe its columns.
Inputs: connection, table.
query_databaseA
Execute a read-only SQL query against one of the configured database connections. Pass connection with the name of the target (omit if only one connection exists — use list_connections to see the names and which engine each uses). Only read statements are allowed (SELECT/SHOW/DESCRIBE/EXPLAIN/WITH on MariaDB; SELECT/WITH and a small allowlist of sp_help / sp_columns / sp_tables procs on MSSQL). Results are capped at a configurable row limit (default 1000). Use list_schema first if you don't know the table structure.
Inputs: sql (required), connection.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct purpose: showing connection status, disconnecting, listing connections, exploring schema, and querying data. No overlap in functionality.
All tool names follow a consistent snake_case verb_noun pattern (e.g., list_connections, query_database), including the standalone verb 'disconnect' which is standard for such actions.
With 5 tools, the server covers essential operations for a read-only database interface without being overly numerous or sparse. The count fits the scope perfectly.
The tools provide full lifecycle coverage for a read-only database MCP: status, listing connections, schema exploration, querying, and disconnection. No obvious missing features.
Maintenance
Related MCP Connectors
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server implementation that enables Claude to execute read-only queries against MariaDB databases and explore database schemas through natural language.20MIT
- AlicenseNot gradedqualityDmaintenanceA Node.js MCP server with custom OAuth 2.1 + PKCE authentication, enabling secure remote connections to LLMs like Claude and ChatGPT.ISC
- AlicenseAqualityDmaintenanceA database-agnostic MCP server that enables natural language queries to your database through Claude or Copilot, automatically writing and executing SQL.810 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Microsoft SQL Server enabling safe read-only queries, schema discovery, and natural-language query via LangChain.MIT