
Zoo Mcp
io.github.KittyCAD由 GitHub 账号 KittyCAD 发布v0.34.3更新于 Nov 7, 2026
An MCP server that provides access to the Zoo API for various CAD operations and tools.
概览
Zoo MCP 让助手访问 Zoo CAD API:运行 KCL 代码、管理建模会话、导入 CAD 文件、生成快照并导出几何体。
- 可以做什么
- 执行 KCL 代码,返回模拟预检与真实执行结果,并可单独运行模拟检查
- 管理持久化建模会话:启动、列出、按会话 ID 复用与停止
- 导入 CAD 文件,并对模型进行快照、选择、高亮与相机视角操作
- 导出模型、进行测量并查询几何信息
- 列出和搜索公开的 Aquarium KCL 示例项目并下载其源码
- 适用场景
- 适合让助手编写并运行 Zoo KCL 脚本、迭代参数化 CAD 模型,或拉取公开示例项目作为起点,而无需离开对话。
- 运行要求
- 以本地 Python 包运行(uvx zoo-mcp 或 uv run -m zoo_mcp),需要 uv,也可使用预编译二进制。多数工具需要 Zoo 账户:先运行一次 auth login 命令(登录保存在系统凭据存储中),或通过 ZOO_API_TOKEN 设置 API 令牌(也支持 KITTYCAD_API_TOKEN 及 ZOO_TOKEN 别名)。公开示例工具无需令牌。需要访问 Zoo API 的网络连接。
安装
在 SourceWeft 中
- 打开 控制台中的 Zoo Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Zoo Model Context Protocol (MCP) Server
An MCP server housing various Zoo built utilities
Prerequisites
A Zoo account. Run uvx zoo-mcp auth login once before starting the server.
The command opens your browser and prints a verification URL and code.
The server reuses your saved login; public tools also work without login.
You can also use an API key:
Installation
-
Install the package from GitHub
Running the Server
The server can be started by using uvx
The server can be started locally by using uv and the zoo_mcp module
Manage device login explicitly:
Logins are saved per API origin in your system credential store using
keyring: macOS Keychain, Windows Credential
Locker, or a supported Linux keyring. On headless systems without an available
keyring, set ZOO_API_TOKEN instead. Status never displays tokens. Logout removes
only the saved login for the current origin; restart running servers afterward.
If your login expires or is revoked, run auth login again and restart the server.
If the login command fails because of a network error, run it again to retry.
Server startup never opens a browser. Device authorization and polling use
requests-oauth2client.
Device login requires the API's dedicated Zoo MCP device client registration.
The server can also be run with the mcp package
Streamable HTTP
The server uses stdio by default. To serve the same tools over Streamable HTTP:
Connect an MCP client to http://127.0.0.1:8000/mcp. The SDK manages HTTP
sessions and streaming responses. --host and --port configure the HTTP
listener; their defaults are 127.0.0.1 and 8000.
Supplying client configuration from Python
Local entry points capture credentials when Zoo MCP is imported at startup.
Token precedence is KITTYCAD_API_TOKEN, ZOO_API_TOKEN, then the registry's
ZOO_TOKEN alias. Any explicit environment token bypasses saved/device login.
API origin precedence is ZOO_HOST, KITTYCAD_HOST, then https://api.zoo.dev.
Saved logins never cross API origins.
Applications can supply client configuration explicitly without changing the process environment or adding authentication arguments to MCP tools:
The context supplies the same token, origin, and headers to the KittyCAD SDK and KCL session constructors and restores the previous configuration on exit. New calls can use refreshed configuration. Finish child tasks before leaving their configuration context. An explicit configuration context also prevents the server lifespan from loading a saved local login. Hosted workers and embeddings should always use this interface.
To forward custom HTTP headers, pass headers={"User-Agent": "MyApp/1.0", "X-Request-Source": "example"} to ZooClientConfig. These headers reach REST
requests and modeling WebSocket handshakes, including KCL sessions. A supplied
User-Agent replaces the default value. Tokens and headers are excluded from
configuration representations.
Client configuration applies to downstream calls. Applications serving different owners must also isolate their process-wide modeling sessions and workspaces.
Prebuilt binaries
Each GitHub release also attaches standalone executables (built with PyInstaller) for Linux (x86_64, arm64), macOS (arm64, x86_64), and Windows (x86_64) — no Python toolchain required. Download the binary for your platform, set ZOO_API_TOKEN, and run it directly, e.g.:
The binaries are not code-signed, so macOS Gatekeeper and Windows SmartScreen may warn on first run.
Integrations
The server can be used as is by running the server or importing directly into your python code.
Individual tools can be used in your own python code as well. At Zoo we use zoo-mcp like this with ZooKeeper to save on resources. Instead of spinning up one MCP server per agent, each agent in a sense "embeds" the server in their own runtime. It has the additional benefit of preventing shared state.
The server can be integrated with Claude desktop using the following command
The server can also be integrated with Claude Code using the following command
The server can also be tested using the MCP Inspector
For running with codex-cli
You can also use the helper script included in this repo:
The script prompts for a request, runs Codex with the Zoo MCP server, and saves a JSONL transcript (including token usage) to codex-run-<timestamp>.jsonl.
Architecture
Tools are defined in src/zoo_mcp/*.py, where they are then imported into
src/zoo_mcp/server.py and tied to actual @mcp.tool() decorated functions.
src/zoo_mcp/zoo_tools.py acts as a large toolset to interact with Zoo's KCL and
engine facilities. This source file houses other utilities like parse_unit or
normalize_ext (normalizing file extensions).
Modeling scenes use explicit persistent sessions, with at most one session open
per server process. Call get_modeling_sessions to recover its ID after a client
reconnect, or call start_modeling_session when none exists. Populate the
session with execute_kcl or import_cad_file, passing session_id to either
tool. Reuse the same session_id with snapshot and modeling tools; then call
stop_modeling_session when finished.
Sessions remain available across client reconnects while the server and engine
connection stay alive. Idle sessions continue receiving engine status messages
so keepalive checks remain responsive. Disconnected sessions are removed from
get_modeling_sessions; start a new session and execute the model again to recover.
KCL execution and persistent modeling sessions use the CPU engine pool. Isolated KCL snapshots temporarily enable CPU rendering. Persistent sessions initialize rendering on the first snapshot, selection, highlight, or camera tool and retain it until the session is stopped, preserving visual state across calls. Exports, measurements, and geometry queries do not initialize graphics.
The KCL samples tools list and search public Aquarium projects from the Zoo API.
Pass the returned name (a public project ID) to get_kcl_sample to download its
KCL sources. Filenames preserve project-relative paths, including subdirectories.
These public tools do not require an API token. The multipleFiles field in
list/search results is a hint until the project has been downloaded.
execute_kcl runs mock execution before real execution and returns separate
mock_preflight and real_execution objects.
Each contains status (succeeded, failed, or not_run), message, and
diagnostics grouped by severity. Stage messages are short summaries; the
top-level message retains the full report for existing callers. Failed stages
also expose error_family, including ZooMCPTimeoutError for session timeouts.
Mock errors or an aborted mock execution
return immediately with ok: false and real_execution.status: "not_run".
Mock warnings remain in mock_preflight.diagnostics even if real execution fails.
The known planeOf mock-engine limitation is reported as a warning so the real
engine can evaluate it; other mock errors still block execution.
Session responses expose mock diagnostics; the engine does not return real-stage
diagnostics for session execution.
Path inputs capture the entrypoint, its transitive imports (including linked
modules and glTF buffers), and project.toml once. Both stages use that copy
without scanning unrelated files in the containing directory. Dependencies and
symlink targets must stay inside the entrypoint's directory; external paths are
rejected before file reads or execution. Transient local real-execution failures
retain their bounded retries using the same copy without repeating mock execution.
Diagnostics refer to the original source paths. Inline kcl_code accepts
self-contained code and standard-library imports; filesystem imports require
kcl_path so their dependencies can be captured within an explicit directory.
When calling execute_kcl with session_id, check ok, then read
path_artifact_graph on session success. The standalone mock_execute_kcl tool
continues to return its existing boolean/message pair.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository
PRs will need to pass tests and linting before being merged.
ruff is used for linting and formatting.
ty is used for type checking.
Testing
The server includes tests located in tests. To run the tests, use the following command:
来源:README.md,提交 2aac766
工具
0版本历史
20- v0.34.3最新Nov 7, 2026
- v0.34.1Nov 6, 2026
- v0.34.0Nov 5, 2026
- v0.33.0Oct 30, 2026
- v0.29.0Oct 30, 2026
- v0.28.16Oct 29, 2026
- v0.28.14Oct 26, 2026
- v0.28.13Oct 25, 2026
- v0.28.12Oct 16, 2026
- v0.28.11Oct 15, 2026
- v0.28.9Oct 7, 2026
- v0.28.8Oct 7, 2026
- v0.28.7Oct 5, 2026
- v0.28.6Oct 1, 2026
- v0.28.5Oct 1, 2026
- v0.28.3Sep 29, 2026
- v0.28.2Sep 28, 2026
- v0.28.1Sep 22, 2026
- v0.28.0Sep 19, 2026
- v0.27.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分