Sponsored by Deepsite.site

kintone MCP Server (Python3)

Created By
r3-yamauchi8 months ago
Content

kintone MCP Server (Python3)

kintone REST APIと連携するためのMCP (Model Context Protocol) サーバーです。

Ask DeepWiki

機能

  • kintoneアプリからのレコード取得
  • kintoneアプリ情報の検索・取得
  • APIトークン認証とパスワード認証の両方をサポート
  • 自動ページネーション処理
  • クエリによるフィルタリング機能
  • すべてのAPIリクエストをPOST + X-HTTP-Method-Overrideで実行

インストール

uv/uvxを使用する場合

# uvxでインストール
uvx kintone-mcp-server-python3

# またはuvでインストール
uv tool install kintone-mcp-server-python3

pipを使用する場合

pip install kintone-mcp-server-python3

設定

サーバーは環境変数で設定します。

環境変数

プロジェクトルートに.envファイルを作成:

# 認証タイプ: "api_token" または "password"
KINTONE_AUTH_TYPE=api_token

# kintoneサブドメイン(必須)
KINTONE_SUBDOMAIN=your-subdomain

# kintoneドメイン(オプション、デフォルト: cybozu.com)
KINTONE_DOMAIN=cybozu.com

# APIトークン認証の場合
KINTONE_API_TOKEN=your-api-token

# パスワード認証の場合
KINTONE_USERNAME=your-username
KINTONE_PASSWORD=your-password

使用方法

サーバーの起動

uvxを使用(推奨)

# uvxで実行
uvx kintone-mcp-server-python3

Pythonを直接使用

# pipインストール後
python3 -m kintone_mcp_server_python3

# ソースコードから(開発時)
cd /path/to/kintone-mcp-server-python3
pip install -e .
python3 -m kintone_mcp_server_python3

# またはメインモジュールを直接実行
python3 src/kintone_mcp_server_python3/__main__.py

利用可能なツール

get_records

ページネーション機能付きでkintoneアプリからレコードを取得します。

パラメータ:

  • app (必須): アプリID
  • query (オプション): レコードをフィルタリングするクエリ文字列
  • fields (オプション): 取得するフィールドコードのリスト
  • limit (オプション): 取得する最大レコード数(デフォルト: 100、最大: 500)
  • offset (オプション): ページネーション用のオフセット(デフォルト: 0)

使用例:

{
  "tool": "get_records",
  "arguments": {
    "app": 123,
    "query": "Status = \"Open\"",
    "fields": ["Title", "Status", "Created_datetime"],
    "limit": 100
  }
}

get_all_records

kintoneアプリから全レコードを取得します(ページネーションを自動処理)。

パラメータ:

  • app (必須): アプリID
  • query (オプション): レコードをフィルタリングするクエリ文字列
  • fields (オプション): 取得するフィールドコードのリスト

使用例:

{
  "tool": "get_all_records",
  "arguments": {
    "app": 123,
    "query": "Created_datetime > \"2024-01-01\"",
    "fields": ["Title", "Status"]
  }
}

get_apps

kintoneアプリの情報を検索・取得します。

パラメータ:

  • name (オプション): アプリ名の部分一致検索(大文字小文字を区別しない)
  • ids (オプション): 取得するアプリIDのリスト
  • codes (オプション): 取得するアプリコードのリスト(完全一致、大文字小文字を区別)
  • space_ids (オプション): スペースIDでフィルタリング
  • limit (オプション): 取得する最大アプリ数(デフォルト: 100、最大: 100)
  • offset (オプション): ページネーション用のオフセット(デフォルト: 0)

使用例:

{
  "tool": "get_apps",
  "arguments": {
    "name": "顧客",
    "limit": 50
  }
}

レスポンス例:

{
  "apps": [
    {
      "appId": "123",
      "code": "CUSTOMER_APP",
      "name": "顧客管理",
      "description": "顧客情報を管理するアプリです",
      "spaceId": "10",
      "createdAt": "2024-01-01T00:00:00Z",
      "creator": {
        "code": "user1",
        "name": "山田太郎"
      },
      "modifiedAt": "2024-01-15T10:30:00Z",
      "modifier": {
        "code": "user2",
        "name": "佐藤花子"
      }
    }
  ],
  "count": 1
}

MCPクライアント設定

MCPクライアントでこのサーバーを使用するには、以下の設定を追加してください:

uvxを使用(推奨)

{
  "mcpServers": {
    "kintone": {
      "command": "uvx",
      "args": ["kintone-mcp-server-python3"],
      "env": {
        "KINTONE_SUBDOMAIN": "your-subdomain",
        "KINTONE_API_TOKEN": "your-api-token"
      }
    }
  }
}

Pythonを直接使用(代替)

{
  "mcpServers": {
    "kintone": {
      "command": "python3",
      "args": ["-m", "kintone_mcp_server_python3"],
      "env": {
        "KINTONE_SUBDOMAIN": "your-subdomain",
        "KINTONE_API_TOKEN": "your-api-token"
      }
    }
  }
}

両方のオプションを含む完全な例

{
  "mcpServers": {
    "kintone": {
      "command": "uvx",
      "args": ["kintone-mcp-server-python3"],
      "env": {
        "KINTONE_SUBDOMAIN": "your-subdomain",
        "KINTONE_API_TOKEN": "your-api-token"
      }
    },
    "kintone-python": {
      "command": "python3",
      "args": ["-m", "kintone_mcp_server_python3"],
      "env": {
        "KINTONE_SUBDOMAIN": "your-subdomain",
        "KINTONE_API_TOKEN": "your-api-token"
      }
    }
  }
}

パス指定について

実行パスの動作

uvxの場合

  • "args": ["kintone-mcp-server-python3"]と指定すると、PyPIからパッケージを自動的にダウンロード・実行
  • カレントディレクトリに関係なく動作
  • インストール不要で利用可能

python3 -mの場合

  • "args": ["-m", "kintone_mcp_server_python3"]と指定
  • pip installでインストール済みの場合、どこからでも実行可能
  • Pythonのモジュール検索パスに依存

相対パス指定

{
  "mcpServers": {
    "kintone-dev": {
      "command": "python3",
      "args": ["./src/kintone_mcp_server_python3/__main__.py"],
      "env": {
        "KINTONE_SUBDOMAIN": "your-subdomain",
        "KINTONE_API_TOKEN": "your-api-token"
      }
    }
  }
}

絶対パス指定

{
  "mcpServers": {
    "kintone-local": {
      "command": "python3",
      "args": ["/path/to/kintone-mcp-server-python3/src/kintone_mcp_server_python3/__main__.py"],
      "env": {
        "KINTONE_SUBDOMAIN": "your-subdomain",
        "KINTONE_API_TOKEN": "your-api-token"
      }
    }
  }
}

開発環境での実行(PYTHONPATH使用)

{
  "mcpServers": {
    "kintone-dev": {
      "command": "python3",
      "args": ["-m", "kintone_mcp_server_python3"],
      "env": {
        "PYTHONPATH": "/path/to/kintone-mcp-server-python3/src",
        "KINTONE_SUBDOMAIN": "your-subdomain",
        "KINTONE_API_TOKEN": "your-api-token"
      }
    }
  }
}

推奨される使用方法

  • 本番環境: pip installまたはuvxを使用(パス指定不要)
  • 開発環境: 絶対パスまたはPYTHONPATH設定
  • テスト環境: pip install -e .(編集可能インストール)後、モジュールとして実行

開発

セットアップ

# リポジトリをクローン
git clone https://github.com/yourusername/kintone-mcp-server-python3.git
cd kintone-mcp-server-python3

# 依存関係をインストール
pip install -e ".[dev]"

テストの実行

pytest

コード品質

# コードフォーマット
black src tests

# リント
ruff check src tests

# 型チェック
mypy src

ライセンス

MIT

貢献

プルリクエストは歓迎します!お気軽にご提出ください。

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp