Bonsai MCP

Bonsai MCP

Connects MCP clients to a local Blender + Bonsai (BlenderBIM) session for scene inspection, IFC project querying, viewport screenshots, and executing Python code in Blender.

Category
访问服务器

README

Bonsai MCP

A local Model Context Protocol server that connects any MCP client (Claude Desktop, Claude Code, Cursor, VS Code, OpenAI Codex) to a running Blender + Bonsai (BlenderBIM) session. Inspect the scene, query the loaded IFC project, capture the viewport, and run Python inside Blender.

MCP client  --stdio-->  bonsai-mcp  --127.0.0.1:9878-->  Blender add-on (bpy + Bonsai + IfcOpenShell)

This project is part of IFC-CoPilot: A Tool-Based Framework for LLM-Driven IFC Building Design and a more improved version of ifc-bonsai-mcp.

Requirements

  • Blender 3.6+ (4.x recommended).
  • Bonsai (BlenderBIM), only for the IFC tools. Install it from bonsaibim.org.
  • uv, one-time install below. Runs the server and handles Python 3.10+ for you.
  • git, to clone this repo. The server runs from your local checkout; it is not published to PyPI.

Setup (one-time)

Do these once. uv installs everything into the repo's own .venv the first time you run it; nothing is installed globally, and nothing is fetched from PyPI.

1. Install uv:

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

2. Clone this repo somewhere permanent, and note its full path; you point your MCP client at it below:

git clone https://github.com/show2instruct/bonsai-mcp.git

Quick start

1. Install the Blender add-on

  1. In Blender: Edit > Preferences > Add-ons. On Blender 4.2+/5.x, open the ▾ menu (top-right) > Install from Disk...; on older versions use the Install... button.
  2. Pick blender_addon/bonsai_bridge.py from the repo you cloned: that exact file, not scripts/package_addon.py or the .zip. Then tick Bonsai MCP Bridge to enable it.
  3. Open the sidebar (press N) > Bonsai MCP tab > Start Bridge. It now listens on 127.0.0.1:9878.

2. Connect your client

Point your client at the folder you cloned. Everywhere below, replace /path/to/bonsai-mcp with that path. On Windows in JSON, either use forward slashes or double every backslash (C:\\Users\\you\\bonsai-mcp).

  • Claude Code:

    claude mcp add bonsai-mcp -- uv run --directory /path/to/bonsai-mcp bonsai-mcp
    
  • Claude Desktop, Cursor, VS Code, and other clients: add this to the client's MCP config, then restart the client:

    {
      "mcpServers": {
        "bonsai-mcp": {
          "command": "uv",
          "args": ["run", "--directory", "/path/to/bonsai-mcp", "bonsai-mcp"]
        }
      }
    }
    

    On Windows, if the client can't find uv, use its full path as the command (e.g. C:\\Users\\you\\.local\\bin\\uv.exe).

uv run builds the project into the repo's .venv on first launch (editable, so your local edits take effect on the next restart) and caches it after that.

3. Verify

With Blender running and the bridge started, run this from inside the cloned folder:

uv run bonsai-mcp doctor

doctor pings the bridge and reports Blender / IfcOpenShell status and the tools it exposes.

Per-client config paths, the Windows uv.exe path note, and optional BONSAI_MCP_* settings are in docs/clients.md. Example configs live in examples/; set the --directory path to your clone.

Tools

Eight tools, each tagged [QUERY] (read-only) or [EDIT] (mutates state).

Category Tool Purpose
QUERY get_scene_info Scene summary plus an optional filtered object list.
QUERY get_selected_objects Per-object info for the current selection.
QUERY get_psets IFC property and quantity sets for one or many objects.
QUERY get_viewport_screenshot Capture the viewport (aim with view/fit), plus structured viewport state.
QUERY get_ifc_project_info Schema, counts, materials, classifications.
EDIT execute_ifc_code Run IfcOpenShell / Bonsai API code. bpy blocked.
EDIT execute_blender_code Run arbitrary Python with full bpy access.
EDIT save_ifc_file Save in place, save-as (guarded), and optional viewport reload.

Full reference with inputs, outputs, and examples: docs/tools.md.

Example prompt, with an IFC project open in Bonsai:

"List every wall in the model with its fire rating."

Safety

The bridge binds to 127.0.0.1 only and has no authentication, and execute_blender_code runs arbitrary Python. Treat it like an open Python REPL on your machine and never expose it to a network. See docs/safety.md.

Documentation

Contributing

Python 3.10+ and uv:

uv venv
uv pip install -e ".[dev]"
uv run ruff check src tests blender_addon scripts
uv run pytest

Add tests and docs for behavior changes. Report security issues privately through GitHub Security Advisories.

License

MIT. See LICENSE.

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

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

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选