Skip to main content

tsurugi-python-mcp-tools

tsurugi-python-mcp-tools は、Tsurugi RDBMS を MCP ツールとして利用するための Python 製 MCP サーバです。
Java版の tsurugi-mcp-server を参考に作成しています。 内部で tsurugi-dbapi を利用し、fastmcp により HTTP transport の MCP サーバを提供します。

主な機能

  • DDL 実行(executeDdl: CREATE / DROP)
  • DML 実行(update: INSERT / UPDATE / DELETE)
  • SELECT 実行(query、WITH 句許可、WITH RECURSIVE は非対応)
  • テーブルメタデータ取得(getTableMetadata)
  • テーブル名一覧取得(listTableNames)
  • SQL 入力の基本バリデーションとエラーハンドリング(ToolInputError / ToolExecutionError)

動作要件

  • Python 3.10 以上
  • 依存パッケージ: fastmcp, tsurugi-dbapi
  • 接続先に Tsurugi RDBMS が起動していること

主な設定(環境変数)

  • TSURUGI_ENDPOINT(必須): 例 tcp://localhost:12345
  • TSURUGI_DEFAULT_TIMEOUT(任意、既定値 30)
  • TSURUGI_AUTH_TOKEN(任意)
  • MCP_HOST(任意、既定値 127.0.0.1)
  • MCP_PORT(任意、既定値 8000)
  • MCP_PATH(任意、既定値 /mcp)

起動方法

.\wenv\Scripts\python -m tsurugi_python_mcp_tools

pip install 後は、コンソールコマンドでも起動できます。

tsurugi-mcp

認証方式は起動オプションで明示指定できます。

  • --user <user> --password <password>
  • --auth-token <auth-token>
  • --credentials <path-to-credential-file>
  • --no-auth

また、--enable-tools で実行可能ツールを制限でき、--resource / --prompt で resource/prompt 提供の有効・無効を制御できます。

mcp.jsonの例

{
    "mcpServers": {
        "tsurugi-python-mcp-tools": {
            "type": "http",
            "url": "http://localhost:8000/mcp"
        }
    }
}

ライセンス

本プロジェクトは Apache License 2.0 の下で提供されています。
詳細は LICENSE ファイルを参照してください。

Metadata

Release files for tsurugi-python-mcp-tools 0.1.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 tsurugi-python-mcp-tools 0.1.0
File Size Uploaded Provenance Actions
tsurugi_python_mcp_tools-0.1.0.tar.gz 15.4 kB Without provenance Details for tsurugi_python_mcp_tools-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tsurugi-python-mcp-tools 0.1.0
File Interpreter ABI Platform Actions
tsurugi_python_mcp_tools-0.1.0-py3-none-any.whl Python 3 none any Details for tsurugi_python_mcp_tools-0.1.0-py3-none-any.whl

Total release size: 30.0 kB

Release files / tsurugi_python_mcp_tools-0.1.0.tar.gz

Download URL tsurugi_python_mcp_tools-0.1.0.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d525ee70171b66f1f2f84f709c4668b3bb62ac942d6df2706ed11ddcae917d54
BLAKE2b-256 checksum
How to use checksums
e93fc22a0fd6ac29b53e23eb91616715404d53aec0f098941037b361d3563988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / tsurugi_python_mcp_tools-0.1.0-py3-none-any.whl

Download URL tsurugi_python_mcp_tools-0.1.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33fabe562ab445841a3073ea0ba977e44081608fabfe72ebd00fb639d54ff0f0
BLAKE2b-256 checksum
How to use checksums
f0fc4d51521941265415791be6b6201d1ed1575318fa48f62dfd53d93cfd7477
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for tsurugi-python-mcp-tools 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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