MCP.so
登录

MySQL MCP Server v2

@w2pwinlinux

关于 MySQL MCP Server v2

mcp-server-presupuesto-mysql1

基本信息

分类

数据库

运行时

python

传输方式

stdio

发布者

w2pwinlinux

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-server-presupuesto-mysql1": {
      "command": "python",
      "args": [
        "test_buscar_nombre.py"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MySQL MCP Server v2?

MySQL MCP Server v2 is a Model Context Protocol server that provides an interface to manage and query departmental budget information stored in a MySQL database. It is designed for users who need to securely connect to a MySQL database and perform operations like querying department statuses, registering budget requests, and searching departments by name.

How to use MySQL MCP Server v2?

Install the required Python packages (mcp and mysql-connector-python), edit the db_config dictionary in the Python file to match your MySQL server settings, then start the server by running python mysql_mcp_server_v2.py. You can invoke the available functions (get_estado_completo, registrar_solicitud, buscar_por_nombre) through the MCP protocol.

Key features of MySQL MCP Server v2

  • Secure connection to a MySQL database via context manager.
  • Query complete department status by department code.
  • Register budget requests and update balances with transactions.
  • Search departments by name using partial matching (LIKE).
  • Robust error handling with connection, query, and transaction rollback.
  • Automatic rollback of transactions on errors.

Use cases of MySQL MCP Server v2

  • Retrieve the full budget status (initial budget, requested amount, available balance, paid amount) for a specific department.
  • Register a new budget request for a department and automatically recalculate the available balance.
  • Search for departments by a partial name and get their full budget information.

FAQ from MySQL MCP Server v2

What Python version and dependencies are required?

Python 3.6 or higher is required, along with the mcp and mysql-connector-python packages.

How do I configure the database connection?

Edit the db_config dictionary in the server file (mysql_mcp_server_v2.py) to set the correct MySQL host, port, user, password, and database name.

What database schema is expected?

The server expects a departamentos table containing fields codigo, nombre, inicial, solicitado, saldo, and pagado.

How does the server handle errors?

It implements robust error handling for database connection failures, query errors, and data validation. Transactions are automatically rolled back if an error occurs.

Are there any security considerations for production use?

The default configuration has hardcoded database credentials; for production, you should use environment variables or a secure configuration file.

评论

数据库 分类下的更多 MCP 服务器