npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@atlisp/mcp

v1.0.19

Published

MCP Server for @lisp on CAD

Downloads

1,776

Readme

@lisp MCP Server

MCP (Model Context Protocol) Server for @lisp on CAD - 为 CAD 环境提供 @lisp 包管理服务的 MCP 服务器,同时为 AI AGENT 操控 CAD 提供调用工具和通道。

功能特性

  • 连接 AutoCAD/ZWCAD/GStarCAD/BricsCAD
  • 执行 AutoLISP 代码,支持绘图、查询、标注
  • AI Agent 可通过 MCP 协议控制 CAD 绘图
  • 管理 @lisp 包(列出、搜索、安装)
  • CAD 未运行自动启动

一、安装

Windows (PowerShell)

iwr -useb https://atlisp.cn/install.ps1 | iex

安装脚本会自动:

  • 安装 Node.js(如未安装)
  • 全局安装 @atlisp/mcp
  • 创建命令 atlisp-mcp

验证安装

atlisp-mcp --version

二、配置 AI Agent (WorkBuddy / Claude Desktop)

WorkBuddy 配置

~/.workbuddy/.mcp.json 中添加:

{
  "mcpServers": {
    "atlisp-mcp": {
      "url": "http://localhost:8110/mcp"
    }
  }
}

Claude Desktop 配置

~/AppData/Roaming/Claude/claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "atlisp-mcp": {
      "command": "atlisp-mcp",
      "env": {
        "TRANSPORT": "stdio"
      }
    }
  }
}

其他 AI Agent (Cline / Cursor / Windsurf)

{
  "mcpServers": {
    "atlisp-mcp": {
      "command": "atlisp-mcp",
      "args": [],
      "env": {
        "TRANSPORT": "stdio"
      }
    }
  }
}

三、启动服务

HTTP 模式(默认,端口 8110)

atlisp-mcp

服务启动后输出:

@lisp MCP Server 启动 - http://0.0.0.0:8110 - Streamable HTTP

stdio 模式(AI Agent 直接调用)

atlisp-mcp
# 环境变量
TRANSPORT=stdio

健康检查

curl http://localhost:8110/health

返回 {"status":"ok","cad":"connected"} 表示服务正常。


四、连接 CAD

前置条件

  • Windows 系统
  • CAD 软件已安装(AutoCAD / ZWCAD / GStarCAD / BricsCAD)
  • CAD 已启动(或配置为自动启动)

连接方式

使用 MCP 工具 connect_cad 连接 CAD:

{
  "name": "connect_cad",
  "arguments": {}
}

自动行为:

  • 如果 CAD 已运行,连接现有实例
  • 如果 CAD 未运行,通过 COM 自动创建新实例

连接成功返回: 已连接到 AutoCAD 2021


五、绘图示例

1. 画直线

{
  "name": "eval_lisp",
  "arguments": {
    "code": "(command \"_.LINE\" \"0,0\" \"100,100\" \"\")"
  }
}

2. 画矩形

{
  "name": "eval_lisp",
  "arguments": {
    "code": "(command \"_.RECTANG\" \"0,0\" \"100,100\")"
  }
}

3. 画圆

{
  "name": "eval_lisp",
  "arguments": {
    "code": "(command \"_.CIRCLE\" \"50,50\" \"25\")"
  }
}

4. 写文字

{
  "name": "eval_lisp",
  "arguments": {
    "code": "(entmake (list (cons 0 \"TEXT\") (cons 10 (list 0 0 0)) (cons 40 5) (cons 1 \"标题\")))"
  }
}

5. 获取查询结果

{
  "name": "eval_lisp_with_result",
  "arguments": {
    "code": "(getvar \"acadver\")"
  }
}

返回 CAD 版本号,如 "AC1027"

6. 统计图形数量

{
  "name": "eval_lisp_with_result",
  "arguments": {
    "code": "(sslength (ssget \"_X\"))"
  }
}

7. 切换 CAD 到前台

当 CAD 在后台运行时,唤醒到前台:

{
  "name": "bring_to_front",
  "arguments": {}
}

六、可用工具列表

| 工具名称 | 描述 | 参数 | |---------|------|------| | connect_cad | 连接到 CAD | 无 | | eval_lisp | 执行 LISP 代码(无返回值) | code: LISP 代码 | | eval_lisp_with_result | 执行 LISP 并返回结果 | code: LISP 代码 | | get_cad_info | 获取 CAD 信息 | 无 | | list_packages | 列出已安装的包 | 无 | | search_packages | 搜索包 | query: 关键词 | | install_package | 安装包 | packageName: 包名 | | get_platform_info | 获取平台信息 | 无 | | get_file_extensions | 获取文件扩展名 | platform: 平台名 | | get_install_code | 获取安装代码 | 无 | | at_command | 执行 @lisp 命令 | command: 命令 | | new_document | 新建空白文档 | 无 | | bring_to_front | 切换 CAD 到前台 | 无 | | install_atlisp | 安装 @lisp | 无 | | get_function_usage | 获取函数用法 | name: 函数名 | | list_functions | 列出所有函数 | 无 |


七、环境变量

| 变量 | 默认值 | 说明 | |------|--------|------| | TRANSPORT | http | 传输模式:httpstdio | | PORT | 8110 | HTTP 模式监听端口 | | HOST | 0.0.0.0 | HTTP 模式监听地址 | | MESSAGE_TIMEOUT | 60000 | 消息超时(毫秒) | | MCP_API_KEY | (无) | API Key 认证(可选) | | ENABLE_SSE | false | 启用 SSE 模式(默认禁用) |


八、支持平台

  • AutoCAD (扩展名: .fas, .vlx)
  • ZWCAD (扩展名: .zelx, .vls)
  • GStarCAD (扩展名: .des)
  • BricsCAD (扩展名: .des)

九、工作原理

  1. MCP Server 通过 edge-js 调用 .NET 代码
  2. .NET 通过 COM 互操作连接 CAD 应用程序
  3. 支持获取运行中的 CAD 或自动启动
  4. 通过 SendCommand 向 CAD 发送 LISP 代码
  5. 执行前自动检测 CAD 状态(IsQuiescent)
  6. CAD 忙碌时自动等待(最多 10 次重试)

十、故障排除

| 问题 | 解决方案 | |------|---------| | 连接失败 | 确保 CAD 已启动并启用 COM 接口 | | 工具调用超时 | CAD 可能繁忙,稍后重试 | | 中文乱码 | 使用 vl-princ-to-string 处理 | | 括号错误 | MCP Server 会自动检查并提示 |


许可证

ISC