Skip to main content
Glama
meimingqi222

MCP Database Manager

by meimingqi222

MCP Database Manager

An MCP server that enables LLM agents to perform CRUD operations across multiple databases.

Features

  • Multi-Database Support

  • Permission Management (Read-only by default)

  • SQLAlchemy Integration

  • list_connections redacts passwords from connection URLs in its output

Related MCP server: SQLite MCP Server

Database Support

This MCP server supports multiple databases. You can enable specific database drivers using installation extras:

Extra

Database

Drivers Installed

postgres

PostgreSQL

psycopg2-binary

mysql

MySQL

pymysql, cryptography

mssql

SQL Server

pymssql

all

All of the above

All drivers

Configuration

The configuration file is located at:

  • ~/.mcp-database-manager/config.yaml (on all platforms)

Example config.yaml:

connections:
  - name: "main_db"
    url: "sqlite:///./main.db"
    readonly: true

Cursor Configuration

To use this MCP server in Cursor, add the following to your MCP settings (Settings > Features > MCP):

Use this if you have the source code locally and want to test changes immediately.

{
  "mcpServers": {
    "database-manager": {
      "command": "uv",
      "args": [
        "run",
        "--extra",
        "all",
        "mcp-database-manager"
      ],
      "cwd": "/absolute/path/to/mcp-database-manager"
    }
  }
}

Note: Replace /absolute/path/to/mcp-database-manager with the actual path to your project directory.

Option 2: Using PyPI (Published version)

Use this to run the stable version published on PyPI without cloning the repository.

{
  "mcpServers": {
    "database-manager": {
      "command": "uvx",
      "args": [
        "--from",
        "mcp-database-manager[all]",
        "mcp-database-manager"
      ]
    }
  }
}

Troubleshooting

If you see "Module not found" errors, ensure you are using uv run which handles the virtual environment automatically.

Available Tools

4 tools
get_schemaA

获取数据库 schema(Markdown)。默认返回所有表的摘要;传入 table_names 时返回这些表的列详情。

ParametersJSON Schema
NameRequiredDescriptionDefault
connection_nameYesConnection name (matches config.yaml connections[].name)
table_namesNoOptional list of table names. If omitted, returns a summary of all tables.

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the behavioral burden. It reveals output format (Markdown) and conditional behavior, but does not disclose potential side effects (none expected), prerequisite validity of connection_name, or error handling for invalid table_names. The description adequately conveys read-only nature but lacks edge-case details.

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

Conciseness5/5

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

Two concise sentences front-load the core purpose and then detail the parameter-driven behavior. No redundant words or unnecessary details. Every sentence provides essential information.

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

Completeness4/5

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

Given the tool's simplicity (2 params, no output schema), the description covers purpose, parameter effect, and output format adequately. While it does not specify the exact Markdown structure or error messages, it is sufficient for an agent to understand and invoke correctly. A brief example or note on connectivity would enhance completeness.

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

Parameters4/5

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

Schema coverage is 100% with good parameter descriptions. The description adds value beyond the schema by explaining how the optional parameter changes output (summary vs column details). This behavioral mapping helps the agent understand the impact of omitting or including table_names.

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?

The description clearly states it retrieves the database schema in Markdown format. It distinguishes default behavior (all tables summary) from optional behavior (specific table details with table_names). This verb+resource+scope specification effectively separates it from siblings like list_connections or read_sql.

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?

The description explains when to use each parameter variant: omit table_names for summary, provide for column details. However, it does not explicitly state when to use this tool versus siblings (e.g., for schema inspection vs data queries), though the purpose is clear. Slight room for improvement in exclusion guidance.

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

list_connectionsA

List configured database connections and their permission (readonly). Passwords are redacted from URLs in the output. Returns: JSON array of connection configs.

ParametersJSON Schema
NameRequiredDescriptionDefault
include_urlsYesWhether to include (redacted) connection URLs in the output. Default: true.

TDQS

A4/5.0
Behavior4/5

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

Discloses password redaction from URLs and return format (JSON array). Without annotations, covers key behavioral details. Could mention if connections require active status or any 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.

Conciseness5/5

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

Two sentences, no redundancy, front-loaded with core action. Every sentence provides value.

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

Completeness4/5

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

For a simple tool with one parameter and no output schema, description is fairly complete: purpose, return type, key behavior. Could clarify contents of 'connection configs' but adequate.

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 coverage is 100% so description adds only marginal context (redaction note). Description does not significantly enhance understanding beyond schema.

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?

Clearly states action (list) and resource (configured database connections), with added detail about permission (readonly). Distinguishes from sibling tools like get_schema, read_sql, write_sql by focusing on connection listing.

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

Usage Guidelines3/5

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

Implied usage (when you need to see available connections), but no explicit guidance on when to prefer this over alternatives 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.

read_sqlA

执行只读 SQL 查询(例如 SELECT/SHOW/PRAGMA)。 Returns: JSON array of rows.

ParametersJSON Schema
NameRequiredDescriptionDefault
connection_nameYesConnection name (matches config.yaml connections[].name)
queryYesSQL to execute (read-only)

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description step up by declaring the tool is read-only (non-destructive) and specifying the return format (JSON array of rows). However, it lacks details on authentication requirements, error handling, or SQL dialect limitations.

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

Conciseness5/5

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

The description is highly concise with two sentences: the first states purpose and examples, the second states the return format. No wasted words and front-loaded.

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

Completeness4/5

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

For a simple tool with two parameters and no output schema, the description adequately covers purpose, read-only constraint, and return format. It could be improved by including error behavior or SQL dialect alerts, but overall complete.

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 coverage is 100% as both parameters have detailed descriptions. The description adds no extra meaning beyond the schema, so it meets the baseline of 3.

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?

The description clearly states the tool executes read-only SQL queries, specifies allowed examples (SELECT/SHOW/PRAGMA), and distinguishes itself from siblings like write_sql, get_schema, and list_connections.

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

Usage Guidelines3/5

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

The description implies usage for read operations via '只读' but does not explicitly state when to use this tool versus alternatives like write_sql for writes or get_schema for schema retrieval.

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

write_sqlA

执行写入 SQL(INSERT/UPDATE/DELETE/DDL)。 仅当连接 readonly=false 时允许。 Returns: JSON {status, rows_affected}.

ParametersJSON Schema
NameRequiredDescriptionDefault
connection_nameYesConnection name (matches config.yaml connections[].name)
queryYesSQL to execute (write)

TDQS

A4.2/5.0
Behavior3/5

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

No annotations exist, so description carries full burden. It discloses write operation and return format but lacks details on side effects or error states.

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

Conciseness5/5

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

Two sentences convey all necessary information without redundancy. Front-loaded and efficient.

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

Completeness4/5

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

Given no output schema, the return format is specified. The readonly condition is mentioned, but error handling and transaction behavior are omitted. Acceptable for a simple tool.

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

Parameters4/5

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

Schema covers both parameters with descriptions. The description adds context on allowed SQL types (write operations), slightly exceeding the schema.

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?

The description clearly states the tool executes write SQL (INSERT/UPDATE/DELETE/DDL) and distinguishes it from sibling tools like read_sql.

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?

It specifies a precondition (readonly=false) and return format, but does not explicitly compare to alternatives or state 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.

TDQS

A4.3/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: schema retrieval, connection listing, read-only queries, and write queries. There is no overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with lowercase and underscores: get_schema, list_connections, read_sql, write_sql. The pattern is predictable and easy to understand.

Tool Count5/5

With 4 tools covering essential database operations (schema inspection, connection management, read queries, write queries), the count is well-scoped for the server's purpose.

Completeness4/5

The tool set covers core database interactions: schema inspection, read/write operations, and connection management. Minor gaps like transaction control or query analysis tools might be missing, but the set is largely complete for basic usage.

Maintenance

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables secure interaction with multiple SQL database engines (MySQL, PostgreSQL, SQLite, SQL Server) through a standardized interface. Supports schema inspection, safe query execution, and controlled write operations with built-in security restrictions.
    5
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLM agents to perform complete database operations on SQLite databases, including creating tables, executing queries, and managing data through CRUD operations with schema inspection capabilities.
    32
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables LLMs to interact with MySQL databases through standardized protocol, supporting database management, table operations, data queries, and modifications with configurable permission controls.
    15
    61
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Connect AI agents to SQL databases (SQLite, PostgreSQL, MySQL) with a unified interface for querying data, exploring schemas, inserting rows, and exporting results to CSV. Includes safety features like dangerous query blocking and write guards.
    13
    MIT

Latest Blog Posts

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/meimingqi222/mcp-database-manager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server