MySQL + Feishu MCP Tool
This package provides a Model Context Protocol (MCP) server with:
- Read-only MySQL query capability.
- Feishu remote MCP connection capability.
Features
- Read-only Access: Only allows
SELECTandSHOWstatements for SQL safety. - MySQL SSL Support: Supports SSL connections for cloud databases.
- Feishu Remote MCP: Supports
initialize,tools/list, andtools/callagainst Feishu MCP endpoint. - Feishu Sheets Read/Write: Supports reading and writing Feishu Sheets via Open API.
- Feishu Bitable Read/Write: Supports reading and batch writing Feishu Bitable with optional table clear.
- Env-based Config: Uses
.envfor all credentials and endpoint settings.
Installation
- Clone this repository.
- Install dependencies:
uv sync
Configuration
-
Copy
.env.exampleto.env:cp .env.example .env
-
Edit
.envwith your MySQL and Feishu credentials:MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USER=your_username MYSQL_PASSWORD=your_password MYSQL_DATABASE=your_database # Optional: MySQL SSL MYSQL_USE_SSL=false MYSQL_SSL_CA=/path/to/ca-cert.pem # Feishu MCP FEISHU_MCP_URL=https://mcp.feishu.cn/mcp FEISHU_OPEN_API_URL=https://open.feishu.cn/open-apis FEISHU_MCP_APP_ID=cli_xxx FEISHU_MCP_APP_SECRET=xxx FEISHU_MCP_ALLOWED_TOOLS=search-doc,fetch-doc,create-doc,update-doc
FEISHU_MCP_APP_ID and FEISHU_MCP_APP_SECRET are used to request tenant access token dynamically before each Feishu MCP call.
Usage
Run the MCP server:
mcp-tm
Tools
read_sql
Executes a SQL query and returns the results as JSON.
- Arguments:
query_sql(string): The SQL query to execute (e.g., "SELECT * FROM users LIMIT 10").
- Returns:
- JSON string of the query results.
feishu_list_tools
Lists available Feishu MCP tools under the configured credentials and allowed tool set.
- Arguments:
allowed_tools(string, optional): Comma-separated tool names for this call only.
- Returns:
- JSON-RPC response string from Feishu MCP.
feishu_call_tool
Calls a specific Feishu MCP tool.
- Arguments:
tool_name(string): Tool name to call, for examplefetch-doc.arguments_json(string): JSON object string for tool arguments.allowed_tools(string, optional): Comma-separated tool names for this call only.
- Returns:
- JSON-RPC response string from Feishu MCP.
feishu_read_sheet
Reads data from a Feishu Sheet range.
- Arguments:
spreadsheet_token(string): Spreadsheet token in URL.sheet_id(string): Sheet ID in URL.range_ref(string, optional): Range part for API path. Empty means reading bysheet_id.
- Returns:
- Open API JSON response string.
feishu_write_sheet
Writes data to a Feishu Sheet.
- Arguments:
spreadsheet_token(string): Spreadsheet token in URL.sheet_id(string): Sheet ID in URL.values_json(string): JSON string of either 2D array or object array.start_cell(string, optional): Start cell likeA1.clear_sheet(bool, optional): Clear existing used range before write.
- Returns:
- JSON string with write result and write range.
feishu_read_bitable
Reads records from a Feishu Bitable table.
- Arguments:
app_token(string): Bitable app token.table_id(string): Bitable table ID.page_size(int, optional): Page size (max 500).
- Returns:
- JSON string containing all fetched records.
feishu_write_bitable
Batch writes records into a Feishu Bitable table.
- Arguments:
app_token(string): Bitable app token.table_id(string): Bitable table ID.records_json(string): JSON object array. Keys should match field names.clear_table(bool, optional): Delete existing records before write.
- Returns:
- JSON string with summary including written records and ignored fields.
Metadata
Release files for mcp-tm 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_tm-0.3.0.tar.gz | 8.5 kB | Without provenance | Details for mcp_tm-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_tm-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for mcp_tm-0.3.0-py3-none-any.whl |
Total release size: 18.3 kB
Release files / mcp_tm-0.3.0.tar.gz
| Download URL | mcp_tm-0.3.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52e537490d1e2f722d1b1f15cfdb15aaea928989763937943cb6582be1030dbb
|
|
BLAKE2b-256 checksum How to use checksums |
9a1d56137e3f7ddee163a9b48a15b304dbb877de272fa83664e2c818b31c325e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mcp_tm-0.3.0-py3-none-any.whl
| Download URL | mcp_tm-0.3.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57539350723cafdd60f683ecb9276fab07557d115c04a044d8c94e9d6d33a0fd
|
|
BLAKE2b-256 checksum How to use checksums |
d05e7d5019ea25fc329bb8e77b87f1e16e80b103550dbeb11f7e915bb51521cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mcp-tm 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.