Skip to main content

阿里云百炼MCP服务器 - MySQL业务查询服务

这是一个专为阿里云百炼平台设计的MCP(Model Context Protocol)服务器,提供MySQL数据库的业务查询功能。

功能特性

  • 🚀 支持HTTP传输协议,兼容阿里云百炼
  • 🗄️ 提供7个核心业务查询工具
  • 🔧 支持跨数据库查询
  • 📊 返回中文字段名,便于理解
  • 🛡️ 安全的数据库连接管理

业务工具

  1. get_user_info - 获取用户基本信息
  2. get_user_courses - 获取用户课程列表
  3. get_user_cases - 获取用户案例分析
  4. get_user_orders - 获取用户订单信息
  5. get_user_invoices - 获取用户发票信息
  6. get_user_study_plans - 获取用户学习计划
  7. get_course_study_plans - 获取课程学习计划

安装

pip install mcp-mysql-bailian-licai

配置

环境变量

export MYSQL_HOST="your-mysql-host"
export MYSQL_PORT="3306"
export MYSQL_USER="your-username"
export MYSQL_PASSWORD="your-password"
export MYSQL_DATABASES="database1,database2"
export MCP_SERVICE_PORT="8001"

MCP配置文件

{
  "mcpServers": {
    "licai_mysql_mcp": {
      "type": "http",
      "command": "uvx",
      "args": [
        "main:mcp.run",
        "--transport", "http",
        "--host", "0.0.0.0",
        "--port", "8001"
      ],
      "env": {
        "MCP_SERVICE_NAME": "licai_mysql_mcp",
        "MCP_SERVICE_PORT": "8001",
        "MYSQL_HOST": "your-mysql-host",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your-username",
        "MYSQL_PASSWORD": "your-password",
        "MYSQL_DATABASES": "database1,database2"
      }
    }
  }
}

使用方法

直接启动

mcp-mysql-bailian-licai

程序化使用

from mcp_mysql_server.server import main

# 设置环境变量后启动
main()

许可证

MIT License

Metadata

Release files for mcp-mysql-bailian-licai-202509111610-66e8a1 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-mysql-bailian-licai-202509111610-66e8a1 2.0.0
File Size Uploaded
mcp-mysql-bailian-licai-202509111610-66e8a1-2.0.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-mysql-bailian-licai-202509111610-66e8a1 2.0.0
File Interpreter ABI Platform
mcp_mysql_bailian_licai_202509111610_66e8a1-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 kB

Release files / mcp-mysql-bailian-licai-202509111610-66e8a1-2.0.0.tar.gz

Download URL mcp-mysql-bailian-licai-202509111610-66e8a1-2.0.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a4c04933998fef1c03a16d61a870dd29e1075528830e8bb28fb2f15c5e4d1ad4
BLAKE2b-256 checksum
How to use checksums
137f60702b6e10068c79c600fb531e9f7c79c4c3615d88c63c43b8d1268c3e34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.0

Release files / mcp_mysql_bailian_licai_202509111610_66e8a1-2.0.0-py3-none-any.whl

Download URL mcp_mysql_bailian_licai_202509111610_66e8a1-2.0.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
249d26c752ad321073e5844eeff6c406f7a8802f7780b3e118faf924ec9a939f
BLAKE2b-256 checksum
How to use checksums
14a177e6146563e990f6a585331f7063196c82125b5d03fdd1f80fe20ddf3137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.0

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page