alpacon-mcp: Instructions file for Claude Code

CLAUDE.md

alpacon-mcp CLAUDE.md is an instructions file for Claude Code from alpacax/alpacon-mcp. It costs 1,807 tokens per session, scanned A, original, MIT.

A project instruction file for Alpacon MCP, a service that lets AI assistants access zero-trust infrastructure through HTTP. It records rules, development commands, and important details such as using server IDs instead of names.

In plain words
What is it for?
For guiding development and maintenance of the Alpacon MCP server. It covers how to access servers, handle pending approvals, run the project, and follow its writing and architecture rules.
Why use it?
It keeps the assistant’s work consistent with the project’s safety rules and technical constraints, including human-only approval decisions and approved access routes.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is alpacax/alpacon-mcp's own configuration. It tells Claude Code how to work on alpacon-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything alpacon-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to alpacax/alpacon-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/alpacax/alpacon-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/alpacax/alpacon-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for alpacon-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/alpacax/alpacon-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/alpacax/alpacon-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/alpacax/alpacon-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/alpacax/alpacon-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for alpacon-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/alpacax/alpacon-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/alpacax/alpacon-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,807 This file is loaded in full into every session.
When invoked 1,807 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01807 $0.01807
Opus 5 $0.00903 $0.00903
Sonnet 5 $0.00361 $0.00361
Haiku 4.5 $0.00181 $0.00181

Measured 5d ago against content hash 58e74136c91a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

alpacon-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

Alpacon MCP Server: a FastMCP server that bridges Alpacon's zero-trust infrastructure access to AI assistants over plain HTTP. No alpacon CLI, no subprocess, no external binaries in the runtime path.

Red lines

  • Reach Alpacon only through mcp__alpacon__* tools. Never the alpacon CLI, never ssh, never a shell fallback when an MCP call fails. On failure: report the exact error, propose another MCP route, ask for the missing auth/config. This constrains how you talk to Alpacon—it does not restrict ordinary local work in this repo (pytest, git, uv).
  • server_id is always a UUID, never a server name. list_servers maps a name to its UUID. A name fails at the input validator, before the API call.
  • Approve/reject is human-only (ADR 0015). No approve_request tool exists and the server answers agent/token channels with 403. When a tool returns status="pending_approval", surface it to a human who decides out-of-band in the web console or Slack, then retry.

Development commands

uv venv && source .venv/bin/activate
uv sync --extra dev         # runtime + dev dependencies

python main.py              # stdio transport (default MCP mode)
python main_sse.py          # SSE transport
python main_http.py         # streamable-http; needs AUTH0_* configured

pytest                      # test suite
python -c "from server import mcp; print('ok')"   # import smoke check

Non-obvious invariants

Things the code will not tell you at a glance:

  • Regions are ap1 and us1 only (the internal dev is not a served region). An omitted region is resolved from the JWT in remote mode and from token.json in local mode, then validated; resolution fails when the workspace is unknown or its token spans several regions.
  • Toolset selection crosses module boundaries. --toolsets / ALPACON_MCP_TOOLSETS gates imports, and registration is an import-time side effect. alpacon://servers/.../overview is backed by system_info_tools, so --toolsets servers alone silently drops it. Remote mode is gated on ALPACON_MCP_AUTH_ENABLED=true, not on the transport name, and ignores the setting entirely.
  • @mcp_tool_handler owns validation, token injection, error shape, and logging. Never write a try/except around an HTTP call in a tool. region, workspace, server_id, server_ids, servers, session_id, limit, and page_size are validated before the token lookup; file paths are not—call validate_file_path() inline in any tool taking a path. requires_workspace=False is for a tool that answers before a workspace is known: it drops the workspace checks, the workspace-keyed region resolution, the JWT workspace authorization, the MFA pre-check, and the stdio token injection. list_workspaces is the only tool using it. The decorator also rewrites the published signature, dropping the **kwargs it injects the token into: FastMCP reads that catch-all as an ordinary required field and would publish it to clients (#211). Two rules follow: a tool must declare **kwargs or decoration raises, and no tool may forward its own **kwargs on to another tool, because with_logging binds the published signature strictly and the injected token is no longer a parameter it accepts. health_check sits outside the decorator entirely because it must answer before any JWT exists, and borrows @with_error_handling alone for the error shape.
  • AlpaconHTTPClient never caches a response, deliberately. Every read worth caching—the server list, process info, IAM users and groups—comes back filtered by the calling token's permissions, and nothing in this process sees a grant revoked in the web console, in Slack, or by another MCP process. Do not reintroduce a response cache in the shared client: a hit would answer with access the caller has lost. The auth-path caches stay: the JWKS keys in utils/auth.py and the workspace security settings in utils/security_settings.py are not permission-filtered tool data.
  • The WorkSession gate applies to OAuth/browser callers only. Static API and service tokens bypass it, so a flow that works in stdio mode can be blocked in remote mode. ALPACON_WORK_SESSION supplies a default session id; an explicit work_session_id argument wins.
  • The API token tools 403 in stdio mode. APITokenObjectPermission rejects source='api' tokens, so list/get/create/update/delete/duplicate need JWT/OAuth, a browser session, or a source='login' token. The scopes and presets catalogs are exempt.
  • MFA re-authentication exists only in remote/streamable-http mode, with a 60-second cooldown against re-auth loops.
  • The code and refresh token a remote client holds are sealed by this server, carrying the device id minted for that grant. Rotating ALPACON_MCP_GRANT_SECRET (or AUTH0_CLIENT_SECRET, which it is derived from by default) logs every remote session out.

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago Changed · +12 lines · +217 tokens per session 58e74136c91a
  2. 9d ago First seen · 127 lines · 1,590 tokens per session scan A 4d7144af5d2a

Subscribe to this mod's changes

alpacon-mcp CLAUDE.md is an instructions file published in the GitHub repository alpacax/alpacon-mcp (1 stars, last pushed yesterday), licensed MIT. It adds 1,807 tokens to every session, about $0.0090 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vibe-coding-prompt-template backend.instructions.md

Instructions for KhazP/vibe-coding-prompt-template: Read AGENTS.md, agentdocs/techstack.md, and agentdocs/codepatterns.md.

KhazP/vibe-coding-prompt-template · 139 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens