Skip to main content
Glama
Darkstar326

MCP MySQL Server

by Darkstar326

MCP MySQL Server

A Model Context Protocol (MCP) server for MySQL databases, including support for AWS RDS and other cloud MySQL instances. This server provides comprehensive database management capabilities through a standardized MCP interface.

📋 Quick Start for VS Code Users: See VSCODE_SETUP.md for step-by-step VS Code and GitHub Copilot integration instructions.

Features

  • ✅ Database Connection Management: Connect to local MySQL or cloud instances (AWS RDS, Google Cloud SQL, etc.)

  • ✅ Query Execution: Execute SQL queries with prepared statement support

  • ✅ Schema Inspection: List databases, tables, and describe table structures

  • ✅ Index Management: View table indexes and statistics

  • ✅ Security: Secure connection handling with SSL support

  • ✅ Error Handling: Comprehensive error reporting and connection management

Installation

npm install -g @sajithrw/mcp-mysql@1.0.0

Or run ad‑hoc without global install using npx (shown later in config).

From Source

git clone https://github.com/sajithrw/mcp-mysql.git
cd mcp-mysql
npm install
npm run build

Configuration

Create (or update) .vscode/mcp.json in your project or in your global VS Code user settings folder. Use the published package via npx so you always invoke the correct version.

{
  "servers": {
    "mcp-mysql": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@sajithrw/mcp-mysql@1.0.0"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

Then:

  1. Reload VS Code window (Command Palette: "Developer: Reload Window").

  2. Open Command Palette and run: "MCP: Start Server" (pick mcp-mysql).

  3. Use Copilot / MCP clients to call tools (e.g., ask to list tables).

Previous settings.json based github.copilot.advanced.mcp configuration is deprecated in favor of mcp.json discovery.

Alternative: Local Build Path

If working from a local clone/build instead of the published package:

{
  "servers": {
    "mcp-mysql": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/mcp-mysql/build/index.js"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password"
      }
    }
  }
}

Using with Claude Desktop

Add the server to your Claude Desktop configuration:

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["@sajithrw/mcp-mysql@1.0.0"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password"
      }
    }
  }
}

Using with MCP Inspector

For testing and development:

npx @modelcontextprotocol/inspector npx @sajithrw/mcp-mysql@1.0.0

Using with VS Code and GitHub Copilot

Once configured, you can use the MySQL MCP server with GitHub Copilot in VS Code to interact with your databases using natural language.

Example Interactions

  1. Database Exploration:

    • "Show me all tables in the database"

    • "Describe the structure of the users table"

    • "What indexes are on the products table?"

  2. Data Analysis:

    • "Show me the top 10 customers by order count"

    • "Find all users created in the last 30 days"

    • "Get statistics about the orders table"

  3. Schema Management:

    • "List all databases on this server"

    • "Show me table sizes and row counts"

    • "Find tables with specific column names"

Step-by-Step (Recap)

  1. Create .vscode/mcp.json with config above.

  2. Reload VS Code window.

  3. Run "MCP: Start Server".

  4. Use Copilot Chat / MCP-aware client to issue requests.

Troubleshooting Quick Tips

  • Ensure the package version (1.0.0) matches what you intend to use.

  • If the server won't start, run it manually: npx @sajithrw/mcp-mysql@1.0.0 to see logs.

  • Verify environment variables are present (you can also place them in a .env if your shell loads them before launching VS Code).

Available Tools

1. mysql_connect

Connect to a MySQL database.

Parameters:

  • host (required): MySQL server hostname or IP address

  • port (optional): MySQL server port (default: 3306)

  • user (required): Database username

  • password (required): Database password

  • database (optional): Database name to connect to

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

Example:

{
  "host": "localhost",
  "port": 3306,
  "user": "myuser",
  "password": "mypassword",
  "database": "mydb",
  "ssl": false
}

2. mysql_query

Execute a SQL query on the connected database.

Parameters:

  • query (required): SQL query to execute

  • parameters (optional): Array of parameters for prepared statements

Examples:

Simple query:

{
  "query": "SELECT * FROM users LIMIT 10"
}

Prepared statement:

{
  "query": "SELECT * FROM users WHERE age > ? AND city = ?",
  "parameters": ["25", "New York"]
}

3. mysql_list_databases

List all databases on the MySQL server.

Parameters: None

4. mysql_list_tables

List all tables in the current or specified database.

Parameters:

  • database (optional): Database name (uses current database if not specified)

5. mysql_describe_table

Get the structure/schema of a specific table.

Parameters:

  • table (required): Table name to describe

  • database (optional): Database name (uses current database if not specified)

6. mysql_show_indexes

Show indexes for a specific table.

Parameters:

  • table (required): Table name to show indexes for

  • database (optional): Database name (uses current database if not specified)

7. mysql_get_table_stats

Get statistics about a table (row count, size, etc.).

Parameters:

  • table (required): Table name to get statistics for

  • database (optional): Database name (uses current database if not specified)

8. mysql_disconnect

Disconnect from the MySQL database.

Parameters: None

Common Use Cases

1. Connecting to AWS RDS

{
  "host": "mydb.abc123.us-west-2.rds.amazonaws.com",
  "port": 3306,
  "user": "admin",
  "password": "mypassword",
  "database": "production",
  "ssl": true
}

2. Exploring Database Schema

  1. Connect to database using mysql_connect

  2. List all databases with mysql_list_databases

  3. List tables with mysql_list_tables

  4. Describe specific tables with mysql_describe_table

  5. Check indexes with mysql_show_indexes

3. Data Analysis

  1. Connect to database

  2. Execute analytical queries with mysql_query

  3. Get table statistics with mysql_get_table_stats

Security Considerations

  • Credentials: Never hardcode database credentials. Use environment variables or secure configuration management.

  • SSL/TLS: Always use SSL when connecting to production databases or cloud instances.

  • Permissions: Use database users with minimal required permissions.

  • Query Validation: The server uses prepared statements to prevent SQL injection.

Environment Variables

You can set default connection parameters using environment variables:

export MYSQL_HOST=localhost
export MYSQL_PORT=3306
export MYSQL_USER=myuser
export MYSQL_PASSWORD=mypassword
export MYSQL_DATABASE=mydb
export MYSQL_SSL=true

Development

Building

npm run build

Testing

npm run test

Development Mode

npm run dev

Troubleshooting

Connection Issues

  1. Connection Refused: Check that MySQL server is running and accessible

  2. Authentication Failed: Verify username and password

  3. SSL Errors: Ensure SSL is properly configured on both client and server

  4. Timeout: Check network connectivity and firewall settings

Common Error Messages

  • "Not connected to MySQL": Use mysql_connect before executing other commands

  • "Query execution failed": Check SQL syntax and table/column names

  • "Connection failed": Verify connection parameters and network connectivity

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests

  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

Available Tools

8 tools
mysql_connectC

Connect to a MySQL database with provided connection parameters

ParametersJSON Schema
NameRequiredDescriptionDefault
hostYesMySQL server hostname or IP address
portNoMySQL server port (default: 3306)
userYesDatabase username
passwordYesDatabase password
databaseNoDatabase name (optional)
sslNoUse SSL connection (default: false)

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral insight. It states the action ('connect') but doesn't disclose what happens on success/failure, whether it establishes a persistent session, authentication requirements beyond parameters, rate limits, or side effects. This is inadequate for a connection tool that likely manages state.

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 with zero waste. It's front-loaded and appropriately sized for a straightforward connection tool, earning its place by stating the core action.

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?

Given the complexity of a database connection tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., connection handle, success status), error handling, or how the connection integrates with sibling tools, leaving significant gaps for an agent.

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 fully documents all parameters. The description adds no additional meaning beyond implying these are 'connection parameters,' which is already clear from the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 verb ('connect') and resource ('MySQL database'), making the purpose evident. It distinguishes this as an initialization/connection tool rather than a query or metadata tool, though it doesn't explicitly differentiate from siblings like 'mysql_disconnect' beyond the obvious opposite action.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., must be called before other MySQL tools), when not to use it (e.g., if already connected), or how it relates to sibling tools like 'mysql_disconnect' for cleanup.

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

mysql_describe_tableC

Get the structure/schema of a specific table

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYesTable name to describe
databaseNoDatabase name (uses current database if not specified)

TDQS

C2.9/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 'gets' information, implying a read-only operation, but does not clarify if it requires specific permissions, what the output format looks like (e.g., column details, data types), or any potential errors (e.g., if the table doesn't exist). This leaves significant gaps in understanding the tool's 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, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy for an AI agent to parse quickly. This exemplifies optimal conciseness.

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?

Given the lack of annotations and output schema, the description is incomplete for a tool that retrieves structural information. It does not explain what the output includes (e.g., column names, types, constraints) or how to interpret it, which is crucial for an AI agent to use the tool effectively. The schema covers parameters well, but overall context is lacking.

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, clearly documenting both parameters ('table' and 'database') with their purposes and optionality. The description adds no additional parameter semantics beyond what the schema provides, such as examples or constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 tool's purpose with a specific verb ('Get') and resource ('structure/schema of a specific table'), making it easy to understand what it does. However, it does not explicitly distinguish this tool from sibling tools like 'mysql_show_indexes' or 'mysql_get_table_stats', which might also provide structural information, so it falls short of a perfect score.

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 does not mention sibling tools like 'mysql_list_tables' (for listing tables) or 'mysql_show_indexes' (for index details), nor does it specify prerequisites such as needing an active connection. This lack of contextual usage information limits its helpfulness for an AI agent.

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

mysql_disconnectB

Disconnect from the MySQL database

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/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. 'Disconnect' implies a state change operation, but the description doesn't specify whether this closes all connections or just the current session, whether it's reversible, what happens to pending transactions, or any cleanup behavior. For a state-changing tool with zero annotation coverage, this is inadequate.

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 states exactly what the tool does with zero wasted words. It's appropriately sized for a zero-parameter tool and front-loads the essential information immediately.

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?

For a zero-parameter connection management tool with no output schema, the description covers the basic action but leaves important behavioral questions unanswered. Without annotations or output schema, the description should address more about what 'disconnect' actually means operationally - whether it's immediate, what gets cleaned up, and what state the system is left in.

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 with 100% schema description coverage, so the schema already fully documents the parameter situation. The description correctly implies no parameters are needed, establishing baseline 4. No additional parameter semantics are required or provided.

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 ('from the MySQL database'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings beyond the obvious - it doesn't explain why you'd use this versus simply not calling mysql_connect or letting connections time out naturally.

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 (must be connected first), doesn't specify when disconnection is necessary versus optional, and doesn't reference sibling tools like mysql_connect that establish the connection being terminated.

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

mysql_get_table_statsC

Get statistics about a table (row count, size, etc.)

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYesTable name to get statistics for
databaseNoDatabase name (uses current database if not specified)

TDQS

C2.9/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. It states it's a read operation ('Get'), but doesn't disclose behavioral traits such as performance impact, permissions required, whether it's cached or real-time, or error handling. This leaves significant gaps for a tool that interacts with a database.

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 a single, efficient sentence that front-loads the purpose. It avoids unnecessary words, though 'etc.' is vague and could be more precise. Overall, it's appropriately sized for a simple tool.

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?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what statistics are returned (e.g., format, specific metrics beyond row count and size), behavioral context, or usage guidelines. For a database tool with potential complexity, this leaves the agent under-informed.

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 fully documents both parameters (table and database). The description adds no additional meaning beyond implying statistics are for a table, which is already clear from the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 verb 'Get' and resource 'statistics about a table', specifying the type of information (row count, size, etc.). It distinguishes from siblings like mysql_describe_table (schema structure) and mysql_query (general queries), though not explicitly named. However, it could be more specific about what 'etc.' includes.

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?

No explicit guidance on when to use this tool versus alternatives. It doesn't mention siblings like mysql_describe_table for schema details or mysql_query for custom statistics, nor does it specify prerequisites (e.g., connection state). Usage is implied by the purpose but lacks clear differentiation.

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

mysql_list_databasesA

List all databases on the MySQL server

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/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 databases but doesn't describe output format (e.g., array of strings), pagination, error handling, or permissions required. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves 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, efficient sentence with zero waste—it directly states the tool's purpose without redundancy. It's appropriately sized for a simple, parameter-less tool and is front-loaded with the core action, making it easy 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 simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate but lacks depth. It covers the basic purpose but doesn't address behavioral aspects like output format or dependencies (e.g., connection state). For a tool with no structured data to rely on, it should provide more context to be fully helpful to an agent.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have mentioned implicit context (e.g., relies on an existing connection). Since there are no parameters, a baseline of 4 is applied, as the description doesn't need to compensate for any gaps.

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 ('List all databases') and the target resource ('on the MySQL server'), using specific verb+resource phrasing. It distinguishes this tool from siblings like mysql_list_tables (which lists tables within a database) and mysql_query (which executes SQL queries), making its purpose unambiguous.

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., requiring a connection via mysql_connect), exclusions (e.g., not for filtering or querying), or comparisons to siblings like mysql_get_table_stats. Without such context, the agent must infer usage from the tool name alone.

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

mysql_list_tablesB

List all tables in the current or specified database

ParametersJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (uses current database if not specified)

TDQS

B3.3/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 action ('List all tables') but doesn't describe behavioral traits such as whether this is a read-only operation, potential permissions required, rate limits, or what the output format looks like (e.g., list of table names, pagination). For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

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 tool's purpose without unnecessary words. It is front-loaded with the core action and scope, making it easy to parse. Every part of the sentence earns its place by specifying what is listed and under what conditions.

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 optional parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and parameter context, but lacks details on behavioral aspects and output, which are important for a tool with no annotations. For a simple list operation, it meets the minimum viable threshold but doesn't provide a complete picture 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?

The input schema has 1 parameter with 100% description coverage, documenting that 'database' is optional and defaults to the current database. The description adds minimal value beyond the schema by mentioning 'current or specified database,' which aligns with the schema but doesn't provide additional semantics like format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate.

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 verb ('List') and resource ('tables'), specifying scope ('all tables in the current or specified database'). It distinguishes from some siblings like mysql_describe_table (single table details) and mysql_list_databases (databases instead of tables), but doesn't explicitly differentiate from mysql_get_table_stats which also operates on tables. The purpose is specific and actionable.

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 by mentioning 'current or specified database,' which helps understand when to specify the database parameter. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like mysql_list_databases (for listing databases) or mysql_get_table_stats (for table statistics). No exclusions or prerequisites are mentioned.

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

mysql_queryC

Execute a SQL query on the connected MySQL database

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query to execute
parametersNoParameters for prepared statement (optional)

TDQS

C2.9/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. It states the action ('execute a SQL query') but omits critical traits such as whether it supports read/write operations, potential side effects (e.g., data modification), error handling, or performance implications (e.g., query timeouts). This leaves significant gaps for a tool that could perform destructive actions.

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 directly states the tool's function without unnecessary words. It is front-loaded with the core action, making it easy to parse, and every part of the sentence contributes to understanding the 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?

Given the complexity of executing SQL queries (which can range from safe reads to destructive writes), the lack of annotations and output schema makes the description incomplete. It fails to address behavioral risks, return formats, or error conditions, which are crucial for an agent to use this tool safely and effectively in a database context.

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 fully documents the 'query' and 'parameters' fields. The description adds no additional meaning beyond what the schema provides, such as query syntax examples or parameter usage details, but this is acceptable given the high schema coverage, resulting in a baseline score.

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 verb ('execute') and resource ('SQL query on the connected MySQL database'), making the purpose immediately understandable. However, it does not explicitly differentiate from siblings like mysql_describe_table or mysql_list_tables, which also involve database operations but with different intents.

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 lacks context on prerequisites (e.g., requiring mysql_connect first), exclusions (e.g., not for schema changes), or comparisons to siblings like mysql_get_table_stats for specific query types, leaving the agent to infer usage.

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

mysql_show_indexesC

Show indexes for a specific table

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYesTable name to show indexes for
databaseNoDatabase name (uses current database if not specified)

TDQS

C2.9/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 what the tool does but doesn't describe behavioral traits such as whether it's read-only (implied by 'Show'), what permissions are required, the format of the output (e.g., a list of indexes with columns), or any rate limits. The description is minimal and lacks essential context for safe and effective use.

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: 'Show indexes for a specific table.' It is front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a simple tool. Every part of the sentence earns its place by conveying essential information without redundancy.

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?

Given the tool's moderate complexity (2 parameters, no annotations, no output schema), the description is incomplete. It lacks information on output format, behavioral traits (e.g., read-only nature, error handling), and usage context. While the schema covers parameters well, the description doesn't compensate for missing annotations or output schema, leaving gaps in understanding how to interpret results.

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 clear documentation for both parameters ('table' and 'database'). The description doesn't add any meaning beyond what the schema provides—it mentions 'a specific table' but doesn't elaborate on parameter usage or constraints. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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 'Show indexes for a specific table' clearly states the verb ('Show') and resource ('indexes'), making the purpose immediately understandable. It distinguishes from siblings like mysql_describe_table (which shows table structure) and mysql_list_tables (which lists tables), though it doesn't explicitly name these alternatives. The description is specific but lacks explicit sibling differentiation.

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., requiring a connection via mysql_connect), exclusions, or comparisons to siblings like mysql_describe_table (which might include index info) or mysql_get_table_stats (which could have index statistics). Usage is implied from the name but not articulated.

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

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no ambiguity. Tools like mysql_describe_table (structure), mysql_get_table_stats (statistics), and mysql_show_indexes (indexes) target specific metadata aspects, while mysql_query handles general SQL execution. The connection/disconnection tools are also clearly separated from data operations.

Naming Consistency5/5

All tools follow a consistent 'mysql_verb_noun' pattern with snake_case throughout. The naming is predictable and readable, making it easy for agents to understand the action and target (e.g., mysql_list_databases, mysql_describe_table). No deviations or mixed conventions are present.

Tool Count5/5

With 8 tools, the server is well-scoped for MySQL database interaction. It covers essential operations like connection management, metadata inspection, and query execution without being overly complex or sparse. Each tool earns its place by addressing a specific need in the domain.

Completeness4/5

The tool set provides strong coverage for core MySQL operations, including connection lifecycle, database/table listing, schema inspection, and query execution. A minor gap exists in data manipulation (e.g., no dedicated tools for insert/update/delete beyond mysql_query), but agents can work around this using the general query tool.

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

Appeared in Searches

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/Darkstar326/mcp-mysql'

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