Skip to main content
Glama
midnight480

Cacoo Remote MCP Server

by midnight480

Cacoo Remote MCP Server

一个用于 Cacoo API 的远程 MCP 服务器, 可部署到 Cloudflare Workers、AWS Lambda、Google Cloud Run 或 Azure Container Apps。

与本地 stdio MCP 服务器不同,它以托管 HTTP 端点的形式运行:您只需在浏览器中 通过 OAuth 认证一次,您的 Cacoo API 密钥就永远不会离开服务器。

日语版

功能

  • 14 个 MCP 工具,涵盖图表、文件夹、组织和账户信息

  • OAuth 2.1 + PKCE —— 客户端在浏览器中完成认证,客户端无需 API 密钥

  • 邮箱允许列表 —— 在上游 IdP 之上提供应用级授权

  • 多个 Cacoo 账户 —— 按调用路由,并带有按账户的只读保护

  • 四个部署目标,共享相同的工具实现

Related MCP server: AccelMCP

选择部署方式

Cloudflare

AWS

Google Cloud

Azure

运行时

Workers(边缘)

Lambda + API Gateway

Cloud Run

Container Apps

MCP 会话

Durable Objects

无状态

无状态

无状态

OAuth 授权服务器

@cloudflare/workers-oauth-provider

src/oauth

src/oauth

src/oauth

上游 IdP

Cloudflare Access

Amazon Cognito

Google 账户

Microsoft Entra ID

状态存储

Workers KV

DynamoDB(TTL)

Firestore(TTL)

Cosmos DB(TTL)

密钥

Workers Secrets

Secrets Manager

Secret Manager

Key Vault

IaC

wrangler

三 AMS

Terraform

Bicep

配置文件

.dev.vars

infra/aws/params.yaml

infra/gcp/terraform.tfvars

infra/azure/params.json

工具及其行为在所有这些平台上都是相同的。每个平台都可以使用 Google 或 Microsoft Entra ID 作为上游 IdP;表中显示的是默认值。

架构

同一个 MCP 服务器运行在四个平台上。每个平台子图都保留自己的接线——网关、存储和上游 IdP——而基于 Node 的子图汇总到共享的 src/oauth, 后者又使用 src/core

flowchart TB
    subgraph clients["MCP clients"]
        direction LR
        CC["Claude Code<br/><i>native HTTP transport</i>"]
        CD["Claude Desktop / Kiro / Cursor<br/><i>mcp-remote proxy</i>"]
    end

    subgraph cf["Cloudflare &nbsp;&nbsp; src/platforms/cloudflare"]
        direction TB
        CFW["Workers &nbsp;&nbsp; <i>OAuthProvider</i>"]
        CFA["Cloudflare Access<br/><i>or Google / Entra ID</i>"]
        CFKV["KV &nbsp;&nbsp; <i>OAUTH_KV</i>"]
        CFDO["Durable Object<br/><i>CacooMCP session</i>"]
        CFW -. "OIDC" .-> CFA
        CFW --- CFKV
        CFW --> CFDO
    end

    subgraph aws["AWS &nbsp;&nbsp; src/platforms/aws"]
        direction TB
        APIGW["API Gateway<br/><i>HTTP API + ACM + Route 53</i>"]
        LAMBDA["Lambda &nbsp;&nbsp; <i>nodejs22 / arm64</i>"]
        COG["Amazon Cognito"]
        DDB["DynamoDB &nbsp;&nbsp; <i>OAuth state</i>"]
        SM["Secrets Manager<br/><i>Cacoo API keys</i>"]
        APIGW --> LAMBDA
        LAMBDA -. "OIDC" .-> COG
        LAMBDA --- DDB
        LAMBDA --- SM
    end

    subgraph gcp["Google Cloud &nbsp;&nbsp; src/platforms/gcp"]
        direction TB
        RUN["Cloud Run &nbsp;&nbsp; <i>container</i>"]
        GID["Google account"]
        FS["Firestore &nbsp;&nbsp; <i>OAuth state</i>"]
        GSM["Secret Manager"]
        RUN -. "OIDC" .-> GID
        RUN --- FS
        RUN --- GSM
    end

    subgraph azure["Azure &nbsp;&nbsp; src/platforms/azure"]
        direction TB
        ACA["Container Apps &nbsp;&nbsp; <i>container</i>"]
        ENT["Entra ID"]
        COS["Cosmos DB &nbsp;&nbsp; <i>OAuth state</i>"]
        AKV["Key Vault"]
        ACA -. "OIDC" .-> ENT
        ACA --- COS
        ACA --- AKV
    end

    subgraph oauth["src/oauth &nbsp;&nbsp; shared by Node runtimes"]
        OP["provider.ts &nbsp;&nbsp; <i>OAuth authorization server</i>"]
        OS["store.ts &nbsp;&nbsp; <i>AuthStore interface</i>"]
        OP --- OS
    end

    subgraph shared["src/core &nbsp;&nbsp; every runtime"]
        CS["create-server.ts<br/><i>tool registration + email allowlist</i>"]
        TOOLS["tools/ &nbsp;&nbsp; <i>14 MCP tools</i>"]
        BC["cacoo-client.ts<br/><i>account routing + readOnly guard</i>"]
        CS --> TOOLS --> BC
    end

    CACOO["Cacoo API &nbsp;&nbsp; <i>/api/v1</i>"]

    clients == "Streamable HTTP + OAuth" ==> CFW
    clients == "Streamable HTTP + OAuth" ==> APIGW
    clients == "Streamable HTTP + OAuth" ==> RUN
    clients == "Streamable HTTP + OAuth" ==> ACA

    CFDO --> CS
    LAMBDA --> OP
    RUN --> OP
    ACA --> OP
    OP --> CS

    DDB -. "implements AuthStore" .-> OS
    FS -. "implements AuthStore" .-> OS
    COS -. "implements AuthStore" .-> OS

    BC == "per-account API key" ==> CACOO

请求流程

sequenceDiagram
    autonumber
    participant C as MCP client
    participant S as Worker / Lambda / Container
    participant I as Upstream IdP
    participant K as Cacoo

    C->>S: POST /mcp
    S-->>C: 401 + OAuth metadata
    C->>S: authorize
    S->>I: redirect to upstream OIDC
    I-->>S: callback with identity
    Note over S: email allowlist check<br/>reject -> access_denied tool only
    S-->>C: access token
    C->>S: tools/list, tools/call
    Note over S: resolve account -> pick API key<br/>readOnly guard blocks writes
    S->>K: Cacoo REST API v1
    K-->>S: JSON / PNG / XML
    S-->>C: MCP result

授权分两层进行。上游 IdP 决定可以登录,邮箱允许列表决定谁拥有哪些工具:对于不在允许列表中的用户,服务器只暴露 access_denied。账户上的 readOnly 标志会拒绝 API 客户端记录中的所有非 GET 请求,因此不能单独工具绕过。

目录结构

按可复用程度划分三层:

src/
  core/                    Every runtime. Depends only on the MCP SDK and zod
    cacoo-client.ts        Cacoo API client (account routing + readOnly guard)
    tools/                 14 MCP tools
    create-server.ts       MCP server assembly and authorization
  oauth/                   Node runtimes. OAuth authorization server (Express)
    provider.ts            OAuthServerProvider implementation
    store.ts               AuthStore interface — the persistence port
    upstream.ts            Upstream OIDC client
    consent.ts             Consent screen
    app.ts                 Express app exposing /authorize, /token, /mcp, ...
  platforms/
    cloudflare/            Workers wiring (uses its own Workers OAuth provider)
    aws/                   Lambda wiring + DynamoDB / Secrets Manager adapters
    gcp/                   Cloud Run wiring + Firestore / Secret Manager adapters
    azure/                 Container Apps wiring + Cosmos DB / Key Vault adapters
infra/
  aws/                     SAM template and parameters
  gcp/                     Terraform configuration
  azure/                   Bicep template and parameters

src/platforms/<name> 是唯一会出现云 SDK 的位置。再添加一个基于 Node 的平台需要实现 AuthStore、一个密钥查找函数,以及一个可将 Express 应用交给运行时的入口点。

配置

账户是配置为单个 JSON 字符串,CACOO_ACCOUNTS_CONFIG。 有关如何获取密钥并找到你的 organizationKey,请参阅 Cacoo API 密钥与账户配置

{
  "accounts": [
    { "name": "main", "apiKey": "xxx", "organizationKey": "your-org-key" },
    { "name": "shared", "apiKey": "yyy", "readOnly": true }
  ],
  "defaultAccount": "main"
}

字段

说明

name

每个工具 account 参数所用的名称

apiKey

Cacoo API 密钥。在 https://cacoo.com/profile/api 生成

organizationKey

diagram 和 folder 工具的默认组织。非 legacy 计划必填;工具每次调用可覆盖

readOnly

true 时,拒绝所有非 GET 调用

baseUrl

默认为 https://cacoo.com

从 MCP 客户端连接

Claude Code

claude mcp add --transport http cacoo https://<your-domain>/mcp -s user

Claude Desktop / Kiro / Cursor

{
  "mcpServers": {
    "cacoo": {
      "command": "npx",
      "args": ["mcp-remote", "https://<your-domain>/mcp"]
    }
  }
}

首次连接时会打开浏览器,要求您进行认证。

Claude Desktop(.mcpb 包)

除了手写上面的 JSON,你还可以双击一个 .mcpb(MCP Bundle)来安装它。它是在部署时生成并写入到 dist/

npm run mcpb:pack   # generate on its own
npm run aws:deploy  # generated as part of the deploy

端点 URL 是一个 user_config 字段,而你所部署到的域会作为其默认值,依次从 --hostMCP_HOSTNAMEinfra/aws/params.yaml 中的 ApiDomainName.dev.vars 中的 MCP_HOSTNAME 解析。

该 bundle 并不包含服务器本身。 MCPB 是一种本地执行格式,因此它附带了 mcp-remote 作为 stdio 代理, 用于连接到你已部署的服务器。Claude Code 不使用此 bundle —— 它会使用 claude mcp add --transport http

可用工具

图表

工具

描述

list_diagrams

列出图表,支持过滤、排序和分页

get_diagram

获取单个图表的详细信息,包括画布和评论

create_diagram

创建新的空白图表

copy_diagram

复制现有图表

move_diagram

将图表移动到其他文件夹

delete_diagram

删除图表

get_diagram_image

图表或单个画布的 PNG 渲染

get_diagram_contents

以 XML 形式返回结构化内容(形状、文本、线条)

工作区

工具

描述

list_accounts

已配置的账户、默认账户,以及哪些账户允许写入

list_folders

账户中的文件夹

list_organizations

组织的组织和用途,包括用作 organizationKeykey

get_account

已认证账户的个人资料

get_license

许可证/套餐详情

get_user

用户的公开个人资料,按姓名获取

安全

  • 身份验证:OAuth 2.1 + PKCE(S256),针对上游 IdP

  • 授权ALLOWED_EMAILS 提供应用级邮箱允许列表。 留空即禁用允许列表,这意味着只要你能通过上游 IdP 登录,就能使用所有工具

  • API 密钥保护:Cacoo API 密钥保留在服务器上,绝不会发送给客户端

  • 客户端授权:动态 Client Registration 开放给所有人,因此授权会 经过一个命名授权客户端及其重定向目标的授权页面(Consent Screen),并使用 CSRF 保护。 审批基于 client_id + redirect_uri

  • 写入保护:标记为 readOnly: true 的账户会拒绝所有非 GET 调用。 该检查存在于 src/core/cacoo-client.ts 中,因此不依赖单个工具

  • 依赖冷却期.npmrc 设置了 min-release-age=3,因此依赖解析只考虑 已公开发布至少三天后的版本

本地开发

npm install
npm run type-check   # all four platforms
npm test             # 108 assertions

测试

覆盖内容

npm run test:cacoo-client

URL 构建、organizationKey 解析、readOnly 保护、错误格式化上限、4MB 图片高容量处理

npm run test:tools

所有 14 个工具能注册;allowlist 门控

npm run test:oauth

DCR、PKCE、一次性令牌、作用域、撤销

npm run test:oauth-consent

HTML 转义、签名 Cookie、CSRF、审批门控

npm run test:oauth-upstream

Cognito / Google / Entra ID 的端点解析

IaC 无需云凭证即可验证:

npm run aws:validate     # sam validate --lint
npm run gcp:validate     # terraform validate
npm run azure:validate   # az bicep build

致谢

工具定义是从 cacoo-mcp-server(本地 stdio)移植而来。 远程服务器架构与 backlog-remote-mcp-server 共享。

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • 34 production API tools over one hosted MCP endpoint.

  • Search, document and execute authenticated API calls across 700+ apps via one MCP server

  • Access Kernel's cloud-based browsers and app actions via MCP (remote HTTP + OAuth).

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/midnight480/cacoo-remote-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server