pyRevit + MCP + Claude Code Tutorial
In the last year, we've tried and reviewed several ways to use AI inside Revit.
Combining pyRevit MCP + Claude Code seems to be themost powerful setup.
It also happens to be free, beyond having a Claude subscription. However, this one isn't quite "plug and play". There are a few steps you must follow to get the setup going.
Special thanks to Alex Ritivoi and Jean-Marc Couffin for the help.

 

And last thing: pyRevit is free and open-source, and maintained by volunteers. Consider donating to the project: link
Why pyRevit + MCP + Claude Code is so powerful
There are three key features of pyRevit + MCP that make it so powerful with Claude Code.
1- pyRevit MCP has a MCP tool to generate and run Python code on the spot.
2- pyRevit can easily let you create extensions.
3- Claude Code is extremely good at generating code and self-correcting.
Combine these three powers together, and you get an insanely helpful combo. For almost any Revit task you can think of, ask Claude Code to solve it. It will generate Python code. If it finds a bug or the code doesnt work, it will self-correct.
If you are happy with the results, you can ask to create a custom tool in a new pyRevit extension and deploy to your colleagues.
Although it is possible to use the pyRevit MCP server with the regular Claude chat mode, we recommend using Claude Code to unleash the full potential.
If you arent familiar with Claude and AI concepts, such as the MCP server, make sure to read this guide.

1- Prepare the Claude Code + pyRevit setup
For this tutorial, you will need:
- An active Claude paid subscription- Claude Desktop application (link here)- Full admin rights on your computer- pyRevit installed (link here)- Git is installed (see below)
Open Claude desktop application and go to the Code tab.
You will need to install Git: https://git-scm.com/install/windows
Git is a free tool that tracks versions of files and folders, which Claude Code needs running in the background to safely work with your local files. In some cases, you might need to restart your computer after installing Git.



2- Enable Revit MCP Server pyRevit Extension
Go to the Extensions menu in pyRevit. Find mcp-server-for-revit-python. Click on Install Extension.

You notice there is a Path name. This is something you can customize if necessary. Copy that value for the next step.

3- Install the MCP Server in Claude Code
Inside Claude Code, use a local environment and select the folder where the MCP server was installed.

Then, paste this link in the chat:
https://github.com/mcp-servers-for-revit/mcp-server-for-revit-python
Ask Claude Code to install the MCP server and guide you through the process. You might need to allow access a few times.


Claude Code might ask you to accomplish tasks by yourself, such as installing uv, a tool to manage Python packages.
But Claude doesnt always understand its own capabilities. You can simply ask to do it for you. Just say:
Install uv for me yourself.

4- Set Route in pyRevit
You need to set a route in pyRevit. Go to the pyRevit settings and select Routes.
Activate the Routes Server (beta).


5- Change Bind Address
By default, the Bind Address is set to 0.0.0.0. This is not ideal from a security point of view. Its better to switch to 127.0.0.1

Find the pyRevit config file.
Go to the AppData/Roaming/pyRevit folder. Open pyRevit_config.ini.
Search for Routes. Add these lines:
server_host = 127.0.0.1server_port = 48884
It should look like this:

Save the file and close. This will be more secure. Restart Revit and Claude Code.

6- Verify the MCP Connection Works
There are a couple of steps here that Claude Code might be confused about. You can add these instructions when chatting:
My pyRevit Routes server uses host 127.0.0.1 and port 48884 make the MCP server connect to exactly that, and use 127.0.0.1, not localhost.
If uv fails to install Python, dont get stuck on it set the server up another way using my system Python instead, and update my MCP config to match.
Then, open a Revit model, ensure everything is enabled, and ask Claude Code to verify if the MCP connection works.
Claude can self-troubleshoot if issues arise in the installation. You might need to restart Claude Desktop a few times.


7- Create your CLAUDE.md Instruction Files
In the local folder you have selected, you should create a CLAUDE.md (markdown) file with extra instructions. This isnt mandatory, but will improve the results of your prompts.
Use this prompt to generate the Claude.md file:
Set up a CLAUDE.md so you remember how my setup works in future sessions. Do these steps:

First, download pyRevits reference files into this folder: the full reference from docs.pyrevitlabs.io/llms-full.txt and the short index from docs.pyrevitlabs.io/llms.txt.
Then create a CLAUDE.md in this folder, short and in plain language. Include:
The connection details for my pyRevit MCP server (host and port). Check my setup, dont ask me.
My Revit version. Check Revit through the MCP, dont ask me.
The pyRevit and IronPython quirks you should follow so you stop repeating mistakes.
How I work: sometimes one-off tasks through the MCP, sometimes turning useful code into permanent pyRevit toolbar buttons. Be ready for both.
The rules that make your Revit code reliable: check elements exist and are editable before changing them, wrap edits in a transaction that undoes cleanly if it fails, and keep it efficient.
A note that LLM.txt, llms.txt, and llms-full.txt are in this folder. Explain that they are pyRevit and Revit references, that you should search them for what you need instead of loading them whole (theyre too big to read fully), and that this is why theyre worth keeping.
When youre done, show me the CLAUDE.md and explain in plain words what each part does.


8- Ask Claude Code to accomplish tasks in your model
By now, the MCP server should be working. You can simply ask Claude Code to accomplish tasks in your Revit model.
This will generate Python code on the spot and run it.
For example, you can ask: Delete all trees visible in the active view.





9- Claude Code Runs Python Script
This is a technical point, but important: the pyRevit MCP server runs Python code with a tool called execute_revit_code.
Other MCP servers, such as the NonicaTab and the official Autodesk, have pre-made tools. You can execute actions without the need to generate code on the spot.
But pyRevits MCP is different. The main attraction is that it runs code on the spot.
Basically, that means you can do anything with the pyRevit MCP server that exists with the Revit API. This is incredibly powerful, but with a few limitations. It runs slower than other pre-made MCP tools.
You can even see the Python code generated:



10- MCP Server is More Limited for Modeling
Fair warning: AI-generated code executed with pyRevit MCP server might not work for more complex tasks, especially when it involves generating several dialog boxes and UI interaction.
In our tests, we were able to generate a wall, but it didnt work out with stairs.
Overall, AI code works fine for light to repetitive tasks, but is still tricky and unreliable for complex tasks such as modeling.


11- General Purpose Tasks
Something interesting that a normal Revit add-in cannot do: instructions for a complex, project-specific task.
Prompt: Fix as many warnings as you can inside this model.
Claude tells me there are some warnings that can be fixed, and others Ill need to fix myself.

It managed to fix 23 warnings. I didnt need to detail every little step to fix the different types. It figured it out by itself.
Warning: running this kind of task on an active project could be risky.

12- Generate Dashboards
This is something we have explored in a previous video, but also possible with the pyRevit MCP.
You can ask Claude Code to generate a dashboard with project information. A difference between regular Claude chat and Claude Code is that the file will be created on your computer, not on the cloud. Youll need to open the file to see it.
Here is the prompt:
Build a Revit warnings dashboard for this model.1- Number of warnings by type2- Include a pie chart3- nice serif style beige and green UI super good looking.


13- Pick the Right Claude Model
For light, simple tasks, you can use Sonnet.
For complex tasks and multi-steps, such as creating a new extension, you should use Opus.
However, Opus burns a lot of tokens. You will most likely hit your limit with only a few prompts. In Claude Code, you can click on the circle to view your current limits.



14- Recap: the Ideal pyRevit + Claude Workflow
Use pyRevit MCP server to explore tasks and scripts. It is also great for one-off tasks you wont reuse in the future.
If you need to reuse tools in the future, convert them into a pyRevit extension. You can even push this extension to your colleagues, so they all have access to the same toolset.
Limitations: vibe-coding user interface or more complex tools wont always work. This doesnt replace all addins. But simple, repetitive, project or firm-specific tasks are amazing for this.

Download the Pamphlet PDF Guide
We've created a free PDF guide about this setup, which includes an extra tip about how to easily generate a pyRevit extension using the same workflow. Enter your email address to download.
//

Claude for BIM Live Course - Fall 2026
Were planning a new live course in the late summer / early fall of 2026. This will include live sessions with various masters in BIM + AI. Topics covered:
Key Claude AI ConceptspyRevit + Claude CodeMCP Servers for RevitClaude Cowork to vibe work in BIM
And more. The course will also include videos and tips on how to leverage this pyRevit MCP + Claude Code workflow. This will be included in the BIM Pure membership.
Get on the waitlist at https://bimpure.com/claude


https://www.bimpure.com/blog/p....yrevit-mcp-claude-co

image
×

Submit an Issue