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 "Install 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-mcpshow 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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses that it shows connection details but does not mention side effects, authentication, or behavior when not connected; acceptable for a read-only status check.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence with clear structure, no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Describes what is shown (connection status, user, engine, expiration) but lacks details on return format; sufficient for a simple informational tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist; baseline of 4 applies as schema coverage is 100% and description adds context beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool shows connection status and includes user, engine, and expiration for each database connection, differentiating it from siblings like list_connections or disconnect.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives; does not specify use cases or when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
disconnectA
Disconnect from all database connections. Revokes the current access token and clears cached credentials. The next tool call will require re-authentication.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses that it revokes the current access token, clears cached credentials, and indicates that re-authentication is required on the next call. This goes beyond basic purpose to inform about side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences, each adding unique value: the core action, the effects on credentials, and the future requirement. No fluff, front-loaded with the main action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the essential aspects for a disconnect tool: what is disconnected, what happens to auth state, and the need for re-authentication. It could mention the return value or confirm success, but given the simplicity, it is adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no parameters, so the description does not need to add parameter semantics. The baseline for 0 params is 4, and the description appropriately stays silent on parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it disconnects from all database connections, specifies the action of revoking token and clearing credentials, and distinguishes itself from sibling tools like connection_status, list_connections, etc., which focus on status or querying.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies that this tool should be used to end a session or disconnect, but it does not explicitly state when to use it versus alternatives, nor does it provide exclusions or conditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the full behavioral burden. It discloses that calling will trigger authentication if not connected, a useful side effect. No further behavioral details are needed for a listing tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, clear and front-loaded with purpose. Every sentence adds value; no fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description adequately explains what is returned. It is complete for the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and schema coverage is 100%, so the description adds no parameter-specific meaning. Baseline 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists database connections in the current session and specifies the return fields (name, engine type, databases). It is distinct from siblings like connection_status or query_database.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description indicates the returned name can be passed to query_database and list_schema, providing usage context. It mentions authentication triggering, but does not explicitly contrast with alternatives like connection_status or when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | ||
| table | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description discloses the basic read-only operation and naming conventions, but does not cover error behavior (e.g., invalid connection, non-existent table) or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences that front-load the main purpose and provide necessary details without redundancy. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description covers core functionality but omits details on return format, error scenarios, and behavior when no connection is provided and multiple exist.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description compensates by explaining the connection parameter's role (omit if only one) and the table parameter's format ('schema.table') and purpose, adding value beyond parameter names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists tables or describes columns for a connection. It distinguishes between two modes (no table vs. table argument) and includes database-specific naming conventions, making it distinct from siblings like 'query_database'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance on when to omit the connection parameter and how to use the table parameter for different purposes. However, it does not explicitly state when not to use this tool or suggest alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | ||
| sql | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses critical behaviors: read-only constraint, allowed statement types per database engine, and configurable row limit. With no annotations, this is sufficient for safe use, though transaction handling and timeouts are not mentioned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences, front-loaded with core purpose, followed by necessary constraints and guidance. No redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers purpose, engine-specific allowed statements, row limit, and dependencies on other tools. Lacks detail on return format or error handling, but provides adequate context for an AI agent to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Adds meaningful context to both parameters: explains connection's purpose, when to omit, and how to find valid values via list_connections. For sql, reinforces allowed statement types. With 0% schema coverage, this adds significant value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the verb 'execute', the resource 'SQL query', and the constraint 'read-only' against 'configured database connections'. Distinguishes from sibling tools like list_connections and list_schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly directs to use list_connections to discover connection names and engines, and list_schema for table structure before querying. States when the connection parameter can be omitted and lists allowed SQL statements per engine.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
The Ramp MCP server enables users to securely connect Ramp with AI assistants like ChatGPT and Claude to query financial data and take actions using natural language. It transforms Ramp's developer API into a SQL interface that LLMs can query, allowing admins to analyze spend trends, identify cost savings, and run complex SQL analyses on comprehensive datasets (transactions, purchase orders, vendors, users), while all users can manage cards, view transactions, request reimbursements, and get expense policy answers.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
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 gradedqualityCmaintenanceA Node.js MCP server with custom OAuth 2.1 + PKCE authentication, enabling secure remote connections to LLMs like Claude and ChatGPT.792MIT
- AlicenseNot gradedqualityDmaintenanceA database-agnostic MCP server that enables natural language queries to your database through Claude or Copilot, automatically writing and executing SQL.16MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for Microsoft SQL Server enabling safe read-only queries, schema discovery, and natural-language query via LangChain.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kpconnell/db-oauth-mcp-node'
If you have feedback or need assistance with the MCP directory API, please join our Discord server