Using Cursor with Home Assistant

I have been using Cursor a lot for programming and I feel like it would be an amazing pairing with Home Assistant. I have managed to SSH into Home Assistant via Cursor however that does not keep my Cursor configs (MCPs, etc) when I do it that way.

Ideally what I am looking for is a way to work on my Home Assistant config like I would would any other repo: using version control via git, make changes in a new branch, open an MR and and merge into main. Once that is done, Home Assistant would automatically pull the latest version of the code from GitHub.

My setup is:

  1. Raspberry Pi 5 running Home Assistant
  2. This is actually exposed via Cloudflare on a website so I can manage it remotely
  3. Use Cursor as my IDE
  4. GitHub for version control

Has anyone experimented with this? If so, how did you set it up?

1 Like

I have partially answered my question.

Added this to automations.yaml

- id: git_sync
  alias: Git Sync Config
  trigger:
    platform: webhook
    webhook_id: update_config
  action:
    - service: persistent_notification.create
      data:
        title: "Git Sync Webhook Fired"
        message: "update_config received at {{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
    - service: shell_command.pull_and_restart
    - service: homeassistant.restart

And this to configuration.yaml

shell_command:
  pull_and_restart: >
    bash /homeassistant/bin/update-ha.sh

Also, create a Github repo and created a webhook in Github.

Now this is good for managing automations and configurations but two things are missing:

  1. I need Cursor to have full access to my devices, entities etc so it can create high quality automations
  2. I want Cursor to assist me in creating dashboards, which is one of my least favourite things hence would love to automate it.
2 Likes

This would be extremely interesting for me as well. I mean there is Studio Code Server, so getting Cursor to work over SSH should not be too difficult. But i tried and tried without success.

This might not be answering the original question involving version control, but with regards to getting Cursor to work over SSH, here’s how I managed:

  • In Home Assistant
    • In the standard SSH add-on, enable TCP forwarding
      (in UI: Configuration > Server > tcp_forwarding)
    • Note: Studio Code Server isn’t needed
  • Config SSH authentication as you wish and confirm you can connect
  • In Cursor:
    • Using the Remote-SSH extension, connect to the HA server
      (from command palette: Remote-SSH: Connect to Host)
    • Cursor will automatically install Cursor Server on your HA
      server
    • Once installed, you should be able to open any HA folder!

The key sticking point is likely the TCP forwarding. Cursor installs its own server, but the problem seems to be whether Cursor can reach it afterwards.

(Note that you don’t need the Cursor/VS “Home Assistant Config Helper” add-on to connect, but it can still be helpful for auto-completion, validation, etc.)

Hey! :wave:
I’ve been working on exactly this kind of setup and ended up building a solution that connects Cursor IDE directly to Home Assistant through the MCP protocol.

It lets you:

  • edit and deploy automations right from Cursor,
  • version all configs and scripts via Git,
  • and communicate with Home Assistant through an on-board Agent (running on your Raspberry Pi).

Basically, it turns your Home Assistant setup into a developer-friendly workflow — you can treat it like any other codebase: branch → edit → commit → deploy, all without SSH or manual YAML uploads.

I wrote a detailed story and released the full source code here:
:point_right: Cursor agent for Home Assistant | How I built a multi-zone heating controller and a Home Assistant Agent + MCP for Cursor.

Would love to hear your thoughts if you try it out!