cadlens-mcp

cadlens-mcp

An MCP server that parses CAD files (.dwg, .dxf, .dwf, etc.) via the Cadlens API, enabling LLM clients to extract and reason over entity, layer, and metadata payloads.

Category
访问服务器

README

cadlens-mcp

npm version GitHub

A Model Context Protocol server that wraps the Cadlens CAD parsing API so MCP-aware LLM clients (Claude Desktop, Claude Code, Cursor, Zed, Windsurf) can parse CAD files (.dwg, .dxf, .dwf, .dwfx, .dgn V7, .pdf, max 100 MB) and reason over the extracted entity, layer, and metadata payloads.

Cadlens converts CAD drawings into structured JSON without requiring AutoCAD or any desktop software — learn more at cadlens.co.

Install

Get an API key from the Cadlens dashboard first — keys start with cadl_ and are created in the dashboard for free.

Claude Desktop / Cursor / Windsurf

Add to your MCP client config (e.g. ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "cadlens": {
      "command": "npx",
      "args": ["-y", "@cadlens/mcp-server"],
      "env": {
        "CADLENS_API_KEY": "cadl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

Claude Code CLI

claude mcp add cadlens \
  --env CADLENS_API_KEY=cadl_xxx \
  -- npx -y @cadlens/mcp-server

Development (build from source)

npm install
npm run build

export CADLENS_API_KEY="cadl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
node dist/index.js

Tools

Tool What it does
cadlens_parse_file Upload a local CAD file, poll until parsed (5 min budget), return summary.
cadlens_parse_url Download a CAD file from a URL, then parse it like parse_file.
cadlens_get_job Cheap status check (PENDING / PROCESSING / COMPLETED / FAILED).
cadlens_get_result Fetch parsed content. mode: summary (default), entities_by_type, entities_on_layer, full.
cadlens_refresh_image_url Re-fetch the 1h presigned PNG URL without re-downloading the full result.
cadlens_list_jobs The 100 most recent jobs for the configured API key.
cadlens_delete_job Delete a job and its S3 artifacts. Irreversible.

Configuration

Env var Required Default Notes
CADLENS_API_KEY yes — Created in the CADLens dashboard.
CADLENS_API_BASE no https://api.cadlens.co/v1 Set to http://localhost:3001/v1 for local dev.
WEBHOOK_PORT no 0 (random) Port for the in-process webhook receiver.
WEBHOOK_PUBLIC_URL no unset Set to a tunnel URL (ngrok/cloudflared) to let CADLens hit the local receiver. When set, parse calls auto-register the webhook and the poller short-circuits on receipt.
REQUEST_TIMEOUT_MS no 30000 Per-HTTP-request timeout for CADLens calls.

Webhook short-circuit (optional)

If WEBHOOK_PUBLIC_URL is set, parse_file / parse_url register a per-process webhook URL alongside the upload. The webhook handler updates an in-memory job-state cache; the poller checks that cache before each HTTP GET and returns early when COMPLETED / FAILED arrives. This trims worst-case latency by up to one full poll tick (~1 s) without changing the tool surface.

Example tunnel setup:

cloudflared tunnel --url http://localhost:8787 &
export WEBHOOK_PORT=8787
export WEBHOOK_PUBLIC_URL="https://<your-tunnel>.trycloudflare.com"

Development

npm run typecheck
npm run lint
npm test
npm run smoke   # tools/list smoke test against built binary

Project-scoped Claude agents

This repo ships five agents under .claude/agents/:

  • cadlens-api-debugger — diagnoses unexplained CADLens 4xx/5xx using mcp-server-reference.md.
  • mcp-tool-tester — drives JSON-RPC against the built server to validate tool responses.
  • mcp-tool-implementer — scaffolds new tools following the existing src/tools/* pattern.
  • cad-drawing-summarizer — uses the MCP tools to summarize a CAD file in natural language.
  • cad-layer-inspector — drills into a single layer of a parsed drawing.

Links


GitHub Topics

Add these topics to this repo for discovery: mcp mcp-server model-context-protocol ai-agents claude cad dwg dxf cad-api llm-tools engineering-api


License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选