lcm2m-caddis-mcp

lcm2m-caddis-mcp

Enables read-only access to LCM2M Caddis VM2M API for equipment, runs, telemetry, alarms, etc., via MCP tools.

Category
访问服务器

README

lcm2m-caddis-mcp

An MCP server that exposes the LCM2M Caddis VM2M API to LLM tools like Claude Desktop, Claude Code, and Cursor. Read-only wrappers over equipment, runs, cycles, telemetry, alarms, and more — served as TOON so LLM context stays cheap.

Requirements

  • An LCM2M account (username and password)
  • Node.js 25+ or Docker

Use with an MCP client

The server speaks MCP over stdio and works with any MCP-compatible client — Claude Code, Claude Desktop, Cursor, Windsurf, VS Code (Copilot Chat), Zed, Continue, Cline, Goose, and others. Configure your client to launch npx -y @lcm2m/caddis-mcp with CADDIS_USERNAME and CADDIS_PASSWORD in its env. Concrete examples for the two most common config styles follow.

Claude Code (CLI)

claude mcp add caddis \
  --env CADDIS_USERNAME=you@example.com \
  --env CADDIS_PASSWORD='your-password' \
  -- npx -y @lcm2m/caddis-mcp

Claude Desktop, Cursor, and similar (JSON config)

Most clients accept an mcpServers block in a JSON config file — for example claude_desktop_config.json (Claude Desktop) or .cursor/mcp.json (Cursor):

{
  "mcpServers": {
    "caddis": {
      "command": "npx",
      "args": ["-y", "@lcm2m/caddis-mcp"],
      "env": {
        "CADDIS_USERNAME": "you@example.com",
        "CADDIS_PASSWORD": "your-password"
      }
    }
  }
}

Other clients (Windsurf, VS Code, Zed, Continue, Cline, etc.) use similar formats — consult your client's MCP docs for the exact config path and schema. Restart the client after editing config.

Configuration

Variable Default Description
CADDIS_USERNAME (required) LCM2M account username/email
CADDIS_PASSWORD (required) LCM2M account password
CADDIS_COMPANY_ID (auto) Required if your user belongs to multiple companies
CADDIS_MAX_RETRIES 3 Max 429 retries per request
CADDIS_MAX_RETRY_WAIT_MS 30000 Max total wait budget per request

Available tools

All tools are read-only and prefixed with caddis_. Each maps 1:1 to a VM2M route; responses are TOON-encoded (a compact, JSON-equivalent format mixing YAML-style nesting with CSV-style tables).

  • Company: get_company
  • Devices: list_devices, get_device
  • Equipment: list_equipment, get_equipment, get_equipment_utilization, get_equipment_schedule, get_equipment_cycles, get_equipment_statuslogs, get_equipment_telemetry, get_equipment_shift_history, list_equipment_excessive_downtimes, get_equipment_excessive_downtime
  • Org units / tree: get_org_unit, get_org_unit_schedule, list_org_unit_excessive_downtimes, get_tree
  • Alarms: list_alarms
  • Tags: list_tags, get_tag, list_tag_groups, get_tag_group
  • Runs: list_runs, get_run, get_run_cycles
  • Status reasons: list_status_reasons

Troubleshooting

  • Missing credentialsCADDIS_USERNAME / CADDIS_PASSWORD aren't reaching the child process. With docker run -e VAR, VAR must also be set in the parent shell.
  • This user belongs to multiple companies… — set CADDIS_COMPANY_ID to one of the numeric IDs listed in the error.
  • 401 Unauthorized — bad creds. Test with:
    curl -X POST https://api.lcm2m.com/vm2m/sessions \
      -H 'Content-Type: application/json' \
      -d '{"username":"you@example.com","password":"...","company_id":1}'
    
  • Persistent 429 — raise CADDIS_MAX_RETRY_WAIT_MS or back off the client's call rate.
  • Blank Inspector page in Firefox — use Chrome/Brave/Edge, or npx @modelcontextprotocol/inspector --cli ....

Alternative install

The MCP client examples above use npx. To run from Docker or a local clone instead, build using one of the methods below and swap the command/args in your client config.

Docker

git clone https://github.com/LCM2M/lcm2m-caddis-mcp.git
cd lcm2m-caddis-mcp
docker build --target runtime -t lcm2m-caddis-mcp .

Command string:

docker run -i --rm -e CADDIS_USERNAME -e CADDIS_PASSWORD lcm2m-caddis-mcp

Local Node

git clone https://github.com/LCM2M/lcm2m-caddis-mcp.git
cd lcm2m-caddis-mcp
npm install
npm run build

Command string: node /absolute/path/to/lcm2m-caddis-mcp/dist/index.js

How it works

  • Auth: first call hits POST /vm2m/sessions → JWT, cached and proactively refreshed 30s before expiry. 401 triggers a single re-login + retry. The Authorization header carries the raw JWT (no Bearer prefix).
  • Rate limiting: backend enforces 20 req/10s per endpoint and 60 req/10s per user. On 429, the client parses Retry-After, applies ±20% jitter, and retries up to CADDIS_MAX_RETRIES (capped by CADDIS_MAX_RETRY_WAIT_MS).
  • Response format: TOON — a token-efficient JSON dialect that mixes YAML-style nesting with CSV-style tables (~40% fewer tokens than JSON). The raw body is passed through, fenced as ```toon ... ``` so the model sees an unambiguous format boundary.
  • Errors: 4xx responses surface as isError: true tool results so the LLM can see the backend error body and recover; 5xx rethrow.

Development

# Create .env.local with CADDIS_USERNAME and CADDIS_PASSWORD (gitignored).
npm install
npm run dev                 # MCP Inspector web UI + tsx
npm test                    # node --test via tsx
npm run build               # tsc -> dist/
npm run typecheck
npm run lint                # biome check

npm run dev opens the MCP Inspector in a Chromium browser (Firefox has rendering issues). Edit source, click Restart, re-run the tool.

Project layout

src/
  index.ts         # MCP server entry (stdio)
  config.ts        # zod env config
  client.ts        # CaddisApiClient: login, retry, rate-limit
  tools/
    schemas.ts     # shared zod helpers + runTool error wrapper
    index.ts       # tool registration
    wrappers/      # 1:1 VM2M route wrappers
    composite/     # higher-level multi-call tools

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选