Advanced Token Management (ATM)

A few weeks ago I read a conversation in the Reddit Home Assistant forum where several people were grumbling about never giving their Long Life Access Token (LLAT) to AI agents. This topic somehow inspired me. Regardless of which side of that debate you’re on, I hope you may find my solution interesting and maybe even useful.

Introducing Advanced Token Management (ATM). It’s a custom integration which grants granular control over how much your AI agent, or other MCP clients, can do. It’s a highly security-focused MCP server, with a number of constraints built-in to help prevent abuse - and mistakes. You may even no longer need your LLAT, in fact you can uninstall your HA native MCP server if you want.

It is super simple to get started: Just create a token. Every token starts life with zero permissions, so you add only the permissions you require and no more. You can apply READ/WRITE/DENY permissions at the Domain, Device and individual Entity level using a simple node tree. You then provide this token to your AI agent in place of the usual LLAT. ATM is fully compatible with the native HA MCP server, you only need to change the endpoint from /api/mcp to /api/atm/mcp, and that’s it. ATM is also a fully functional REST endpoint.

You can create multiple tokens, each with different permissions for different purposes. Apart from the granular permissions you also get rate limiting and expiry date per token, token rotation and revocation, and full logging of all operations. Behind the scenes, ATM scrubs any references in it’s responses to data the token doesn’t have access to as well as completely blocking specific entities which may potentially leak user data. There are a number of optional Capability Flags to grant greater access to your system, if you require it. There is also a pass-through mode, which effectively gives your token full system access - you can toggle it on and off as needed. If you ever need it, there is a kill switch which immediately disables all tokens and closes all connections.

Lastly, I felt the native HA MCP toolset was rather limited, so I added extra tools to ATM so you can do stuff like edit automations and scripts, restart HA, read HA logs, and quite a bit more.

And finally - yes, this integration was coded with the assistance of AI. The fact that I’m a retired software engineer (over 40 years) probably won’t make any difference to you if you just “hate all AI slop”, but I hope this knowledge helps others make an informed decision whether to use my software. I stand behind my work, I fully support it, and wouldn’t release it if it didn’t pass the same scrutiny as if it were fully human coded.