Skip to main content
Glama

Hammer MCP

Hammer MCP is a standalone Model Context Protocol server for generating CAD files. It exposes DXF and OpenSCAD operations to MCP clients. Check CLI version for CLI interactions

Capabilities

  • DXF drafting, saving, and PNG previews.

  • OpenSCAD primitives, extrusion, Boolean operations, PNG rendering, and STL/3MF/OFF export.

  • Local Ollama planning for multi-step natural-language requests.

  • Guarded scripting with audit logging.

Related MCP server: OpenSCAD MCP Server

Install and run

python -m pip install -e ".[dev]"
hammer-cad-mcp

For an uninstalled checkout:

$env:PYTHONPATH = "src"
python -m hammer_cad_mcp.server

The server uses MCP stdio transport and waits silently when started directly.

MCP client configuration

{
  "mcpServers": {
    "hammer-cad": {
      "command": "python",
      "args": ["-m", "hammer_cad_mcp.server"],
      "cwd": "C:\\path\\to\\HammerMCP",
      "env": {
        "PYTHONPATH": "C:\\path\\to\\HammerMCP\\src"
      }
    }
  }
}

Natural-language planning defaults to local llama3:latest through Ollama. Change the model or URL in config/config.json.

Test

python -m pytest -q
python scripts\mcp_smoke_test.py

Generated files are written to output/.

Available Tools

23 tools
add_dimensionC

Add a linear DXF dimension.

Inputs: point1 (required), point2 (required), dim_line_point (required). Returns: path, message, success, entity_id

boolean_differenceC

Subtract later OpenSCAD objects from the first.

Inputs: object_ids (required). Returns: path, message, success, entity_id

boolean_intersectionC

Intersect OpenSCAD objects.

Inputs: object_ids (required). Returns: path, message, success, entity_id

boolean_unionD

Union OpenSCAD objects.

Inputs: object_ids (required). Returns: path, message, success, entity_id

create_boxC

Create an OpenSCAD box.

Inputs: size (required), position. Returns: path, message, success, entity_id

create_cylinderC

Create an OpenSCAD cylinder.

Inputs: height (required), radius (required), position. Returns: path, message, success, entity_id

create_layerC

Create or update a DXF layer.

Inputs: name (required), color. Returns: path, message, success, entity_id

create_sphereC

Create an OpenSCAD sphere.

Inputs: radius (required), position. Returns: path, message, success, entity_id

draw_arcC

Draw a DXF arc using angles in degrees.

Inputs: center (required), radius (required), end_angle (required), start_angle (required), +2 more. Returns: path, message, success, entity_id

draw_circleC

Draw a DXF circle.

Inputs: center (required), radius (required), color, layer. Returns: path, message, success, entity_id

draw_hatchC

Add a hatch inside a closed polygon boundary.

Inputs: boundary (required), color, layer, scale, +1 more. Returns: path, message, success, entity_id

draw_lineD

Draw a DXF line.

Inputs: end (required), start (required), color, layer. Returns: path, message, success, entity_id

draw_polylineC

Draw a DXF lightweight polyline.

Inputs: points (required), color, layer, closed. Returns: path, message, success, entity_id

draw_rectangleC

Draw an axis-aligned DXF rectangle.

Inputs: corner1 (required), corner2 (required), color, layer. Returns: path, message, success, entity_id

draw_textC

Add single-line text to the DXF drawing.

Inputs: content (required), position (required), color, layer, +1 more. Returns: path, message, success, entity_id

execute_scriptC

Execute guarded ezdxf Python or append raw OpenSCAD code.

Inputs: code (required), tier (required), dry_run. Returns: code, tier, dry_run, message, +1 more

export_modelC

Export the current OpenSCAD model.

Inputs: format (required), output_path (required). Returns: path, message, success, entity_id

linear_extrudeC

Extrude a closed 2D polygon in OpenSCAD.

Inputs: height (required), profile_points (required). Returns: path, message, success, entity_id

process_commandC

Plan and execute a natural-language CAD request.

Inputs: text (required), context. Returns: result

render_preview_2dC

Render the current DXF drawing to PNG.

Inputs: output_path. Returns: path, message, success, entity_id

render_preview_3dC

Render the current OpenSCAD model to PNG.

Inputs: output_path. Returns: path, message, success, entity_id

save_drawingC

Save the current drawing as DXF.

Inputs: filename. Returns: path, message, success, entity_id

save_openscadC

Save the current OpenSCAD source without invoking the CLI.

Inputs: output_path. Returns: path, message, success, entity_id

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 23 tools

    Disambiguation5/5

    All tools have clearly distinct purposes, separated by domain (DXF vs OpenSCAD) and operation type. No two tools appear to do the same thing; even similar-named tools like create_box and draw_rectangle target different axes (3D vs 2D).

    Naming Consistency3/5

    Naming conventions are mixed: some use 'draw_', some 'create_', some 'boolean_', and others have no consistent prefix (e.g., linear_extrude, export_model). While readable, the lack of a uniform pattern makes it harder for an agent to predict tool names.

    Tool Count4/5

    23 tools is slightly on the higher side but appropriate for a CAD server covering both 2D and 3D. Each tool serves a distinct purpose, and the count is justified by the need to handle primitives, operations, rendering, and file I/O.

    Completeness4/5

    The tool set covers basic shape creation, boolean operations, extrusion, rendering, and file saving. Minor gaps include lack of editing tools for existing objects (e.g., move, rotate) and more advanced DXF entities like splines, but core CAD workflows are supported.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables reading, analyzing, and editing CAD files (DXF and DWG) via natural language, including entity queries, layer management, and safe copy-based edits.
      17
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables an AI assistant to conversationally control Autodesk AutoCAD, drawing, inspecting, and editing plans, and includes a cross-platform DXF engine that runs without AutoCAD on macOS and Linux. It exposes tools for rendering views as images, batching geometry, blocks, and structures, measuring and checking plans, and undoing whole batches.
      12
      MIT