Skip to main content

MCP server tools for Tsurugi using tsubakuro-rust-python

Project description

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 実行(queryWITH 句許可、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 ファイルを参照してください。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsurugi_python_mcp_tools-0.1.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsurugi_python_mcp_tools-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file tsurugi_python_mcp_tools-0.1.0.tar.gz.

File metadata

  • Download URL: tsurugi_python_mcp_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for tsurugi_python_mcp_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d525ee70171b66f1f2f84f709c4668b3bb62ac942d6df2706ed11ddcae917d54
MD5 ae987ce990de58331084728e61345ef3
BLAKE2b-256 e93fc22a0fd6ac29b53e23eb91616715404d53aec0f098941037b361d3563988

See more details on using hashes here.

File details

Details for the file tsurugi_python_mcp_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tsurugi_python_mcp_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33fabe562ab445841a3073ea0ba977e44081608fabfe72ebd00fb639d54ff0f0
MD5 618f2633110163762270e62cc6f2dabe
BLAKE2b-256 f0fc4d51521941265415791be6b6201d1ed1575318fa48f62dfd53d93cfd7477

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page