Skip to main content
Glama
wangguoxi0814

datasource-mcp

datasource-mcp

MySQL datasource MCP server for AI clients (Cursor, Claude Desktop, etc.).

Database Support: Currently supports MySQL only. Support for PostgreSQL, SQLite, and other databases is planned for future releases.

Install

pip install datasource-mcp

If the package is not yet available on your PyPI mirror, use the official index:

pip install datasource-mcp -i https://pypi.org/simple/

Or run without installing (requires uv):

uvx datasource-mcp

Note: uvx datasource-mcp downloads the package and immediately starts the MCP stdio server. It will block the terminal while waiting for a client connection. Configure it in your MCP client instead of running it manually.

Related MCP server: MySQL MCP Server

Cursor / MCP Client Config

Option 1: pip install (local environment)

Run pip install datasource-mcp first, then add this to mcp.json:

{
  "mcpServers": {
    "datasource-mcp": {
      "command": "datasource-mcp",
      "env": {
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "your_password",
        "DB_NAME": "your_database"
      }
    }
  }
}

No pip install required — uvx fetches the package from PyPI and runs it automatically. Requires uv to be installed.

{
  "mcpServers": {
    "datasource-mcp": {
      "command": "uvx",
      "args": ["datasource-mcp"],
      "env": {
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "your_password",
        "DB_NAME": "your_database"
      }
    }
  }
}

After updating the config, click Refresh in the MCP panel to apply changes.

Environment Variables

Variable

Default

Description

DB_HOST

127.0.0.1

MySQL host

DB_PORT

3306

MySQL port

DB_USER

root

MySQL user

DB_PASSWORD

root

MySQL password

DB_NAME

aix

Database name

DB_CONNECT_TIMEOUT

5

Connection timeout (seconds)

Tools

db_exe

Execute SQL and return a JSON string:

{"success": true, "row_count": 1, "truncated": false, "rows": [...]}

Error response:

{"success": false, "error": "error message"}

Local Development

uv sync
uv run datasource-mcp
# or
uv run python -m datasource_mcp

Requires Python >= 3.11.

Available Tools

1 tool
db_exeB

执行 SQL 并返回 JSON 字符串结果。

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL 语句
max_rowsNo查询最大返回行数,防止结果过大导致 MCP 超时

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

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 responsibility for disclosing behavioral traits. It mentions only that it returns JSON, but doesn't disclose potential side effects (e.g., whether writes are possible), security implications, error behavior, or timeout handling. The max_rows parameter hints at timeout concerns, but the description fails to explain this context.

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, extremely concise and front-loaded. It contains no redundant information and every word contributes to the core meaning. This is an ideal size for such a clear-cut 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?

Executing arbitrary SQL is a high-complexity operation with significant potential for side effects and errors. Despite having an output schema (not provided in context), the description lacks crucial information like whether DDL/DML are allowed, read-only vs. write support, authentication requirements, or how errors are returned. The minimal description is inadequate for the risk level.

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%, with both parameters having descriptions in the schema. The tool description adds no additional meaning beyond what the schema already provides. Baseline 3 is appropriate because the schema does the heavy lifting.

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 (execute SQL) and the output format (JSON string). It uses a specific verb and resource, making the tool's function unambiguous. With no sibling tools provided, distinction isn't necessary, so it satisfies the 5-level criterion.

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, nor any context about appropriate use cases. It merely states what it does, leaving the agent to infer usage. There is no mention of exclusions, prerequisites, or recommended scenarios.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev0.1.0
    • First observeddb_exe

TDQS

B3.2/5.0
Disambiguation5/5

With only one tool, there is no ambiguity in tool selection. The tool's description clearly states it executes SQL and returns JSON.

Naming Consistency4/5

A single tool name, db_exe, follows snake_case and is understandable, but it lacks a clear verb_noun pattern. However, consistency is not an issue with only one tool.

Tool Count2/5

The server has only one tool, which is too few for a datasource MCP server. Its apparent scope would typically require multiple tools for connection management, schema inspection, and querying.

Completeness2/5

The tool surface is severely limited; it only executes SQL. There are no tools to list tables, describe schemas, or manage data sources, causing significant gaps for agents.

Maintenance

ActivitySlowing
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
    MCP server that allows Claude AI to interact directly with MySQL databases, enabling query execution and table information retrieval through natural language.
    1
    5
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A MySQL MCP server for secure database interaction, enabling schema inspection, query execution, and RBAC via AI coding assistants.
    1,081
    5
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server that connects AI agents to MySQL databases for schema exploration, data querying, and SQL execution via natural language.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A production-ready MCP server for MySQL database integration with AI agents, enabling database exploration, CRUD operations, schema management, and performance monitoring through natural language.
    285
    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/wangguoxi0814/datasource-mcp'

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