跳到正文
FunCoding

IFC MCP

官方 MCP Registry 已收录

Local IFC/BIM MCP server with IfcOpenShell Python in Pyodide and an IFC viewer.

Star
14
版本
v0.4.0
许可证
Apache-2.0
最近提交
2026年12月1日

IFC MCP

IFC MCP lets your AI assistant inspect IFC/BIM files, create IFC files, create reports, open IFC models in a viewer, and apply BCF viewpoints.

How It Works

After installation, ask your AI client in normal language. The AI client starts IFC MCP when it needs the IFC tools and sends your request to the local server. IFC MCP reads IFC files locally, runs the needed IFC logic in a local Pyodide runtime with IfcOpenShell, and returns the answer to the chat.

Watch IFC MCP with Claude demo on YouTube

Good example prompts:

  • Open examples/sample.ifc and summarize the model.
  • Count the walls, doors, windows, spaces, and property sets in examples/sample.ifc.
  • Find missing names, classifications, and suspicious property values in this IFC file.
  • Create a CSV room-area report from this IFC file.
  • Create a simple IFC file with one building, one storey, and four walls.
  • Open the IFC viewer and show examples/sample.ifc.
  • Apply C:\path\to\viewpoint.bcfzip in the open IFC viewer.
  • Clear the IFC viewer.

If IFC MCP creates a report, BCF file, or new IFC file, it returns a local download link. If you ask to view a model, IFC MCP opens a local viewer link. If your AI client does not open that link automatically, open it in your browser.

The desktop MCP tools open an IFC session on the first call and return a ifc_session_id. Clients must pass that ID on follow-up calls, including file handoff retries and viewer actions. A call without an ID starts a clean session. Each session has its own approved files, viewer state, downloads, and Pyodide worker, including when chats share an MCP connection.

Each viewer has a stable localhost URL within its IFC session. Open the complete URL, including the token after #. A session expires after an hour without an IFC tool call. If 16 sessions are open, a new session replaces the least recently used idle one. Disconnecting IFC MCP closes its sessions and expires their download links.

Large IFC files can take more than a minute to process. Cancelling a request terminates its local Python worker. The next call starts a fresh runtime.

The package includes Pyodide 0.28.3, the checksum-verified IfcOpenShell wheel, and the Python packages needed for offline execution. Pyodide stays warm across file changes within an IFC session. Five minutes without an IFC tool call or revoking a used file approval clears the worker. The next Python call starts a fresh runtime.

IFC MCP accepts IFC and IFCZIP files.

For local analysis, give your assistant the file path. A client with local terminal access can hand the file to IFC MCP using its existing permissions. If the handoff is unavailable, you can select the file using the picker link.

Use run-python with bcf-client to create BCF viewpoints, including orthographic cameras. The connected browser viewer returns a rendered screenshot with the application status and issues from set-bcf-view.

Installation

1. Prerequisites

Install Node.js 20 or newer from the official Node.js download page. Choose the LTS version for your operating system, run the installer, then reopen the app where you want to use IFC MCP.

IFC MCP uses npx, which is included with Node.js. If your app later says node or npx is not found, reinstall Node.js LTS and reopen the app.

On Linux x64 and ARM64, run-python uses the bundled sandbox launcher and requires a Linux 5.13 or newer kernel with Landlock enabled. No additional runtime package is needed.

2. Choose your client

ChatGPT desktop app

ChatGPT desktop supports local MCP servers over STDIO.

  1. Open the ChatGPT desktop app.
  2. Open Settings.
  3. Select Plugins, then MCPs.
  4. Click Add. If prompted for a server type, choose STDIO.
  5. Enter:
    • Name: ifc-mcp
    • Command to launch: npx
    • First argument: -y
    • Second argument: ifc-mcp
  6. Leave the environment variable fields empty and save the server.
  7. Restart the ChatGPT desktop app.
  8. Start a new chat, type /mcp, and confirm that ifc-mcp is connected.

For more detail, see OpenAI's MCP documentation.

Claude Desktop

Option 1: Use the Claude Desktop UI

  1. Open Claude Desktop.
  2. Open Settings.
  3. Open Developer or Desktop app developer settings.
  4. Click Edit Config if that button is available. This opens the Claude Desktop MCP config file.
  5. Paste the JSON below, save the file, then fully quit and reopen Claude Desktop.
{
  "mcpServers": {
    "ifc-mcp": {
      "command": "npx",
      "args": ["-y", "ifc-mcp"]
    }
  }
}

If the file already contains JSON, add only the ifc-mcp entry inside the existing mcpServers object. Do not create a second mcpServers object.

Option 2: Open the config file directly

Use this only if you do not see Edit Config in Claude Desktop:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Paste the same JSON from Option 1, save the file, then fully quit and reopen Claude Desktop.

Check

To check the setup, open Claude Desktop, start a new chat, click the + button near the chat box, and look for Connectors. IFC MCP should appear there after Claude Desktop has restarted. You should see the tools listed in the How It Works section above.

For more detail, see Claude's local MCP server guide.

VS Code Copilot

Option 1: Use the install button

This opens VS Code and adds IFC MCP.

Install IFC MCP in VS Code

If VS Code asks whether you trust the server, accept it. Reload VS Code if the tools do not appear. Open Chat and use the tools/configure-tools button to see the IFC MCP tools.

Option 2: Add .vscode/mcp.json manually

{
  "servers": {
    "IFC MCP": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "ifc-mcp"]
    }
  }
}

Reload VS Code after saving the file.

Open Chat and use the tools/configure-tools button to see the IFC MCP tools.

For more detail, see the VS Code MCP server docs.

VS Code Codex

Option 1: Use the Codex settings UI

  1. Open VS Code.
  2. Open the Codex panel.
  3. Open Codex settings.
  4. Select MCP servers.
  5. Click Add server.
  6. Enter:
    • Name: ifc-mcp
    • Command: npx
    • Arguments: -y ifc-mcp
  7. Save the server.
  8. Reload VS Code or start a new Codex session.
  9. Check that the IFC MCP tools are available in the new Codex session.

Option 2: Use the terminal command

  1. Open Terminal -> New Terminal in VS Code.
  2. Paste and run:
codex mcp add ifc-mcp -- npx -y ifc-mcp
  1. Reload VS Code or start a new Codex session.
  2. Check that the IFC MCP tools are available in the new Codex session.

For more detail, see the Codex MCP docs.

VS Code Claude Code

Option 1: Use a project JSON file

  1. Open your project in VS Code.
  2. Create or edit .mcp.json in the project root.
  3. Add this JSON and save the file:
{
  "mcpServers": {
    "ifc-mcp": {
      "command": "npx",
      "args": ["-y", "ifc-mcp"]
    }
  }
}
  1. Reopen Claude Code in VS Code.
  2. Type /mcp and approve the project server if Claude asks.
  3. Check that ifc-mcp is connected.

Option 2: Use the terminal command for all projects

claude mcp add --transport stdio ifc-mcp --scope user -- npx -y ifc-mcp

Then reopen Claude Code in VS Code, type /mcp, and check that ifc-mcp is connected.

If the claude command is not found, install Claude Code first.

For more detail, see the Claude Code VS Code docs and Claude Code MCP docs.

Other MCP clients

Add this server entry to your MCP client config:

{
  "mcpServers": {
    "ifc-mcp": {
      "command": "npx",
      "args": ["-y", "ifc-mcp"]
    }
  }
}

Restart the MCP client after saving the config.

For more detail, see the Model Context Protocol docs.

Use Your Own Viewer

If your app already has an IFC viewer, you can reuse IFC MCP's normal tool interface and apply viewer actions in your app instead of opening the default local viewer. The MCP client still calls tools like show-ifc-file and set-bcf-view; your app only defines what those viewer tools do.

Node MCP server

Provide handlers that receive local file paths. Replace the functions below with your app's viewer actions:

import { createServer } from "ifc-mcp";
import { serveStdio } from "@modelcontextprotocol/server/stdio";

serveStdio(() => createServer({
  viewer: {
    "open-ifc-viewer": () => openThisViewer(),
    "show-ifc-file": ({ file_path }) => loadIfcIntoThisViewer(file_path),
    "set-bcf-view": ({ bcf_path }) => applyBcfToThisViewer(bcf_path),
    "clear-ifc-viewer": () => clearThisViewer(),
  },
}));

Return MCP tool results from your handlers: content contains feedback, and isError: true indicates failure.

Browser app

Pass files selected in your app and callbacks for your existing viewer. Here, file is a selected IFC File, and viewer is your viewer instance:

import { createIfcMcpHost } from "ifc-mcp/browser";

const files = new Map([
  [file.name, { name: file.name, source: file }],
]);

const host = createIfcMcpHost({
  files,
  viewer: {
    "show-ifc-file": (name, bytes) => viewer.add(name, bytes),
    "set-bcf-view": (name, bytes) => viewer.add(name, bytes),
    "clear-ifc-viewer": () => viewer.clear(),
  },
});

const result = await host.handleToolCall({
  name: "show-ifc-file",
  input: { file_path: file.name },
});
const { ifc_session_id } = result.structuredContent;

File callbacks receive a filename and Uint8Array bytes. The BCF callback must return an MCP tool result describing whether the viewpoint was applied. Use host.tools for the tool definitions. Omit ifc_session_id on the first call of each chat and pass the returned ID on follow-ups. Use host.getGeneratedFiles(ifc_session_id) for that session's downloads.

A file map passed to createIfcMcpHost() is shared with its sessions. Pass files(ifc_session_id) to provide a separate map per chat. Viewer callbacks receive request.ifc_session_id so your app can route them to the right viewer.

When serving the built browser entry, serve python-worker-browser.js and the python/ directory beside it. The sandbox loads these assets before executing Python. The browser host must allow a sandboxed iframe and a blob worker.

Call host.closeSession(ifc_session_id) when a chat ends to release its worker and downloads. Call host.resetPythonSession(ifc_session_id) to clear Python state when file access is revoked.

Local Development

Linux source builds use GCC and musl-tools to compile the sandbox launcher.

For local development from this checkout:

npm install
npm test

The workspace includes .vscode/mcp.json, so VS Code can run the server from this checkout.

npm test includes real stdio subprocesses, malformed protocol and viewer requests, concurrent startup and shutdown, download expiry and storage limits, and the local Python runtime. The process and browser fixtures follow the approaches in the MCP SDK testing guide and Playwright MCP tests.

To test the built server with the published viewer SDK in Chromium:

npx playwright install chromium
npm run test:browser

The browser suite loads a real IFC wall, checks reload and BCF selection/color round trips, verifies recovery from invalid IFC, and checks port cleanup. It needs access to the pinned viewer SDK on Flinker's CDN. Failure screenshots, traces, and the HTML report are saved under .ifc-mcp/.

After building, npm run test:installed installs a local tarball and tests the desktop sandbox. Add -- --browser to test the browser sandbox from the same tarball. The release workflow runs the desktop test on Windows, macOS and Linux before publishing.

To compare resource use with another checkout, install its npm dependencies and run npm run benchmark:ifcopenshell -- --memory <checkout> [model.ifc ...]. The benchmark measures average and peak resident memory and CPU use across the MCP server, its sandbox workers and the terminal handoff. On Windows it also records private memory, GPU utilization, and shared and dedicated GPU memory. It reads small ranges of a 256 MiB fixture and parses the supplied IFC models. Set IFC_BENCHMARK_MEMORY_MIB to change the range fixture size. Results are written to .ifc-mcp/ifcopenshell-memory-benchmark.json.

Security

  • Your model stays local. IFC MCP processes IFC files on your device and runs the viewer locally. Your AI client receives tool results and temporary links to generated files. Save any downloads you want to keep.
  • Python works in a sandbox. It receives the files you attach and writes to a temporary workspace. The sandbox blocks network access, changes to your original files, and reads of unrelated file contents. On Linux it can still see some basic file information, such as whether a named file exists.
  • Access is temporary. Python can retain data between calls in the same session. After five minutes without an IFC tool call, the worker shuts down. The session expires after an hour. On desktop, a file approved in the terminal is available for one call. An unused approval expires after five minutes. Files selected in the picker stay available until you remove them or the session ends. Removing a file that Python has used clears its worker.

同类 MCP Server

Netdata

Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.

NEnetdata/netdata82k近 7 天新增 123 个 star

Oh My Posh Validator

Validate oh-my-posh configurations and segment snippets against the official schema.

JAJanDeDobbeleer/oh-my-posh24k近 7 天新增 29 个 star

Coder

Manage Coder workspaces, templates, and cloud development environments

COcoder/coder18k近 7 天新增 57 个 star

docker-android

Android in docker solution with noVNC supported, video recording, mcp server and AI-agent

BUbudtmo/docker-android16k近 7 天新增 18 个 star

精选

Windows-MCP

控制 Windows 应用,操作文件和界面,执行 QA 测试。

CUCursorTouch/Windows-MCP12k近 7 天新增 286 个 star

pal-mcp-server

The power of Claude Code / GeminiCLI / CodexCLI + [Gemini / OpenAI / OpenRouter / Azure / Grok / Ollama / Custom Model / All Of The Above] working as one.

BEBeehiveInnovations/pal-mcp-server12k近 7 天新增 21 个 star