Add admin-only Homebox MCP connector #52

Merged
ryan merged 1 commits from feat/homebox-mcp into main 2026-10-12 16:45:32 -04:00
Owner

Summary

  • Connects the agent to Homebox via homebox-mcp (pinned 1.1.0, stdio, installed in the image).
  • Exposes 11 allowlisted tools as homebox_*: search/get item, locations and contents, tags, warranties, stats, maintenance, plus create_item, move_item and log_maintenance. No deletes, bulk import or attachments.
  • Admin-only: the tools are compiled into a separate app.admin_agent, and get_agent_for(user) routes only admins to it (web, iMessage, WhatsApp). Each tool also re-checks is_admin per call. Email, cron and scheduled messages stay on main_agent.
  • Fails softly: with HOMEBOX_URL/HOMEBOX_TOKEN unset or the server down, the admin agent falls back to the main agent.
  • uv.lock was stale (missing langgraph-checkpoint-sqlite), so I re-resolved it and bumped langgraph/langchain to fix a version skew. The image installs from pyproject, so production deps are unchanged.

Setup

Set HOMEBOX_URL and HOMEBOX_TOKEN (hb_... API key, Homebox >= 0.26) in .env.

Testing

  • pytest tests/ -q: 93 passed (new tests/unit/test_homebox_mcp.py).
  • Listed the real homebox-mcp 1.1.0 tools against a fake URL: all 11 allowlisted tools are present, and errors come back as text.
  • Ran a wrapped tool through a LangGraph ToolNode: the admin call goes through and the non-admin call is refused.
  • Not yet run against a live Homebox.

🤖 Generated with Claude Code

## Summary - Connects the agent to Homebox via [homebox-mcp](https://github.com/dgahagan/homebox-mcp) (pinned 1.1.0, stdio, installed in the image). - Exposes 11 allowlisted tools as `homebox_*`: search/get item, locations and contents, tags, warranties, stats, maintenance, plus create_item, move_item and log_maintenance. No deletes, bulk import or attachments. - **Admin-only**: the tools are compiled into a separate `app.admin_agent`, and `get_agent_for(user)` routes only admins to it (web, iMessage, WhatsApp). Each tool also re-checks `is_admin` per call. Email, cron and scheduled messages stay on `main_agent`. - Fails softly: with `HOMEBOX_URL`/`HOMEBOX_TOKEN` unset or the server down, the admin agent falls back to the main agent. - `uv.lock` was stale (missing `langgraph-checkpoint-sqlite`), so I re-resolved it and bumped langgraph/langchain to fix a version skew. The image installs from pyproject, so production deps are unchanged. ## Setup Set `HOMEBOX_URL` and `HOMEBOX_TOKEN` (`hb_...` API key, Homebox >= 0.26) in `.env`. ## Testing - `pytest tests/ -q`: 93 passed (new `tests/unit/test_homebox_mcp.py`). - Listed the real homebox-mcp 1.1.0 tools against a fake URL: all 11 allowlisted tools are present, and errors come back as text. - Ran a wrapped tool through a LangGraph ToolNode: the admin call goes through and the non-admin call is refused. - Not yet run against a live Homebox. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ryan added 1 commit 2026-10-11 11:01:29 -04:00
Load an allowlisted subset of homebox-mcp tools (read + safe writes, no
deletes) over stdio and compile them into a separate admin agent, so
non-admins never see them. Each tool also re-checks is_admin per call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryan merged commit e03c10cde5 into main 2026-10-12 16:45:32 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#52