Skip to main content
Glama
sweethome3d-mcp

sweethome3d-mcp

sweethome3d-mcp

Tests CodeQL License: MIT Python

sweethome3d-mcp is a local stdio MCP server for creating and editing Sweet Home 3D .sh3d projects on disk. It operates directly on Home.xml inside the ZIP archive so an LLM can add, inspect, validate, export, and delete supported plan elements without a running Sweet Home 3D instance.

This is a personal/community project. It is not affiliated with, endorsed by, or maintained by eTeks or the Sweet Home 3D project.

Verified against Sweet Home 3D version: 7.9.303.0 (eTeks.SweetHome3D_7.9.303.0_x64, Microsoft Store package)

License

This repository is released under the MIT License. The schema-research provenance for docs/SCHEMA.md and the rationale for using MIT in this repository are documented in NOTICE.md.

Related MCP server: solidworks-mcp

Credits / Author

Author: Stanley S Nelavala
GitHub: consultantstanleymn

Install

pip install -e .

Run the server with:

python -m sh3d_mcp

MCP Client Registration

{
  "mcpServers": {
    "sweethome3d": {
      "command": "python",
      "args": ["-m", "sh3d_mcp"],
      "env": {
        "PYTHONPATH": "C:\\Users\\stanl\\Desktop\\sweethome3d-mcp\\src"
      }
    }
  }
}

Worked Example

Example tool sequence for an 8 m × 6 m home with one interior wall, two rooms, one table, one dimension line, and a final export:

create_project(
    project_path="house.sh3d",
    name="House",
    width=800.0,
    height=600.0,
)

add_wall(
    project_path="house.sh3d",
    x1=400.0,
    y1=7.5,
    x2=400.0,
    y2=592.5,
    join=False,
)

add_room(
    project_path="house.sh3d",
    points=[(7.5, 7.5), (400.0, 7.5), (400.0, 592.5), (7.5, 592.5)],
    name="Living Room",
    allow_overlap=True,
)

add_room(
    project_path="house.sh3d",
    points=[(400.0, 7.5), (792.5, 7.5), (792.5, 592.5), (400.0, 592.5)],
    name="Dining Room",
    allow_overlap=True,
)

add_furniture(
    project_path="house.sh3d",
    catalog_id="eTeks#table",
    x=596.25,
    y=300.0,
    room_name="Dining Room",
)

add_dimension(
    project_path="house.sh3d",
    x1=7.5,
    y1=620.0,
    x2=792.5,
    y2=620.0,
    offset=20.0,
)

export_project(project_path="house.sh3d")

All tool lengths are in centimetres. Tool rotations are in degrees. Plan coordinates use x increasing to the right. The exact positive on-screen rotation handedness and independent y-axis direction remain unverified because the tested Sweet Home 3D install had a broken 2-D plan view; see docs/SCHEMA.md §9-B.

Limitations

  • Single level only.

  • No doors or windows bound to walls.

  • No lights.

  • No textures, materials, or colour authoring.

  • No rendering or export to OBJ, PNG, or SVG.

  • No live sync with a running Sweet Home 3D application.

  • Output format is .sh3d only.

Tool Surface

The server currently registers these tools:

  • create_project

  • add_wall

  • add_room

  • add_furniture

  • add_dimension

  • list_elements

  • export_project

  • open_reference

  • validate_project

  • delete_element

Known Issues / Open Questions

These are still genuinely open and will also be tracked as GitHub issues for contributors:

  • Rotation handedness and y-axis direction: 90° rotation magnitude and width/depth axis swap are confirmed in real Sweet Home 3D, but exact clockwise-vs-counterclockwise handedness and independent y-down confirmation remain unverified because the tested install's 2-D plan view was blank. This is the highest-value open item because it affects the precise semantics of rotation and some geometry interpretation. See docs/SCHEMA.md §9-B.

  • Modern Home.CURRENT_VERSION integer: the project currently writes the known-safe 5300 value from a 2017 source mirror because lower is safer than accidentally claiming a newer unsupported version. The actual current integer for modern Sweet Home 3D still needs confirmation from newer source or a verified file sample. See docs/SCHEMA.md §9-C.

  • Colour attribute encoding: colour authoring is not implemented yet, and the exact accepted wire format for colour attributes still needs direct confirmation. The current docs note decimal-or-hex uncertainty and intentionally defer the feature. See docs/SCHEMA.md §9-D.

  • ContentDigests necessity: the implementation intentionally omits ContentDigests on write because Home.xml loads without it in source analysis, but it is still not fully proven whether a real Sweet Home 3D open ever requires it in any edge case. See docs/SCHEMA.md §9-F.

  • Multi-level support: multi-floor homes remain out of scope for v1 and would be a substantial feature rather than a small patch. The format details around levels and elevationIndex also remain under-investigated. See docs/SCHEMA.md §9-K.

Contributing

See CONTRIBUTING.md for practical development setup and conventions. Longer-form contributor notes and project summaries will live in the repository Wiki under wiki/.

Attribution

The Home.xml schema notes in docs/SCHEMA.md were derived from Sweet Home 3D's published DTD and GPL-licensed source code. This project does not bundle Sweet Home 3D itself.

Available Tools

10 tools
add_dimensionA

Add a dimension line to a .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not snap to existing geometry or infer offsets from nearby walls. Example: add_dimension(project_path='house.sh3d', x1=0, y1=0, x2=500, y2=0, offset=20)

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +4 more. Returns: object

add_furnitureA

Add furniture to a .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not bind doors or windows to walls and cannot invent a missing 3D model or unsupported catalogue entry. Example: add_furniture(project_path='house.sh3d', catalog_id='eTeks#chair', x=120, y=240, rotation=90)

Inputs: x (required), y (required), catalog_id (required), project_path (required), +8 more. Returns: object

add_roomA

Add a room polygon to a .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not infer walls, repeat the closing point, or auto-split overlapping rooms. Example: add_room(project_path='house.sh3d', points=[(0,0),(500,0),(500,400),(0,400)], name='Kitchen')

Inputs: points (required), project_path (required), name, area_visible, +1 more. Returns: object

add_wallA

Add a wall to a .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not create rooms or resolve unsupported multi-wall junctions beyond the documented pairwise join model. Example: add_wall(project_path='house.sh3d', x1=0, y1=0, x2=500, y2=0)

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +6 more. Returns: object

create_projectA

Create a .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not create multi-level homes or add furniture beyond the optional 4-wall rectangle footprint. Example: create_project(project_path='house.sh3d', name='House', width=800, height=600)

Inputs: name (required), project_path (required), width, height, +3 more. Returns: object

delete_elementA

Delete an editable element from a .sh3d project by id. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not delete unsupported tags or repair geometry beyond clearing inbound wall join references to a deleted wall. Example: delete_element(project_path='house.sh3d', element_id='wall2')

Inputs: element_id (required), project_path (required). Returns: object

export_projectA

Finalize and rewrite a .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not export OBJ, PNG, SVG, or any format other than .sh3d. Example: export_project(project_path='house.sh3d', destination_path='house-final.sh3d')

Inputs: project_path (required), destination_path. Returns: object

list_elementsA

List editable elements in a .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not modify the archive or canonicalize element order. Example: list_elements(project_path='house.sh3d', kinds=['walls','rooms'])

Inputs: project_path (required), kinds. Returns: object

open_referenceA

Inspect a reference .sh3d file and populate the in-process furniture catalogue cache. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not modify the sample archive or copy any content into another project. Example: open_reference(sample_sh3d_path='sample.sh3d')

Inputs: sample_sh3d_path (required). Returns: object

validate_projectA

Validate an existing .sh3d project. Lengths are in centimetres and rotations in degrees. The plan coordinate system uses y increasing downward. This tool does not modify the archive or rewrite canonical order. Example: validate_project(project_path='house.sh3d')

Inputs: project_path (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct action/resource: validate, reference loading, project creation, four add operations for different element types, listing, export, and deletion. The only possible overlap between validate_project and open_reference is clarified by their stated purposes, so an agent can reliably select the correct tool.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern in snake_case: validate_project, create_project, add_wall, add_room, add_furniture, add_dimension, list_elements, export_roject, delete_element. The naming makes both the action and the target clear with no style mixing.

    Tool Count5/5

    Ten tools is a well-scoped size for a .sh3d authoring server. Each tool covers a distinct operation without redundant helpers or unnecessary bloat.

    Completeness3/5

    The set covers project creation, element addition, listing, deletion, validation, and export, but it lacks any update or modify operation for existing elements such as moving a wall, resizing furniture, or editing a room. Agents can only work around this by deleting and recreating elements, which is a notable lifecycle gap.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to build, measure, verify, and correct parametric SolidWorks parts and assemblies locally via the COM API, supporting operations like sketching, extruding, modeling, dimensioning, material assignment, export, and assembly mating.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Allows an AI assistant to search a local library of 3D-printable models, retrieve geometry metrics like dimensions, triangle counts, and watertightness, and draft marketplace listings.
      GPL 3.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to create, inspect, render, and export 2D engineering drawings through DXF files, including entities, dimensions, hatches, splines, blocks, layers, PNG previews, and vector PDFs without needing a CAD GUI.
      11
      MIT