IfcMCP is an MCP (Model Context Protocol) server that exposes IfcOpenShell query and edit tools to AI coding assistants such as Claude. It wraps :doc:`IfcQuery <ifcquery>` and :doc:`IfcEdit <ifcedit>`, holding the IFC model in memory across tool calls so no file I/O is required between operations.
The ifcmcp package can also be used directly as a Python library without
the MCP server layer.
To use IfcMCP as an MCP server, install it together with the mcp package:
pip install 'ifcmcp[mcp]'
If you only want to use the library directly (without an MCP client):
pip install ifcmcp
Or install from source:
- :doc:`Install IfcOpenShell <ifcopenshell-python/installation>`
- Clone the IfcOpenShell repository.
cd /path/to/IfcOpenShell/src/ifcmcppip install '.[mcp]'
Add the server to your MCP client. For Claude Code:
claude mcp add --transport stdio ifc -- ifcmcp
Or add to .mcp.json:
{
"mcpServers": {
"ifc": {
"type": "stdio",
"command": "ifcmcp"
}
}
}Session tools
ifc_new(schema="IFC4")— create a new empty model in memoryifc_load(path)— open an IFC file into memoryifc_reset()— unload the current model, freeing all session stateifc_save(path="")— write model to disk; empty path overwrites the original
Query tools
ifc_summary()— schema version, entity counts, project metadataifc_tree()— full spatial hierarchyifc_info(element_id)— deep inspection by step IDifc_select(query)— filter elements by IFC classifc_relations(element_id, traverse="")— relationships for an elementifc_clash(element_id, ...)— geometric intersection and clearance checksifc_validate(express_rules=False)— schema and constraint validationifc_schedule(max_depth=None)— work schedules with nested task treesifc_cost(max_depth=None)— cost schedules with nested cost item treesifc_schema(entity_type)— IFC class documentationifc_contexts()— geometric representation contextsifc_materials()— material definitions
Drawing and rendering tools
ifc_plot(...)— generate a 2D drawing viaifcopenshell.drawand return it as an inline image the AI assistant can inspect; SVG always available, PNG requirescairosvgifc_render(...)— off-screen 3D render returned as an inline PNG image the AI assistant can inspect; requirespyvistaand the IfcOpenShell C++ geometry bindings
ShapeBuilder tools
ifc_shape_list()— list all availableShapeBuildermethodsifc_shape_docs(method)— documentation for a specificShapeBuildermethodifc_shape(method, params="{}")— execute aShapeBuildermethod; entity references resolved by step ID
Edit tools
ifc_list(module="")— list API modules or functionsifc_docs(function_path)— documentation for an API functionifc_edit(function_path, params="{}")— execute anifcopenshell.apimutationifc_quantify(rule, selector="")— run quantity take-off; writesIfcElementQuantitypsets in-place
ifc_load("/path/to/model.ifc")
ifc_summary()
ifc_tree()
ifc_info(42)
ifc_edit("root.remove_product", '{"product": "42"}')
ifc_save()
.. seealso:: :doc:`IfcQuery <ifcquery>` and :doc:`IfcEdit <ifcedit>` provide the same functionality as standalone CLI tools for scripting and automation.