Skip to main content

revit integration through the Model Context Protocol

Project description

Revit MCP

Overview

Revit MCP is a Python package that provides integration with Revit through the Model Context Protocol (MCP). It allows you to send commands to Revit and receive responses, enabling automation and interaction with Revit models.

Features

  • Connect to Revit addon socket server.
  • Send commands to create objects in Revit.
  • Handle responses and errors from Revit.
  • Manage server startup and shutdown lifecycle.

Installation

To install Revit MCP, you can use pip:from revit_mcp import RevitConnection

from revit_mcp import RevitConnection

# Create a RevitConnection instance
revit_connection = RevitConnection(host="localhost", port=8080)

# Connect to the Revit addon socket server
if revit_connection.connect():
    # Send a command to create an object in Revit
    response = revit_connection.send_command("CreateWalls", [
        {"startX": 0, "startY": 0, "endX": 12000, "endY": 0, "height": 3000, "width": 200},
        {"startX": 12000, "startY": 0, "endX": 12000, "endY": 10000, "height": 3000, "width": 200},
        {"startX": 12000, "startY": 10000, "endX": 0, "endY": 10000, "height": 3000, "width": 200},
        {"startX": 0, "startY": 10000, "endX": 0, "endY": 0, "height": 3000, "width": 200},
    ])

    # Handle the response
    if response.get("status") == "success":
        print("Object created successfully")
    else:
        print(f"Error: {response.get('message')}")

    # Disconnect from the Revit addon socket server
    revit_connection.disconnect()
else:
    print("Failed to connect to Revit")

This command will start the server using the main function defined in main.py, which in turn calls the main function from server.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revit_mcp-0.0.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revit_mcp-0.0.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file revit_mcp-0.0.1.tar.gz.

File metadata

  • Download URL: revit_mcp-0.0.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for revit_mcp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5b30dd67b9c7cf7a516d76d5c8a478be0bd7ebe39b24055ac01f07647ea311ba
MD5 bd268b7de40409b5acf4c46aaa414775
BLAKE2b-256 c424b4b2053ca02bc58967dd148b9268b70ce8874857ff9005b58852c90843cb

See more details on using hashes here.

File details

Details for the file revit_mcp-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: revit_mcp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for revit_mcp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb93d02d81d05743b9312ab0862cf00f072b15db9d6d2bd67a9ab44232f71cf2
MD5 5b177971be6de9346c31e22f82697cd3
BLAKE2b-256 f88cfa2747795fa5ce83cdb860766431c4d6588178ba8d3b5a98d238450df134

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page