Skip to main content
Glama
Yukuiii

any-db-mcp

by Yukuiii

connect

Open a database session to MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, or Oracle; returns table details and permission mode, replacing any prior session.

Instructions

连接到数据库。支持 MySQL、MariaDB、PostgreSQL、SQLite、MSSQL、Oracle。传入连接参数后会建立新连接,之前的连接会被自动关闭。SQLite 只需要传 filepath 参数;PostgreSQL/MSSQL/Oracle 可通过 schema 指定命名空间,不传则列出所有非系统 schema;Oracle 的 database 参数表示 service name 或 TNS connect string;MSSQL 在 SQL Server 2019+ 默认要求加密,自签证书环境需将 trustServerCertificate 设为 true。连接成功后返回当前数据库的表信息列表与当前权限模式(权限模式仅由 server 启动配置决定,无法通过此工具修改)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNo数据库主机地址(SQLite 不需要)localhost
portNo数据库端口(0 表示使用默认端口:MySQL/MariaDB 3306,PostgreSQL 5432,MSSQL 1433,Oracle 1521)
typeYes数据库类型
userNo数据库用户名(SQLite 不需要)
schemaNo仅 PostgreSQL/MSSQL/Oracle 使用:schema 名称;不传则列出所有非系统 schema
encryptNo仅 MSSQL 使用:是否启用 TLS 加密(SQL Server 2019+ 默认要求),默认 true
databaseNo数据库名(SQLite 不需要;Oracle 填 service name 或 TNS connect string)
filepathNoSQLite 数据库文件路径(仅 SQLite 使用)
passwordNo数据库密码(SQLite 不需要)
trustServerCertificateNo仅 MSSQL 使用:是否信任自签证书(开发/局域网常用),默认 false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.2

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and discloses important side effects: previous connection is auto-closed, successful connection returns table info and permission mode, and permission mode cannot be modified. It omits error handling and timeout behavior, but covers key operational traits well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The paragraph is front-loaded with the core action and supported databases, then details special cases efficiently using semicolons. It is information-dense but not repetitive, though a few clauses are redundant with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters, 6 database types, and no output schema, the description covers connection behavior, return values (table list and permission mode), and database-specific quirks. An agent has enough context to invoke it correctly without opening the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description reiterates some database-specific parameter usage (e.g., SQLite filepath, Oracle database as service name, MSSQL trustServerCertificate) but adds little beyond what the schema already states, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (connect) and resource (database), lists all supported database types, and distinguishes from siblings by describing what happens on connection (previous connection closed, returns table info and permission mode).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context for when to use it (to establish a connection before other operations) and implicitly warns that a new connection replaces the old one. However, it does not explicitly compare to siblings like disconnect or connection_status.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.