Skip to main content
Glama
TranChiHuu

MCP SQL Server

by TranChiHuu

MCP SQL Server

A Model Context Protocol (MCP) server for querying PostgreSQL and MySQL databases.

Quick Start

Recommended: Use npx to run without installation:

npx postgres-mysql-mcp-server

For MCP client configuration (Cursor, Windsurf, etc.), use:

{
  "mcpServers": {
    "sql": {
      "command": "npx",
      "args": ["-y", "postgres-mysql-mcp-server"],
      "env": {
        "DB_TYPE": "postgresql",
        "DB_HOST": "localhost",
        "DB_PORT": "5432",
        "DB_DATABASE": "mydb",
        "DB_USER": "postgres",
        "DB_PASSWORD": "password"
      }
    }
  }
}

Related MCP server: MySQL MCP

What is MCP and Why Use It?

Model Context Protocol (MCP) is a standardized protocol that enables AI assistants in code editors like Cursor, Windsurf, and other AI-powered development tools to securely interact with external systems and data sources.

This MCP server bridges the gap between your AI coding assistant and your databases, allowing the AI to:

  • Understand your database schema - The AI can explore tables, columns, and relationships

  • Write accurate SQL queries - Generate queries based on your actual database structure

  • Debug database issues - Query data to understand problems and verify fixes

  • Generate database-aware code - Create application code that matches your database schema

  • Answer questions about your data - Query the database to provide accurate information

Perfect for AI-Powered Editors

When integrated with AI editors like Cursor or Windsurf, this MCP server transforms your AI assistant into a database-aware coding companion:

Example Use Cases:

  1. Schema-Aware Code Generation

    • You: "Create a user registration API endpoint"

    • AI: Automatically queries your database schema, understands the users table structure, and generates code that matches your exact column names and types

  2. Intelligent Query Writing

    • You: "Show me all active users from the last 30 days"

    • AI: Connects to your database, checks the schema, and writes a correct SQL query using your actual table and column names

  3. Database Debugging

    • You: "Why is my user login failing?"

    • AI: Queries your database to check user records, verify table structures, and identify potential issues

  4. Data-Driven Development

    • You: "Create a dashboard showing user statistics"

    • AI: Explores your database schema, understands relationships, and generates accurate queries and code

  5. Migration and Refactoring

    • You: "Refactor this code to use the new database schema"

    • AI: Compares your code with the actual database schema and suggests accurate changes

How It Works

  1. Configure the MCP server in your AI editor (Cursor, Windsurf, etc.)

  2. Connect to your PostgreSQL or MySQL database

  3. Ask your AI assistant questions or request code generation

  4. AI uses the MCP server to query your database schema and data

  5. Get accurate, database-aware responses and code

The AI assistant can now "see" your database structure and data, making it much more helpful and accurate in generating database-related code.

Features

  • Connect to PostgreSQL and MySQL databases

  • Execute SQL queries

  • List database tables

  • Describe table schemas

  • Parameterized query support

  • Connection pooling for better performance

  • Secure credential management via environment variables

  • Auto-connect on startup when environment variables are set

Installation

Recommended: Run the server directly with npx without any installation. This is the simplest and most convenient method:

npx postgres-mysql-mcp-server

The -y flag is automatically handled by npx, so it will download and run the latest version without prompts.

Option 2: Install via npm

If you prefer to install the package:

Global installation:

npm install -g postgres-mysql-mcp-server

Local installation in your project:

npm install postgres-mysql-mcp-server

Option 3: Development Installation

For local development or contributing:

git clone https://github.com/TranChiHuu/postgres-mysql-mcp-server.git
cd postgres-mysql-mcp-server
npm install

Usage

Running the Server

The server runs on stdio and communicates via the MCP protocol.

Recommended: Using npx (no installation required)

npx postgres-mysql-mcp-server

This is the recommended way to run the server. npx will automatically download and run the latest version.

Alternative: Using globally installed package

postgres-mysql-mcp-server

For local development:

npm start

Available Tools

1. connect_database

Connect to a PostgreSQL or MySQL database. Parameters can be provided directly, loaded from environment variables, or a combination of both. If environment variables are set, the server will auto-connect on startup.

Parameters (all optional if using environment variables):

  • type (string, optional): Database type - "postgresql" or "mysql"

  • host (string, optional): Database host

  • port (number, optional): Database port

  • database (string, optional): Database name

  • user (string, optional): Database user

  • password (string, optional): Database password

  • ssl (boolean, optional): Use SSL connection (default: false)

Examples:

Using parameters:

{
  "type": "postgresql",
  "host": "localhost",
  "port": 5432,
  "database": "mydb",
  "user": "postgres",
  "password": "password"
}

Using environment variables (call without parameters):

{}

Mixing parameters with environment variables:

{
  "type": "postgresql",
  "host": "custom-host"
}

2. execute_query

Execute a SQL query on the connected database.

Parameters:

  • query (string, required): SQL query to execute

  • params (array, optional): Query parameters for parameterized queries

Example:

{
  "query": "SELECT * FROM users WHERE id = $1",
  "params": [123]
}

3. list_tables

List all tables in the connected database.

Parameters: None

4. describe_table

Get schema information for a specific table.

Parameters:

  • tableName (string, required): Name of the table to describe

Example:

{
  "tableName": "users"
}

5. disconnect_database

Disconnect from the current database.

Parameters: None

Configuration

Environment Variables

You can configure database connection using environment variables. Create a .env file in the project root or set environment variables:

Option 1: Generic Environment Variables (works for both PostgreSQL and MySQL)

DB_TYPE=postgresql          # or "mysql"
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=mydb
DB_USER=postgres
DB_PASSWORD=password
DB_SSL=false               # optional, set to "true" for SSL

Option 2: PostgreSQL-Specific Environment Variables

POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DATABASE=mydb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_SSL=false         # optional

Option 3: MySQL-Specific Environment Variables

MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DATABASE=mydb
MYSQL_USER=root
MYSQL_PASSWORD=password
MYSQL_SSL=false            # optional

Note: If environment variables are set, the server will automatically connect on startup. You can also call connect_database without parameters to use environment variables, or provide partial parameters that will be merged with environment variables.

MCP Client Configuration

This MCP server integrates seamlessly with AI-powered code editors. Add it to your MCP client configuration to enable database-aware AI assistance.

Supported Editors

  • Cursor - AI-powered code editor

  • Windsurf - AI-first IDE

  • Any editor that supports the Model Context Protocol

Configuration Steps

For Cursor:

  1. Open Cursor Settings

  2. Navigate to Features → Model Context Protocol

  3. Add the server configuration below

For Windsurf:

  1. Open Settings

  2. Navigate to MCP Servers

  3. Add the server configuration below

For other MCP-compatible editors: Add the configuration to your MCP settings file (typically ~/.config/mcp/settings.json or editor-specific location)

Configuration Options

This is the recommended configuration. npx automatically downloads and runs the latest version without requiring any installation:

{
  "mcpServers": {
    "sql": {
      "command": "npx",
      "args": ["-y", "postgres-mysql-mcp-server"],
      "env": {
        "DB_TYPE": "postgresql",
        "DB_HOST": "localhost",
        "DB_PORT": "5432",
        "DB_DATABASE": "mydb",
        "DB_USER": "postgres",
        "DB_PASSWORD": "password"
      }
    }
  }
}

Benefits of using npx:

  • ✅ No installation required

  • ✅ Always uses the latest version

  • ✅ No manual updates needed

  • ✅ Works across different projects without conflicts

  • ✅ The -y flag automatically answers "yes" to install prompts

Option 2: Using globally installed package

If you've installed the package globally (npm install -g postgres-mysql-mcp-server):

{
  "mcpServers": {
    "sql": {
      "command": "postgres-mysql-mcp-server",
      "env": {
        "DB_TYPE": "postgresql",
        "DB_HOST": "localhost",
        "DB_PORT": "5432",
        "DB_DATABASE": "mydb",
        "DB_USER": "postgres",
        "DB_PASSWORD": "password"
      }
    }
  }
}

Option 3: Using local installation

If you've installed the package locally in your project (npm install postgres-mysql-mcp-server):

{
  "mcpServers": {
    "sql": {
      "command": "node",
      "args": ["./node_modules/postgres-mysql-mcp-server/index.js"],
      "env": {
        "DB_TYPE": "postgresql",
        "DB_HOST": "localhost",
        "DB_PORT": "5432",
        "DB_DATABASE": "mydb",
        "DB_USER": "postgres",
        "DB_PASSWORD": "password"
      }
    }
  }
}

Option 4: Development setup (for local development)

If you're developing locally and have cloned the repository:

{
  "mcpServers": {
    "sql": {
      "command": "npm",
      "args": ["start"],
      "cwd": "/path-to-source/postgres-mysql-mcp-server",
      "env": {
        "DB_TYPE": "postgresql",
        "DB_HOST": "localhost",
        "DB_PORT": "5432",
        "DB_DATABASE": "mydb",
        "DB_USER": "postgres",
        "DB_PASSWORD": "password"
      }
    }
  }
}

Example: Using with Cursor AI

Once configured, you can interact with your database through natural language:

Example Conversation:

You: "What tables are in my database?"
AI: [Uses list_tables tool] "Your database contains: users, orders, products, categories"

You: "Show me the structure of the users table"
AI: [Uses describe_table tool] "The users table has: id (integer), email (varchar), created_at (timestamp)..."

You: "Create an API endpoint to get user by ID"
AI: [Uses describe_table to understand schema, then generates code]
     "Here's the endpoint matching your users table structure..."

The AI assistant automatically uses the appropriate MCP tools to query your database and provide accurate, schema-aware responses.

Development

The project uses plain JavaScript (ES modules), so no build step is required. Just edit index.js and run npm start.

Security Notes

  • Never commit database credentials to version control

  • Use environment variables or secure credential management

  • The server supports SSL connections for secure database access

  • Always validate and sanitize SQL queries in production environments

Requirements

  • Node.js 18+

  • PostgreSQL or MySQL database access

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Available Tools

5 tools
connect_databaseA

Connect to a PostgreSQL or MySQL database. Parameters can be provided directly or loaded from environment variables. If no parameters are provided, will use environment variables (DB_TYPE, DB_HOST, DB_PORT, DB_DATABASE, DB_USER, DB_PASSWORD, DB_SSL). For PostgreSQL: POSTGRES_HOST, POSTGRES_PORT, etc. For MySQL: MYSQL_HOST, MYSQL_PORT, etc.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeNoDatabase type (optional if using env vars)
hostNoDatabase host (optional if using env vars)
portNoDatabase port (optional if using env vars)
databaseNoDatabase name (optional if using env vars)
userNoDatabase user (optional if using env vars)
passwordNoDatabase password (optional if using env vars)
sslNoUse SSL connection (optional)

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the fallback to environment variables and SSL usage, which adds useful context. However, it lacks details on error handling, connection persistence, timeouts, or authentication requirements beyond basic parameters, leaving gaps in behavioral understanding.

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 description is appropriately sized and front-loaded with the core purpose. Each sentence adds necessary information about parameter sourcing and environment variables without redundancy. It could be slightly more structured by separating concerns (e.g., parameter vs. env var details), but it remains efficient.

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

Completeness3/5

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

Given the complexity of a database connection tool with 7 parameters, no annotations, and no output schema, the description is moderately complete. It covers parameter sourcing and basic usage but lacks details on return values, error cases, or connection lifecycle, which are critical for such an operation. The absence of output schema exacerbates this gap.

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 description coverage is 100%, so the schema already documents all parameters. The description adds value by explaining the environment variable mappings (e.g., DB_TYPE, POSTGRES_HOST, MYSQL_HOST) and the optional nature of parameters, which clarifies usage beyond the schema's basic descriptions. It does not fully detail parameter interactions or validation rules.

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 action ('Connect to a PostgreSQL or MySQL database') and specifies the resource (database), making the purpose explicit. It distinguishes from sibling tools like 'execute_query' or 'list_tables' by focusing on establishing a connection rather than querying or metadata operations.

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 provides clear context on when to use this tool (to connect to a database) and how parameters can be sourced (directly or from environment variables). However, it does not explicitly state when not to use it or mention alternatives like using existing connections from other tools, which prevents a perfect score.

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

describe_tableB

Get schema information for a specific table

ParametersJSON Schema
NameRequiredDescriptionDefault
tableNameYesName of the table to describe

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves schema information, which implies a read-only operation, but doesn't specify details like whether it requires authentication, returns error messages for invalid tables, or provides metadata format (e.g., column types, constraints). For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, clear sentence that efficiently conveys the core purpose without unnecessary words. It is front-loaded with the key action ('Get schema information'), making it easy to parse. Every part of the sentence earns its place by specifying the resource and scope.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on usage context, behavioral traits, and output format. Without annotations or an output schema, the description should ideally provide more context about what 'schema information' includes, but it meets the minimum for a simple read operation.

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?

The input schema has 100% description coverage, with the single parameter 'tableName' fully documented in the schema. The description adds no additional parameter details beyond what the schema provides (e.g., examples of table names, format requirements). Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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

Purpose4/5

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

The description clearly states the action ('Get schema information') and target resource ('for a specific table'), making the purpose immediately understandable. It distinguishes from siblings like 'list_tables' (which lists tables) and 'execute_query' (which runs queries), though it doesn't explicitly mention this differentiation. The description avoids tautology by not just restating the name 'describe_table'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a connected database via 'connect_database'), exclusions (e.g., not for querying data), or comparisons to siblings like 'list_tables' (for table names) or 'execute_query' (for data retrieval). Usage is implied from the purpose but not explicitly stated.

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

disconnect_databaseB

Disconnect from the current database

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Disconnect' implies a state change, the description doesn't specify whether this is reversible, what happens to active queries/sessions, whether authentication is required, or any side effects. It provides minimal behavioral context beyond the basic action.

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 a single, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it immediately understandable. Every word earns its place in conveying the essential purpose.

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

Completeness2/5

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

For a state-changing operation with no annotations and no output schema, the description is insufficient. It doesn't explain what 'disconnect' entails operationally, what happens after disconnection, whether there are confirmation steps, or what the agent should expect. Given the complexity of database connection management, more context is needed.

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?

The tool has zero parameters, and schema description coverage is 100% (empty schema). The description appropriately doesn't discuss parameters since none exist. This meets the baseline expectation for parameterless tools.

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

Purpose4/5

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

The description clearly states the action ('Disconnect') and target resource ('current database'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'connect_database' or 'execute_query', but the verb 'Disconnect' inherently distinguishes it from other database operations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives or what conditions must be met before disconnecting. It doesn't mention prerequisites (e.g., must be connected first), consequences of disconnecting, or when this operation is appropriate versus maintaining a connection.

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

execute_queryA

Execute a SQL query on the connected database. Returns query results.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query to execute
paramsNoQuery parameters (for parameterized queries)

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it states the action and return purpose ('Returns query results'), it lacks critical behavioral details such as whether this tool can execute both read and write queries, what permissions are required, potential rate limits, error handling, or transaction implications. For a database query tool with zero annotation coverage, this leaves significant gaps.

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 consists of two concise, front-loaded sentences that efficiently convey the core functionality and outcome. Every word earns its place with zero redundancy or unnecessary elaboration, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's complexity (executing arbitrary SQL queries) and the absence of both annotations and an output schema, the description is moderately complete. It covers the basic purpose and return intent but lacks details on result format, error conditions, security implications, and behavioral constraints that would be crucial for safe and effective use.

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 fully documents both parameters (query and params). The description adds no additional parameter semantics beyond what the schema provides, such as SQL dialect specifics, parameter binding syntax, or query validation rules. The baseline score of 3 reflects adequate but minimal value addition.

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 specific action ('Execute a SQL query') and target resource ('on the connected database'), distinguishing it from sibling tools like connect_database, describe_table, list_tables, and disconnect_database. It provides a complete verb+resource+scope combination.

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 context through 'on the connected database', suggesting this tool should be used after establishing a connection (likely via connect_database). However, it doesn't explicitly state when to use this vs. alternatives like describe_table or list_tables, nor does it provide exclusions or prerequisites beyond the implied connection requirement.

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

list_tablesB

List all tables in the connected database

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool lists tables, implying a read-only operation, but doesn't specify whether this requires specific permissions, what the output format looks like (e.g., list of names, metadata), or if there are limitations like pagination or rate limits. The description is minimal and misses key behavioral details for a tool with zero annotation coverage.

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 a single, efficient sentence that front-loads the core purpose ('List all tables') with necessary context ('in the connected database'). There is zero waste—every word contributes directly to understanding the tool's function, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It covers the basic purpose and implies a read operation, but lacks details on output format, permissions, or behavioral traits. Without annotations or output schema, the description should do more to compensate, but it's minimally viable for this 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?

The tool has 0 parameters, and schema description coverage is 100% (though empty). The description doesn't need to add parameter details, as there are none to document. It appropriately focuses on the tool's purpose without redundant parameter explanations, meeting the baseline for zero parameters.

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

Purpose4/5

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

The description clearly states the action ('List') and resource ('all tables in the connected database'), making the purpose immediately understandable. It distinguishes from siblings like 'describe_table' (details about specific tables) and 'execute_query' (general queries), though it doesn't explicitly mention these distinctions. The description avoids tautology by not just restating the tool name.

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 when needing to see all tables, but provides no explicit guidance on when to use this tool versus alternatives like 'describe_table' or 'execute_query'. It mentions the prerequisite of a 'connected database', which hints at needing 'connect_database' first, but lacks clear when/when-not instructions or named alternatives.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updates
    • First observedconnect_database
    • First observeddescribe_table
    • First observeddisconnect_database
    • First observedexecute_query
    • First observedlist_tables

TDQS

A3.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: connect_database establishes a connection, describe_table provides schema details, disconnect_database ends the connection, execute_query runs SQL commands, and list_tables enumerates available tables. The descriptions make it easy to differentiate between connection management, metadata exploration, and query execution.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., connect_database, describe_table, disconnect_database, execute_query, list_tables). This uniformity makes the set predictable and easy to understand, with no deviations in naming style.

Tool Count5/5

With 5 tools, the server is well-scoped for its SQL database management purpose. Each tool earns its place by covering essential operations: connection handling, table listing, schema description, query execution, and disconnection. This count is neither too sparse nor bloated for the domain.

Completeness4/5

The tool set provides solid coverage for core SQL operations, including connection lifecycle and basic querying. However, there are minor gaps, such as the lack of tools for managing database objects (e.g., create_table, drop_table) or handling transactions, which agents might need to work around for more advanced tasks.

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
    A
    quality
    C
    maintenance
    Enables interaction with MySQL databases (including AWS RDS and cloud instances) through natural language. Supports database connections, query execution, schema inspection, and comprehensive database management operations.
    8
    28
    8
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables management and querying of multiple MySQL databases through natural language, allowing AI assistants to list databases, execute SQL queries, and explore database schemas.
    1
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables interaction with Microsoft SQL Server and Azure SQL databases through natural language, supporting queries, schema exploration, stored procedures, and complete database operations with connection pooling and security features.
    14
    907
    12
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to connect to and interact with PostgreSQL, MySQL, SQLite, and MongoDB databases through natural language, supporting schema exploration, query execution, data export, and more.
    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/TranChiHuu/postgres-mysql-mcp-server'

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