Metadata-Version: 2.4
Name: ifc-console
Version: 0.1.1
Summary: A terminal interface to connect IFC files to LLMs: a standalone MCP server for IFC/BIM with an ask/edit safety switch and a local 3D viewer.
Project-URL: Homepage, https://github.com/nbharathik/ifc-console
Project-URL: Documentation, https://nbharathik.github.io/ifc-console/
Project-URL: Repository, https://github.com/nbharathik/ifc-console
Project-URL: Issues, https://github.com/nbharathik/ifc-console/issues
Author: nbharathik
License: Apache-2.0
License-File: LICENSE
Keywords: bim,claude,ifc,ifcopenshell,llm,mcp,openbim
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: <3.15,>=3.10
Requires-Dist: ifcopenshell<0.9,>=0.8.1
Requires-Dist: mcp<2,>=1.16
Requires-Dist: pydantic<3,>=2.7
Requires-Dist: starlette>=0.37
Requires-Dist: textual>=1.0
Requires-Dist: uvicorn>=0.30
Requires-Dist: websockets>=12
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: ifctester>=0.8; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs>=1.6; extra == 'docs'
Provides-Extra: validation
Requires-Dist: ifctester>=0.8; extra == 'validation'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://nbharathik.github.io/ifc-console/">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="docs/assets/brand/horizontal-dark.svg">
      <source media="(prefers-color-scheme: light)" srcset="docs/assets/brand/horizontal-light.svg">
      <img alt="IFC CONSOLE" src="https://raw.githubusercontent.com/nbharathik/ifc-console/main/docs/assets/brand/horizontal-light.svg" width="60%">
    </picture>
  </a>
</p>

**A terminal interface to connect IFC files to LLMs.** `ifc-console` loads
your model with IfcOpenShell and serves it over MCP, so any LLM client
(Claude Code, Claude Desktop, Cursor, VS Code, Codex) can query and edit it,
while you stay in control from your terminal. No Blender, no host app.

Docs: <https://nbharathik.github.io/ifc-console/>

## Install and run

Install from [PyPI](https://pypi.org/project/ifc-console/) with
[uv](https://docs.astral.sh/uv/) or pip:

```bash
uv tool install ifc-console    # puts the ifc-console command on your PATH, viewer included
# or: pip install ifc-console
```

Or try it without installing: `uvx ifc-console`. To update later:
`uv tool upgrade ifc-console`.

Start it in the folder with your models:

```bash
cd path/to/your/models
ifc-console
```

The MCP server comes up right away. Then, in the console:

```
> /file        pick a model from this folder
> /connect all one-time HTTP setup for every supported LLM client
> /copy codex  copy one complete client config to the clipboard
> /mode edit   let the AI change the model (ask = query-only, the default)
> /viewer      3D view in your browser
> /help        everything else
```

Wire up each client once. The token is stable per machine and no IFC path is
stored in the client config, so your daily loop is just `ifc-console`, `/file`,
and chat.

## The mode switch

One switch, owned by you; the LLM cannot change it. Anything finer-grained
(per-tool prompts, allowlists) belongs to your AI client.

| mode | what the LLM can do |
| ---- | ------------------- |
| `ask` (default) | query and generate code; anything that would change the model errors and tells it to ask you |
| `edit` | change and save the model; saves still make backups |

Switch with `/mode`. Every mutation path is gated, saves are atomic with
timestamped backups, and each session writes an audit log.

Honest caveat: the guards stop accidents, not a determined adversary. Treat
`edit` mode plus untrusted prompts like running a stranger's script.

## What the LLM gets

**11 core tools**: project info, spatial tree, selector queries, element
details, property sets, schema docs, file list/open/save, and a gated
Python `execute_ifc_code` power tool.

**3 more while the viewer runs**: read your click-selection, highlight
elements, and screenshot the canvas so it can check its own work.

Every response is one JSON envelope with an actionable hint on failure.
Full reference: [MCP tools](https://nbharathik.github.io/ifc-console/tools/).

## The 3D viewer

Type `/viewer`. It runs entirely on localhost behind your session token:
click an element and the LLM knows what "this wall" means; it highlights
elements back and takes screenshots. Edits refresh the view live.

## Install from source (for development)

If  you would like to work on the code itself, clone the repo and install from your checkout (needs git and uv):
```bash
git clone https://github.com/nbharathik/ifc-console
cd ifc-console
uv tool install .
```

To update later: `git pull`, then `uv tool install . --force`. For working on
the code itself, see
[Development](https://nbharathik.github.io/ifc-console/development/).

## Docs

- [Getting started](https://nbharathik.github.io/ifc-console/getting-started/)
- [The console](https://nbharathik.github.io/ifc-console/console/) and [connecting clients](https://nbharathik.github.io/ifc-console/clients/)
- [Safety model](https://nbharathik.github.io/ifc-console/safety/) and [3D viewer](https://nbharathik.github.io/ifc-console/viewer/)
- [Development](https://nbharathik.github.io/ifc-console/development/)

## License

Apache-2.0. Bundles three.js (MIT) and web-ifc (MPL-2.0, unmodified); uses
IfcOpenShell (LGPL-3.0-or-later) as a library.

## Acknowledgments

Inspired by [Bonsai MCP](https://github.com/Show2Instruct/bonsai-mcp). If you
would like to work with the Bonsai viewer in Blender instead of a standalone
terminal, check that project out.
