MCP Server for cli-kintone logo

MCP Server for cli-kintone

by r3-yamauchi

This is an experimental repository exploring the possibility of turning cli-kintone into an MCP (Model Context Protocol) Server. It allows AI assistants to interact with kintone data through a standardized interface.

View on GitHub

Last updated: N/A

MCP Server for cli-kintone

これは cli-kintone を MCP (Model Context Protocol) Server化できないかという発想をもとに検証している実験的なリポジトリです。

機能

現在、以下の機能をサポートしています:

  • get_records: kintoneアプリからレコードを取得

インストール

# リポジトリをクローン
git clone https://github.com/r3-yamauchi/mcp-server-cli-kintone-experimental.git
cd mcp-server-cli-kintone-experimental

# 依存関係をインストール
npm install

# ビルド
npm run clean:lib && npm run build:mcp

使い方

1. MCP設定ファイルの作成

ユーザー名とパスワードによる認証:

{
  "mcpServers": {
    "kintonecli": {
      "command": "node",
      "args": ["/path/to/mcp-server-cli-kintone/start-mcp-server.mjs"],
      "env": {
        "KINTONE_DOMAIN": "your-domain.cybozu.com",
        "KINTONE_USERNAME": "username",
        "KINTONE_PASSWORD": "password"
      }
    }
  }
}

APIトークンによる認証:

{
  "mcpServers": {
    "kintonecli": {
      "command": "node",
      "args": ["/path/to/mcp-server-cli-kintone/start-mcp-server.mjs"],
      "env": {
        "KINTONE_DOMAIN": "your-domain.cybozu.com",
        "KINTONE_API_TOKEN": "your-api-token1,your-api-token2,your-api-token3"
      }
    }
  }
}

2. APIトークンに関する制限

kintoneのAPIリクエストにおいて、1回のリクエストで指定できるAPIトークンの数は最大9個までです。10個以上指定するとエラーになります。このMCP Serverでは、APIトークンをカンマ区切りで最大9個まで受け取ることができます。10個以上のAPIトークンが指定された場合はエラーとなりますのでご注意ください。

KINTONE_API_TOKEN="token1,token2,token3,token4,token5,token6,token7,token8,token9"

3. MCP設定ファイルの配置

  • Claude Desktop App: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Claude VSCode Extension: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

4. AIアシスタントからの利用

AIアシスタントから以下のようにツールを呼び出すことができます:

use_mcp_tool({
  server_name: "kintonecli",
  tool_name: "get_records",
  arguments: {
    app: "アプリID",
    query: "作成日時 > \"2025-01-01\"",
    fields: ["フィールド1", "フィールド2"]
  }
});

または、ドメインとAPIトークンを直接指定することもできます:

use_mcp_tool({
  server_name: "kintonecli",
  tool_name: "get_records",
  arguments: {
    domain: "your-domain.cybozu.com",
    apiToken: "your-api-token1,your-api-token2,your-api-token3",
    app: "アプリID",
    query: "作成日時 > \"2025-01-01\"",
    fields: ["フィールド1", "フィールド2"]
  }
});

今後の拡張予定

  • create_record: 新規レコードを作成
  • update_record: 既存レコードを更新
  • search_apps: アプリ名で検索
  • import_records: 複数レコードをインポート
  • delete_record: 単一レコードを削除
  • bulk_update_records: 複数レコードを更新
  • bulk_delete_records: 複数レコードを削除

ライセンス

MIT

「kintone」はサイボウズ株式会社の登録商標です。

ここに記載している内容は情報提供を目的としており、個別のサポートはできません。 設定内容についてのご質問やご自身の環境で動作しないといったお問い合わせをいただいても対応はできませんので、ご了承ください。