ReferenceAgent reference
Agent reference#
Which tools, templates and AGENTS.md lines does the skill point to?
On this page
The parts of the skill an agent looks up rather than keeps in mind: the MCP tools and their inputs, the templates by group, the per-agent setup commands and a snippet for a repo's AGENTS.md. The rules stay in the skill. The generated pages carry every detail: MCP tools, providers and templates and the ask object.
MCP tools#
Every tool except vault_templates also takes workspace? (a slug or id), needed when this server may use more than one workspace and neither the call nor the checkout decides:
vault_status:mehen status --json, every workspace this server may use, each with itsstate; before any enrolment it is a success withnext.commandvault_doctor:mehen doctor --json, every check in one call with the next step; before enrolment toovault_templates(id?):mehen templates --json, no networkvault_list(tag?,kind?,provider?)vault_show(item), withpolicySummaryvault_check(item,method,url,headers?,body?): advisory; fetches public item metadata, sends nothing upstream and creates no approvalvault_request(kind,name,reason,provider?,tags?,hosts?,paths?,injection?,new?,home?,project?):homedefaults to private, which a machine withscope.privateCredentialsfalse cannot use; passhome: "project"withproject, orhome: "workspace"vault_connect(provider,name,reason,client?,scopes?,expect?,requestClient?,clientTags?,new?,home?,project?)vault_fetch(itemorrun,method,url,headers?,body?orbodyBase64?,approval?,context?{ project, environment },select?,timeoutSeconds?)vault_env(env?,cwd?,check?): thecwd'smehen.tomlselects the workspace; one outside what the server may use isworkspace_not_allowedvault_wait(idofint_,apr_,con_,enr_,adp_orpol_,timeoutSeconds?up to 600, default 45): finds the id in whichever workspace holds it; sendsnotifications/progresswhen the call carries aprogressTokenvault_pending:{ pending: Ask[], notices? }, this machine's own asks in every workspace, each with itscontext, and its own notices when there are anyvault_adopt_scanandvault_adopt_status: names and batch state formehen adopt, never valuesvault_policy(action,item?,change?,reason?,proposal?,id?): read an item's policy (show) or stop your access (stop,cancel). Proposing or previewing a policy window is refused by the vault in this release (forbidden, "Policy widening is not available yet"): do not retry it, and never treat a policy window as a way round a protected context
Any result or error that hands over a link carries ask in structuredContent and a resource_link in content; isError stays true for approval_required, needs_reauth, client_missing and timeout. No tool opens a link.
Templates#
Kind api-key, by group:
- AI:
openai,anthropic,google-gemini,mistral,groq,openrouter,together,ollama-cloud - Code:
github-pat,snyk,vercel,npm - Work:
linear,slack-bot,notion(sendNotion-Versionyourself),gitbook,fathom - Observability:
sentry,posthog,betterstack-uptime - Infrastructure:
cloudflare-api-token,hetzner-cloud,scaleway,neon - Customers and email:
stripe,hubspot-private-app,intercom,resend,postmark-server,loops - Search and media:
brave-search,serpapi,semrush,firecrawl,browserbase,elevenlabs,heygen
Kind oauth-client: google-oauth-client, github-oauth-client, microsoft-oauth-client. OAuth providers for mehen connect: google-gmail, google-calendar, google-drive, github-oauth, microsoft-graph.
mehen templates (MCP vault_templates) is the live list, grouped the same way, with what each allows, holds and refuses.
Setup for one agent#
mehen setup --json registers every agent it finds. To register only a named client, use its writer; inspect the report and restart that agent:
mehen setup --agent claude-code --json
mehen setup --agent codex --json
mehen setup --agent pi --json--mcp-file <path> writes mcpServers.mehen into a compatible JSON client's file; use --agent vscode or --agent opencode for those clients' different formats. mehen setup --print --json prints the entry without writing anything.
AGENTS.md snippet#
Paste this into a repo's AGENTS.md (or CLAUDE.md) when the repo uses Mehen:
## Credentials
This repo uses Mehen. Secrets never appear in this repo, in chat or in your context.
- Never ask a human to paste a secret into chat, and never write one to a file, `.env` or commit.
If one is pasted, do not use it; say it should be rotated.
- Run `mehen` with `--json`. Variables are declared in `mehen.toml` (committed, no values), which also
names the project's workspace and vault. Check them with `mehen env check` and run anything that needs
them with `mehen run -- <cmd>`. Read the `mehen:` line it prints on stderr and stop if the project or
environment is wrong.
- Production runs need a literal `--env prod` and a human's approval. Never set `MEHEN_ENV=prod`.
- Call authenticated APIs with `mehen fetch <item> <METHOD> <url>` or the `vault_fetch` MCP tool.
Never set auth headers or put a key or placeholder in a URL or body yourself.
- Missing credential: `mehen request <kind> --name <slug> --provider <template> --home project --reason "<why>"`
(`--home project` puts it in this checkout's project, so the whole team can use it; without it the
credential is private to the human), write the human the `ask` (link, what it is for, what to check,
when it expires), then `mehen wait <id> --timeout 60 --json`. `mehen pending` lists the links still open. Trust only links under
`https://app.mehen.dev/w/<slug>/` that `mehen` handed over.
- On any refusal, follow the `next` field and relay the `ask` or `next.say` to the human. Exit 3
means approval required: send the link and the binding code, `mehen wait <approval> --timeout 60 --json`, then repeat
the same request unchanged. Exit 5 means refused by rule: do not retry or work around it.
- Full guide: `mehen guide`.