cacoo-mcp
# @mahito1594/cacoo-mcp
README: 日本語 | [English](./README_en.md)
[Cacoo](https://cacoo.com) の非公式 [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) サーバーです。Claude Code や Cursor などの AI コーディングエージェントが Cacoo の図の画像やメタデータを直接参照できるよう、読み取り専用のツールを提供します。
## セットアップ
### 1. Cacoo API キーを取得する
[Cacoo のアカウント設定](https://cacoo.com/app/space/settings/integrations/developer-tools)から API キーを生成してください。
### 2. MCP クライアントを設定する
**Claude Code**: 次のコマンドを実行してください
```bash
claude mcp add --env CACOO_API_KEY=your-api-key-here cacoo-mcp -- npx -y @mahito1594/cacoo-mcp
```
**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json` または `%APPDATA%\Claude\claude_desktop_config.json`):
```json
{
"mcpServers": {
"cacoo-mcp": {
"command": "npx",
"args": ["-y", "@mahito1594/cacoo-mcp"],
"env": {
"CACOO_API_KEY": "your-api-key-here"
}
}
}
}
```
**Cursor** (`.cursor/mcp.json`):
```json
{
"mcpServers": {
"cacoo-mcp": {
"command": "npx",
"args": ["-y", "@mahito1594/cacoo-mcp"],
"env": {
"CACOO_API_KEY": "your-api-key-here"
}
}
}
}
```
### 環境変数
| 変数名 | 必須 | 説明 |
| ------------------------ | ---- | -------------------------------------------------------------------------------------------- |
| `CACOO_API_KEY` | 必須 | Cacoo API キー |
| `CACOO_ORGANIZATION_KEY` | 任意 | デフォルトの組織キー。省略した場合は先に `list_organizations` を呼び出して取得してください。 |
## ツール
| ツール名 | 説明 |
| -------------------- | ---------------------------------------------------------- |
| `list_organizations` | 設定された API キーで利用できる Cacoo 組織の一覧を取得する |
| `list_diagrams` | 図の一覧を取得する(キーワードやフォルダでの絞り込みも可) |
| `get_diagram_sheets` | 図に含まれるシートの一覧(シート ID と名前)を取得する |
| `get_diagram_image` | 図の PNG 画像を Base64 エンコードで取得する |
### 典型的な使用フロー
```
list_organizations() # CACOO_ORGANIZATION_KEY が未設定の場合
list_diagrams(keyword?) # diagramId を特定し sheetCount を確認
if sheetCount > 3:
get_diagram_sheets(diagramId) # sheetId を取得
get_diagram_image(diagramId, sheetId?) # 画像を取得
```
`sheetId` を省略した場合、`get_diagram_image` はすべてのシートを並列で取得します。
## 開発
Node.js >= 22 および [pnpm](https://pnpm.io/) >= 10 が必要です。
[mise](https://mise.jdx.dev/) を用いてインストールしてください。
```bash
pnpm install
pnpm build # TypeScript をコンパイル → dist/index.mjs
pnpm test # テストを実行
pnpm typecheck # 型チェック(出力なし)
pnpm lint # oxlint を実行
```
## Agent Skills
このプロジェクトは以下のサードパーティ Agent Skill を使用しています。
- [contextual-commits](https://github.com/berserkdisruptors/contextual-commits) by Berserk Disruptors — MIT License
以下のコマンドでインストールしてください。
```bash
pnpm dlx skills experimental_install
```
## ライセンス
[MIT](./LICENSE)
TDQS
Scored across 4 tools
Each tool targets a distinct resource and action: organizations, diagrams, sheets, and images. The descriptions explicitly state the dependency chain (list_organizations -> list_diagrams -> get_diagram_sheets -> get_diagram_image), leaving no ambiguity about which tool to pick.
All four names follow a strict verb_noun snake_case pattern (list_organizations, list_diagrams, get_diagram_sheets, get_diagram_image), with the verbs used consistently for their semantic meaning (list for collections, get for a specific artifact).
Four tools is a lean, well-scoped surface for a read-only diagram retrieval server, and each earns its place in the workflow. It sits at the low end, so a small addition (e.g. a direct diagram metadata lookup) would round it out, but nothing feels redundant.
The discovery-to-image pipeline is fully covered: find organizations, find diagrams, enumerate sheets, then fetch PNGs, including sheet selection for large diagrams. Gaps exist only on the write/metadata side (no create, update, or diagram detail fetch), which is minor if the server's purpose is read-only access.