MM

mineru98/mysql-mcp-server

Deployment & DevOps

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

28 stars 6 forks Качество 55 Тренд 11MIT

A server application designed on top of MCP to interact with Cursor and MySQL.

Обзор

Change the database connection information as needed. This will proceed with a pre-configured setup. MCP functionality is available from Cursor version 0.46 and above. Additionally, the MCP feature is only accessible to Cursor Pro account users. - Adding a Tool - execute functions implement the actual logic execution (Service Layer). - The @tool decorator helps register the tool with MCP (Controller Layer). - Explanation - Each file under mysql_mcp_server/executors represents a single tool. - If a new tool is added, it must be imported in mysql_mcp_server/executors/.py and included in the array. - This ensures the module is automatically registered in the TOOLS_DEFINITION variable.

README

Показан фрагмент оригинального README. Открыть оригинал.

mysql-mcp-server

한국어 README.md

0. Execution

Running with Docker

Change the database connection information as needed.

docker run -d --name mcp-mysql \
  -e MYSQL_HOST=localhost \
  -e MYSQL_PORT=3306 \
  -e MYSQL_USER=root \
  -e MYSQL_PASSWORD=mcpTest1234!!! \
  -e MYSQL_DATABASE=mcp_test \
  -e MCP_PORT=8081 \
  -p 3306:3306 mineru/mcp-mysql:1.0.0

Running with Docker Compose

This will proceed with a pre-configured setup.

docker-compose up -d

Running directly with Python

pip install -r requirements.txt
python mysql_mcp_server/main.py run

Cursor Configuration

MCP functionality is available from Cursor version 0.46 and above.

Additionally, the MCP feature is only accessible to Cursor Pro account users.

Tool Addition Tips

  • Adding a Tool
    • execute functions implement the actual logic execution (Service Layer).
    • The @tool decorator helps register the tool with MCP (Controller Layer).
  • Explanation
    • Each file under mysql_mcp_server/executors represents a single tool.
    • If a new tool is added, it must be imported in mysql_mcp_server/executors/__init__.py and included in the __all__ array.
    • This ensures the module is automatically registered in the TOOLS_DEFINITION variable.
flowchart LR;
    A[AI Model] -->|Request tool list| B[MCP Server]
    B -->|Return available tools| A

    A -->|Request specific tool execution| B
    B -->|Call the corresponding executor| C[Executors]
    
    subgraph Executors
        C1[execute_create_table] -->|Create table| D
        C2[execute_desc_table] -->|View table schema| D
        C3[execute_explain] -->|Query execution plan| D
        C4[execute_insert_query] -->|Execute INSERT query| D
        C5[execute_insight_starter] -->|Checking the schema for building reports| D
        C6[execute_invoke_viz_pro] -->|Visualization chart recommendations| D
        C7[execute_select_query] -->|Execute SELECT query| D
        C8[execute_show_tables] -->|Retrieve table list| D
    end

    D[DatabaseManager] -->|Connect to MySQL| E[MySQL 8.0]

    E -->|Return results| D
    D -->|Send results| C
    C -->|Return results| B
    B -->|Return execution results| A

🚧 Development Roadmap 🚧

  • ⚙️ Parameter Options

    • [ ] 🔧 Enable/Disable Switch for Each Tool: Provide a function to reduce Input Context costs 💰
    • [ ] 🔒 Query Security Level Setting: Offer optional control over functions that could damage asset value, such as DROP, DELETE, UPDATE 🚫
  • ✨ Features

    • [x] 📊 Data Analysis Report Generation: Provide a report generation function optimized for the model to appropriately select various charts based on user requests 📈
Открыть полный README на GitHub

Установка

docker run -d --name mcp-mysql \
Новичок в MCP? Начните с руководства на mcpskill.org →