Skip to main content
Glama
myexperimenthub

local-mysql

Local MySQL MCP Server

This is a small read-only MCP server for a MySQL database running on your machine.

1. Install dependencies

cd C:\Users\ADMIN\Documents\1st\mysql-mcp
npm.cmd install

Related MCP server: MySQL MCP Server

2. Create a restricted MySQL user

Run this in MySQL, replacing the database name and password:

CREATE USER 'mcp_reader'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT SELECT, SHOW VIEW ON your_database.* TO 'mcp_reader'@'localhost';
FLUSH PRIVILEGES;

Avoid using root for MCP access.

3. Configure your MCP client

Use this server command in your MCP client configuration:

{
  "mcpServers": {
    "local-mysql": {
      "command": "node",
      "args": [
        "C:\\Users\\ADMIN\\Documents\\1st\\mysql-mcp\\src\\index.js"
      ],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "mcp_reader",
        "MYSQL_PASSWORD": "strong_password_here",
        "MYSQL_DATABASE": "your_database",
        "MYSQL_MAX_ROWS": "200"
      }
    }
  }
}

Tools

  • query: runs one read-only SQL statement.

  • list_databases: lists databases visible to the MySQL user.

  • list_tables: lists tables in the configured database or a named database.

  • describe_table: shows column metadata for a table.

Current database snapshot

The configured product_db database currently includes these tables:

  • categories

  • customers

  • orders

  • products

  • suppliers

Customer chart

A customer order-count pie chart is available at:

..\customers_pie_chart.svg

The chart shows 5 customers with 1 order each, so every customer represents 20% of the total order count.

Safety

The server rejects non-read-only statements and should still be paired with a restricted MySQL user. Database permissions are the final safety boundary.

Smoke test

This verifies that the MCP server starts and exposes tools. It does not query MySQL.

cd C:\Users\ADMIN\Documents\1st\mysql-mcp
npm.cmd run smoke

Available Tools

4 tools
describe_tableDescribe tableC

Show column metadata for a table.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYes
databaseNo

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 bears full burden. It only states the purpose without disclosing behavior like error handling, authorization needs, or side effects.

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

Conciseness3/5

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

The description is a single sentence, concise and front-loaded with the verb, but it omits necessary structure like parameter or result details.

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, no output schema, and low schema coverage, the description is incomplete, lacking information on return values, parameter formats, and edge cases.

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

Parameters1/5

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

With 0% schema description coverage, the description must explain parameters but does not. The schema has 'table' (required) and 'database' (optional), but no meaning is added.

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 'Show column metadata for a table' clearly states the action (show) and resource (column metadata for a table), distinguishing itself from siblings list_databases, list_tables, and query.

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 column details are needed, but lacks explicit guidance on when to use versus alternatives or any prerequisites.

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

list_databasesList databasesA

List databases visible to the configured MySQL user.

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 provided; description only mentions visibility to the configured user but does not disclose read-only nature, performance, or any side effects. The minimal description inadequately compensates for the lack of annotations.

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?

Single sentence with no extraneous information. Front-loads the key action 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?

For a simple tool with no parameters and no output schema, the description is somewhat complete. However, it does not specify the output format (e.g., list of names) or any error conditions, which would help the 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?

No parameters exist; schema coverage is 100%. Description cannot add further meaning, so baseline score of 4 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?

Description clearly states the tool lists databases and specifies the scope (visible to configured MySQL user). Differentiates from siblings like list_tables and 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?

No guidance on when to use this tool versus alternatives like list_tables or describe_table. Does not state prerequisites or when not to use.

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

list_tablesList tablesA

List tables in the configured database or in the database argument.

ParametersJSON Schema
NameRequiredDescriptionDefault
databaseNo

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states the basic function without mentioning auth requirements, error behavior, side effects, or data limits. This is insufficient for a tool with no annotations.

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 sentence that conveys the essential information without any fluff. It is front-loaded with the action and resource, making it 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 the tool's simplicity (one optional parameter, no output schema), the description is mostly complete. It covers the main function and the optional argument. However, it could be more complete by briefly noting the return value (e.g., list of table names).

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?

With 0% schema description coverage, the description adds meaning by explaining that the 'database' parameter is optional and defaults to the configured database. However, it does not specify valid values, format, or behavior for invalid inputs.

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) and resource (tables), and distinguishes from sibling tools like describe_table, list_databases, and query. It also mentions an optional database argument, adding precision.

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 the tool is used to list tables, but does not explicitly state when to use it versus siblings (e.g., for a specific table use describe_table) or any exclusions. No when-not-to guidance is provided.

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

queryRun read-only SQLB

Run a single read-only MySQL query. SELECT, SHOW, DESCRIBE, DESC, EXPLAIN, and WITH are allowed.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the burden. It declares read-only nature and allowed commands, but does not disclose important behaviors such as error handling, result format, pagination, or size limits.

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, front-loaded with the main purpose, no unnecessary words. Efficient and clear.

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?

With no output schema and no annotations, the description is incomplete. It does not explain the return format (e.g., rows, affected rows, status), which is critical for a query tool. The context of sibling tools is handled but output behavior is missing.

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 schema has only one parameter 'sql' with minLength, and no description in the schema (0% coverage). The description adds that the query must be read-only and lists allowed commands, providing some semantic value beyond the schema.

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?

Title and description clearly state it runs a read-only MySQL query, listing specific allowed commands (SELECT, SHOW, etc.). It distinguishes from sibling tools like describe_table by being the general query tool, though not explicitly.

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?

Description implies use for read-only queries and lists allowed command types, but does not explicitly state when to use this tool vs siblings or when not to use it.

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

TDQS

A3.6/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: describe_table for column metadata, list_databases for databases, list_tables for tables, and query for arbitrary read-only SQL. No overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: describe_table, list_databases, list_tables, query. The pattern is uniform and predictable.

Tool Count5/5

With 4 tools, the set is well-scoped for a read-only MySQL server. It covers the essential operations without unnecessary extras.

Completeness4/5

The tools cover listing databases and tables, describing table structure, and running arbitrary read queries. Minor omissions like SHOW VARIABLES could be added but are accessible via query.

Maintenance

ActivityStale
ResponsivenessNo issues

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
    B
    quality
    D
    maintenance
    Provides secure, read-only access to MariaDB/MySQL databases, allowing users to list databases, explore table schemas, and execute SQL queries with built-in security measures.
    4
    72
    4
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables safe interaction with MySQL databases through SELECT queries, table structure inspection, and database schema exploration. Provides read-only access to query data and examine database metadata.
    1
  • A
    license
    A
    quality
    D
    maintenance
    Enables read-only MySQL database connectivity, allowing execution of SELECT queries, listing tables, and describing table structures via natural language.
    3
    23
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables read-only MySQL database access, allowing listing databases, tables, describing schemas, and executing SELECT/SHOW/DESCRIBE/EXPLAIN queries.
    7
    89
    4
    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/myexperimenthub/Day12'

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