You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -77,10 +77,10 @@ Clients that support OAuth can use this to allow you to give the client access
77
77
to your Home Assistant MCP server.
78
78
79
79
Home Assistant has adopted [IndieAuth](https://indieauth.spec.indieweb.org/) and does not require you to pre-define
80
-
an OAuth Client ID. Instead, the Client ID is the base of the redirect URL.
80
+
an OAuth Client ID. Instead, the Client ID is the base URL of the client application making the request.
81
81
82
-
-*Client ID*: If your redirect-uri is `https://www.example.com/mcp/redirect`, your client ID should be `https://www.example.com`.
83
-
-*Client Secret*: This is not used by Home Assistant and can be ignored or set to any value.
82
+
-*Client ID*: This is the base URL of the LLM application configuring the connector (for example, `https://claude.ai` for Claude, or `https://chatgpt.com` for ChatGPT). It should **not** be your Home Assistant server's URL.
83
+
-*Client Secret*: This is not used by Home Assistant. If the client strictly requires a value, you can put any random text or leave it blank.
84
84
85
85
#### Long-Lived Access Tokens
86
86
@@ -97,24 +97,76 @@ For more information about Authentication in Home Assistant, refer to the [Authe
97
97
98
98
### Example: Claude for Desktop
99
99
100
-
Claude for Desktop now supports remote MCP servers, making it extremely easy to connect to your
101
-
Home Assistant instance:
100
+
Claude for Desktop can connect to Home Assistant using either a cloud-based remote connector or a local MCP proxy server.
101
+
102
+
**Option 1: Remote connector (requires public Home Assistant URL)**
103
+
104
+
When using a remote custom connector in Claude for Desktop, the connection is brokered through Anthropic's cloud infrastructure. This means your Home Assistant instance must be publicly accessible from the internet.
102
105
103
106
1. Download [Claude for Desktop](https://claude.ai/download) and log in.
104
-
2.Click your profile name, select **Settings**, and go to **Connectors**.
105
-
3.Click**Add Custom Connector**.
107
+
2.Select your profile name, select **Settings**, and go to **Connectors**.
108
+
3.Select**Add Custom Connector**.
106
109
4. Enter the following details:
107
110
-**Name**: "Home Assistant" (or any more descriptive name you prefer)
108
-
-**Remote MCP Server URL**: `https://<your_home_assistant_url>/api/mcp`
111
+
-**Remote MCP Server URL**: `https://<your_home_assistant_external_url>/api/mcp`
109
112
- Under advanced settings:
110
113
-**OAuth Client ID**: `https://claude.ai`
111
114
-**OAuth Client Secret**: Leave this blank
112
-
5.Click**OK**. Now click**Connect** next to the entry created with the name you provided above.
115
+
5.Select**OK**. Now select**Connect** next to the entry created with the name you provided above.
113
116
6. Log in to your Home Assistant instance and allow the redirect back to Claude Desktop.
114
117
7. You can now enable tools from Home Assistant when chatting with Claude, allowing you to control Home Assistant in a similar way to how you control it through the Voice Assistant. Claude will ask you for permission before calling any tools.
115
118
116
119

117
120
121
+
**Option 2: Local MCP proxy server (for internal/local Home Assistant URLs)**
122
+
123
+
If your Home Assistant instance is only accessible on your local network (for example, `http://homeassistant.local:8123` or `http://192.168.1.10:8123`) or behind a VPN, you can use a local MCP proxy. This allows Claude Desktop to connect directly from your computer without routing through Anthropic's cloud.
124
+
125
+
1. Make sure you have a [Long-lived access token](#long-lived-access-tokens) from your Home Assistant account.
126
+
2. Install `mcp-proxy` following the instructions in the [README](https://github.com/sparfenyuk/mcp-proxy). For example: `uv tool install git+https://github.com/sparfenyuk/mcp-proxy`.
127
+
3. Locate your Claude Desktop configuration file (for example, `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS or `%APPDATA%\Claude\claude_desktop_config.json` on Windows).
128
+
4. Add the following to your `mcpServers` configuration:
ChatGPT supports connecting to remote Model Context Protocol servers for Plus, Pro, Business, and Enterprise/Edu users. ChatGPT currently only supports remote connections, which means your Home Assistant instance must be publicly accessible from the internet.
152
+
153
+
1. Log in to [ChatGPT](https://chatgpt.com). Ensure developer mode is enabled for your account (this can be toggled in **Settings** > **Apps** > **Advanced Settings**).
154
+
2. Navigate to **Workspace settings** (or user settings), select **Apps**, and select **Create**.
155
+
3. Enter the following details:
156
+
-**Name**: "Home Assistant" (or any name you prefer).
157
+
-**MCP Server URL**: `https://<your_home_assistant_external_url>/api/mcp`
158
+
- Select **OAuth** for the authentication mechanism. ChatGPT will attempt to auto discover OAuth settings. If this does not work you will need to manually enter the settings under **Advanced OAuth Settings** > **User defined oauth client**:
159
+
- Under **Client registration**:
160
+
-**OAuth Client ID**: `https://chatgpt.com`
161
+
-**OAuth Client Secret**: Enter any random text (it is not used by Home Assistant, but the ChatGPT configuration form may require a value).
-**Authorization server base**: `https://<your_home_assistant_external_url>`
167
+
4. Select **Create**. Once created, the app will appear in your **Enabled Apps**.
168
+
5. Begin a new chat in ChatGPT, open the apps menu, and select your newly created Home Assistant app. ChatGPT will prompt you to authenticate, which will redirect you to Home Assistant to log in and authorize the connection.
169
+
118
170
### Example: Claude Code
119
171
120
172
Claude Code supports remote MCP servers, making it easy to connect to your Home Assistant instance:
@@ -132,7 +184,7 @@ Claude Code supports remote MCP servers, making it easy to connect to your Home
132
184
}
133
185
}' --client-secret
134
186
```
135
-
The name "HA", the URL "https://<your_home_assistant_url>", and the callback port "12345" are examples; adjust them to match your setup.
187
+
The name `"HA"`, the URL `"https://<your_home_assistant_url>"`, and the callback port `"12345"` are examples; adjust them to match your setup.*(Note: `clientId: "http://localhost:12345"` is correct for the Claude Code CLI's internal local callback server. Do not change this to your Home Assistant URL.)*
136
188
137
189
3. Start `claude` and type `/mcp`. Navigate to your MCP listing (for example, **HA**) and press Enter. Select **Authenticate** to open a web browser to your Home Assistant login page.
138
190
4. After you authenticate to your Home Assistant server, Home Assistant will tell you that you can close the web browser.
@@ -144,24 +196,25 @@ Claude Code supports remote MCP servers, making it easy to connect to your Home
144
196
2. Install `mcp-proxy` following the instructions in the [README](https://github.com/sparfenyuk/mcp-proxy).
145
197
For example, `uv tool install git+https://github.com/sparfenyuk/mcp-proxy`.
146
198
3. Open the main Cursor Settings and select **MCP**.
147
-
4. Click **Add new global MCP server** and add the Home Assistant server configuration:
199
+
4. Select **Add new global MCP server** and add the Home Assistant server configuration:
5. Save your `mcp.json` file. You can also find this file in the `$HOME/.cursor/mcp.json` directory.
166
219
6. Restart Cursor and return to the MCP settings. You should see the Home Assistant server in the list. The indicator should be green.
167
220
7. In chat agent mode (Ctrl+I), ask it to control your home and the tool should be used.
@@ -205,18 +258,16 @@ The [MCP Prompts](https://modelcontextprotocol.io/docs/concepts/prompts) provide
205
258
inform LLMs how to call the tools. The tools used by the configured LLM API
206
259
are exposed.
207
260
208
-
## Known Limitations
261
+
## Known limitations
209
262
210
263
The Home Assistant Model Context Protocol integration currently only supports a
211
264
subset of MCP features:
212
265
213
-
| Feature | Supported by Home Assistant |
214
-
| ------- | --------- |
215
-
| Prompts | ✅ |
216
-
| Tools | ✅ |
217
-
| Resources | ❌ |
218
-
| Sampling | ❌ |
219
-
| Notifications | ❌ |
266
+
- **Prompts**: Supported
267
+
- **Tools**: Supported
268
+
- **Resources**: Not supported
269
+
- **Sampling**: Not supported
270
+
- **Notifications**: Not supported
220
271
221
272
222
273
## Troubleshooting
@@ -254,17 +305,27 @@ or the MCP server in Home Assistant is not configured.
254
305
255
306
To understand the root cause, first check debug logs on the client. For example in Claude for Desktop:
256
307
257
-
1. Visit **Settings...**.
308
+
1. Select **Settings...**.
258
309
2. Select **Developer**.
259
-
3. Select the `Home Assistant` MCP server.
310
+
3. Select the **Home Assistant** MCP server.
260
311
4. Select **Open Logs Folder**.
261
312
5. View `mcp-server-Home Assistant.log`. These are known problems and their resolution:
262
-
- `Client error '404 Not Found' for url 'http://localhost:8123/api/mcp'`:
313
+
- `Client error '404 Not Found' for url 'http://<your_local_home_assistant_ip_or_url>:8123/api/mcp'`:
263
314
this means the MCP Server integration is not configured in Home Assistant.
264
-
- `Client error '401 Unauthorized' for url 'http://localhost:8123/api/mcp'`:
315
+
- `Client error '401 Unauthorized' for url 'http://<your_local_home_assistant_ip_or_url>:8123/api/mcp'`:
265
316
this means that the long live access token is not correct.
266
317
...
267
318
319
+
### Repeated OAuth failures
320
+
321
+
#### Symptom: Unable to access Home Assistant after several failed login attempts
322
+
323
+
If you accidentally enter incorrect credentials or configuration details multiple times during the OAuth setup flow, Home Assistant might temporarily block your IP address for security.
324
+
325
+
##### Resolution
326
+
327
+
Check your `ip_bans.yaml` file in the Home Assistant configuration directory. If your computer's IP address or the client's IP is listed there, remove it and restart Home Assistant, then try authenticating again.
328
+
268
329
## Removing the integration
269
330
270
331
This integration can be removed by following these steps:
0 commit comments