nanobot-host-broker
Provides read-only GitHub tools for generating digests and reading issues/repository information via the authenticated gh CLI.
Provides tools to search and read Gmail messages and create Gmail drafts through Google OAuth tokens with narrowly scoped permissions.
Uses Google OAuth and Google APIs to access Gmail and Calendar on the user's behalf, enforcing the granted API scopes.
Sends approval requests and one-time verification codes to the user over Telegram before gated host actions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
nanobot-host-broker
A host-side MCP server for nanobot agents whose shell runs in a sandbox.
With tools.exec.sandbox: "bwrap" and restrictToWorkspace: true, nanobot's shell sees only /usr and its workspace. It holds no API key, can't read your mail and can't touch the rest of the machine. That is the point, but some host actions are still useful: reading mail, drafting a reply, adding a calendar event, starting a coding task, or running one command as root.
This server runs outside the sandbox. The nanobot gateway starts it as a stdio MCP server. It exposes a fixed set of tools, each with a narrow contract, and it asks you on Telegram before any action that leaves the machine or changes something others see.
It is an independent project, not part of nanobot. Linux only. Version 0.1: the plugin interface may still change.
How it keeps the agent in its lane
Fixed tools, argv only. Every subprocess gets an argument list, never a shell string built from tool input.
Read freely, write narrowly. Reads are free. Writes are append-only or create-only, to files you list in the config folder, never to a path the agent picks.
Outward actions need your code. A calendar event, a coding task, or a plugin's own gated action sends you a one-time 6-digit code on Telegram, together with the exact reply to type. The agent can only act once you paste that reply into a chat with it. Codes are stored hashed, used once, valid for 2 hours, and three wrong tries cancel the request.
Root goes through your phone.
root_requestuses agent-sudo's phone approval: a tap plus a TOTP code, checked by a root service the agent can't reach. The agent never sees the approval.No code from the agent's reach. The loader refuses a config, plugin or plugin folder inside
untrusted_paths(the agent's workspace), or writable by other users.Untrusted text is labelled. Mail, calendar entries and GitHub issues come back with a note that they are data, not instructions.
Related MCP server: MCP ToolHub
Install
Into the Python environment nanobot runs in:
~/.nanobot/venv/bin/pip install git+https://github.com/citizenu03bb/nanobot-host-brokerCopy examples/config.toml (and examples/plugins/ if you want local plugins) somewhere outside the agent's workspace, and edit it. Check what nanobot will see:
~/.nanobot/venv/bin/python -m hostbroker --config ~/hostbroker/config.toml --list-toolsThen add the server to nanobot's config (~/.nanobot/config.json, under tools.mcpServers) and restart the gateway:
"host": {"command": "/home/you/.nanobot/venv/bin/python",
"args": ["-m", "hostbroker", "--config", "/home/you/hostbroker/config.toml"],
"toolTimeout": 660}toolTimeout must exceed 630 seconds if you enable root_request, which waits up to 5 minutes for your answer and then for the command.
Configuration
One TOML file. [broker]:
Key | Meaning |
| MCP server name, the key in |
| your name as tool descriptions use it (default |
| the agent's name in approval messages, branches and commits (default |
| language of messages sent to you: |
| folder name under |
| folders the agent can write (default |
| built-in plugins to load, in order |
| folders of your own plugins (relative to the config file) and the |
[telegram]: env_file (a KEY=VALUE file read without a shell), token_var (default TELEGRAM_BOT_TOKEN), chat_id (default: the first approved Telegram chat in nanobot's pairing.json). Codes come from the same bot you talk to nanobot with.
Each plugin reads its options from [plugins.<name>].
Built-in plugins
Plugin | Tools | Needs |
|
| agent-sudo with its phone approval service; option |
|
| the Codex CLI; allowed repos in |
|
| a Google token with |
|
| a second Google token ( |
|
| the second token; option |
|
|
|
|
| inboxes in |
When a loaded plugin declares an approval kind, the core adds approval_pending, which lists open requests (never the codes) and tells the agent which tool takes each kind of code.
Google tokens
Create an OAuth client of type "Desktop app" in a Google Cloud project with the Gmail API (and the Calendar API for calendar) enabled. Save its JSON as gmail-client.json in the config folder, or enter its ID and secret with --setup-client. Then, from a desktop session:
python -m hostbroker.google.auth --config config.toml # read-only Gmail token
python -m hostbroker.google.auth --config config.toml --write # drafts + calendar token
python -m hostbroker.google.auth --config config.toml --all # bothEach token is refused if Google grants any scope beyond its own. While the OAuth app stays in Google's "Testing" mode, refresh tokens expire after 7 days, so rerun --all weekly.
Writing a plugin
A plugin is a module with register(broker, options):
from hostbroker import approvals
from hostbroker.core import fill
def register(broker, options):
@broker.tool()
def hello(name: str) -> str:
"""Greet someone on behalf of {owner}.""" # the description the agent reads
return f"{options.get('greeting', 'Hello')}, {name}!"@broker.tool()registers the function; its signature becomes the tool's schema.{owner}and{agent}in the docstring are filled in from the config.hostbroker.corehas the helpers:run(argv, timeout, bounded),cap,read_json/write_json(0600),write_lock,md_cell,fill,t(en=..., fr=...)andsettings.For an action that needs your code, call
approvals.request(kind, payload, summary, what)in one tool andapprovals.check(kind, request_id, code)in another, and declare the pair withbroker.approval_kind(kind, tool_name). Seeexamples/plugins/hello.py.
Local plugins are imported from their file as hostbroker_local.<name>, so they can't shadow other modules. Keep the folder outside the agent's workspace: the loader checks it and every .py file in it.
Tests
python -m unittest discover -s testsHermetic: no network, no Telegram, no Google, no real agent-sudo or Codex.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Permission checks, human approval cards, and signed audit trails for AI agent tool calls.
Governed email for AI agents: a sandbox inbox to read and send from, human approval to go external.
Authorize AI agent tool calls before they run: policy-as-code, human approval, signed receipts.
Secure gift, flower, occasion, reminder, approval, and growth tools for personal AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables controlled delegation of tasks to local coding-agent CLIs and the Manus API, with strict sandboxing, approval tracking, and remote-egress safeguards.MIT
- FlicenseAqualityCmaintenanceEnables coding agents to perform workspace-confined file operations, read-only Git inspection, and structured shell commands, while requiring out-of-band human approval for mutations and external executions and maintaining an audit trail.143-
- AlicenseAqualityDmaintenanceEnables coding agents to safely inspect and modify project files within explicitly allowed workspace roots, with controls for file operations, git status/diff, and optionally allowlisted command execution.11Apache 2.0
- FlicenseAqualityBmaintenanceEnables AI agents to safely interact with GitHub, query Postgres read-only, check deployment status, and search/read files within an allowlisted sandbox—all with dry-run writes and SQL/path safety gates.8-