{
  "markdown": "# cadlens-mcp\n\n[![npm version](https://badge.fury.io/js/@cadlens%2Fmcp-server.svg)](https://www.npmjs.com/package/@cadlens/mcp-server)\n[![GitHub](https://img.shields.io/badge/GitHub-cadlens--co%2Fcadlens--mcp-blue?logo=github)](https://github.com/cadlens-co/cadlens-mcp)\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server that wraps the [Cadlens CAD parsing API](https://cadlens.co) 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.\n\n[Cadlens](https://cadlens.co) converts CAD drawings into structured JSON without requiring AutoCAD or any desktop software — learn more at [cadlens.co](https://cadlens.co).\n\n## Install\n\nGet an API key from the [Cadlens dashboard](https://cadlens.co) first — keys start with `cadl_` and are created in the dashboard for free.\n\n### Claude Desktop / Cursor / Windsurf\n\nAdd to your MCP client config (e.g. `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):\n\n```json\n{\n  \"mcpServers\": {\n    \"cadlens\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cadlens/mcp-server\"],\n      \"env\": {\n        \"CADLENS_API_KEY\": \"cadl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code CLI\n\n```bash\nclaude mcp add cadlens \\\n  --env CADLENS_API_KEY=cadl_xxx \\\n  -- npx -y @cadlens/mcp-server\n```\n\n---\n\n## Development (build from source)\n\n```bash\nnpm install\nnpm run build\n\nexport CADLENS_API_KEY=\"cadl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\nnode dist/index.js\n```\n\n## Tools\n\n| Tool | What it does |\n|---|---|\n| `cadlens_parse_file` | Upload a local CAD file, poll until parsed (5 min budget), return summary. |\n| `cadlens_parse_url` | Download a CAD file from a URL, then parse it like `parse_file`. |\n| `cadlens_get_job` | Cheap status check (`PENDING` / `PROCESSING` / `COMPLETED` / `FAILED`). |\n| `cadlens_get_result` | Fetch parsed content. `mode`: `summary` (default), `entities_by_type`, `entities_on_layer`, `full`. |\n| `cadlens_refresh_image_url` | Re-fetch the 1h presigned PNG URL without re-downloading the full result. |\n| `cadlens_list_jobs` | The 100 most recent jobs for the configured API key. |\n| `cadlens_delete_job` | Delete a job and its S3 artifacts. Irreversible. |\n\n## Configuration\n\n| Env var | Required | Default | Notes |\n|---|---|---|---|\n| `CADLENS_API_KEY` | yes | — | Created in the CADLens dashboard. |\n| `CADLENS_API_BASE` | no | `https://api.cadlens.co/v1` | Set to `http://localhost:3001/v1` for local dev. |\n| `WEBHOOK_PORT` | no | `0` (random) | Port for the in-process webhook receiver. |\n| `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. |\n| `REQUEST_TIMEOUT_MS` | no | `30000` | Per-HTTP-request timeout for CADLens calls. |\n\n## Webhook short-circuit (optional)\n\nIf `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.\n\nExample tunnel setup:\n\n```bash\ncloudflared tunnel --url http://localhost:8787 &\nexport WEBHOOK_PORT=8787\nexport WEBHOOK_PUBLIC_URL=\"https://<your-tunnel>.trycloudflare.com\"\n```\n\n## Development\n\n```bash\nnpm run typecheck\nnpm run lint\nnpm test\nnpm run smoke   # tools/list smoke test against built binary\n```\n\n## Project-scoped Claude agents\n\nThis repo ships five agents under `.claude/agents/`:\n\n- `cadlens-api-debugger` — diagnoses unexplained CADLens 4xx/5xx using `mcp-server-reference.md`.\n- `mcp-tool-tester` — drives JSON-RPC against the built server to validate tool responses.\n- `mcp-tool-implementer` — scaffolds new tools following the existing `src/tools/*` pattern.\n- `cad-drawing-summarizer` — uses the MCP tools to summarize a CAD file in natural language.\n- `cad-layer-inspector` — drills into a single layer of a parsed drawing.\n\n## Links\n\n- [Cadlens official website](https://cadlens.co)\n- [Cadlens API documentation](https://cadlens.co/docs)\n- [Cadlens pricing](https://cadlens.co/pricing)\n- [DWG parser for AI agents](https://cadlens.co)\n- [npm package](https://www.npmjs.com/package/@cadlens/mcp-server)\n- [GitHub repository](https://github.com/cadlens-co/cadlens-mcp)\n\n---\n\n## GitHub Topics\n\nAdd these topics to this repo for discovery:\n`mcp` `mcp-server` `model-context-protocol` `ai-agents` `claude` `cad` `dwg` `dxf` `cad-api` `llm-tools` `engineering-api`\n\n---\n\n## License\n\nMIT\n",
  "bytes": 4798,
  "sha": "bcc738b86559285e0c4dd73779322a6718771568a02c0df7925e949ad1ff6a93",
  "repo_slug": "cadlens-co/cadlens-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_cadlens_co_cadlens_mcp_36dbf791/readme"
}