boxadm-mcp: Instructions file for Claude Code

CLAUDE.md

boxadm-mcp CLAUDE.md is an instructions file for Claude Code from shigechika/boxadm-mcp. It costs 2,957 tokens per session, scanned A, original, MIT.

Repository instructions for a read-only MCP server that analyzes Box administrator event logs. Box is online file storage, and its administrator log records activity such as sharing files and access from outside the organization.

In plain words
What is it for?
Use them when developing or reviewing Box log-analysis tools, including searches for external access, collaborators, and user activity. They also document platform and testing constraints.
Why use it?
They explain the server’s architecture, commands, conventions, and security boundary so changes do not revoke shares, delete files, or otherwise alter Box data.

Instructions file for Claude Code

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

This is shigechika/boxadm-mcp's own configuration. It tells Claude Code how to work on boxadm-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 boxadm-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shigechika/boxadm-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/shigechika/boxadm-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/shigechika/boxadm-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 boxadm-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/shigechika/boxadm-mcp/claude-md.svg)](https://agentmods.dev/instructions/shigechika/boxadm-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/shigechika/boxadm-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shigechika/boxadm-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,957 This file is loaded in full into every session.
When invoked 2,957 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.02957 $0.02957
Opus 5 $0.01478 $0.01478
Sonnet 5 $0.00591 $0.00591
Haiku 4.5 $0.00296 $0.00296

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

Security

Grade A, and why

boxadm-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 7d 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 · 187 lines

How it starts

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

CLAUDE.md

Overview

MCP (Model Context Protocol) server surfacing external file flow from a Box admin's point of view — reads the Box enterprise event log (admin_logs) to highlight who shares a lot with the outside and which files get accessed from outside. Built on the official mcp Python SDK's FastMCP (boxadm_mcp/server.py), over stdio transport. Read-only: no tool ever revokes a share, deletes a file, or otherwise mutates anything.

Commands

uv sync --dev
uv run pytest -v                    # run all tests
uv run ruff check .                 # lint
uv run ruff format --check .        # format check

This mirrors .github/workflows/ci.yml: a lint job (ruff check + ruff format --check) and a test job (pytest -v) on Python 3.10/3.12/3.13, Linux only — no Windows job, because client.py imports fcntl at module load (POSIX-only; see below), which would fail before any test runs.

Architecture

  • boxadm_mcp/server.py — FastMCP server with 9 tools: health_check, recent_admin_events (raw diagnostic), external_access_events (enterprise-wide DOWNLOAD/PREVIEW analytics, plus a created_by_logins DLP-tracing mode), external_collaborators / public_shared_links / top_external_sharers (enumeration over the co-admin's visible folders, BFS via _scan()), list_folder_items (one folder's contents, with uploader attribution from uploader_display_namecreated_by/modified_by are "Anonymous User" for a File Request upload, and since/until are compared as instants because Box's offset differs from the caller's), get_user (one account's current state by exact login — see below), and daily_brief (synthesis of both). _SCAN_CACHE memoizes _scan() results for 60s (_SCAN_TTL) keyed on (root_folder_id, max_folders, max_depth, want_collabs), so external_collaborators/top_external_sharers (same want_collabs=True key) share one traversal instead of re-walking; cleared on reset_client(). _scan() fans the per-folder get_folder_collaborations + get_folder_items calls out across a bounded ThreadPoolExecutor (BOX_SCAN_CONCURRENCY, default 8, clamped 1..32), draining one BFS level at a time up to the folder budget — Box has no enterprise-wide "list all collaborations" API, so the per-folder fan-out is unavoidable and concurrency is the only lever. Concurrency is deliberately not in the cache key (it changes speed, never results), and executor.map's order-preserving merge keeps the visited set, folders_scanned, and output ordering identical to a sequential walk. Per-folder API failures are tolerated but counted in fetch_errors and surfaced by every collab/exposure tool, so a folder dropped by an error is disclosed the same way capped discloses a budget cut — coverage is complete only when capped is false AND fetch_errors is 0. A 429 (honoring Retry-After) or transient 5xx is retried with jittered backoff in client.py's _get first (bounded by an attempt cap and a per-call wall-clock budget), so only a failure that outlasts those retries (e.g. a persistent 403, or a sustained throttle) lands in fetch_errors. That per-_get budget does not bound a whole scan, so _scan() also carries a soft wall-clock deadline (BOX_SCAN_DEADLINE, default 45s; 0 disables), checked only between BFS levels (the in-flight batch always finishes) — when hit it sets capped and returns the disclosed partial rather than letting the tool call run to a gateway timeout that returns nothing. The per-request HTTP timeout is BOX_HTTP_TIMEOUT (default 30s). Neither is in the cache key. When want_collabs=True, folders Box flags with is_externally_owned are skipped (an outside party owns them, so their collaborations aren't the enterprise's to audit) and reported separately under skipped_externally_owned, never silently dropped — this is Box's authoritative signal, and an earlier owner-domain heuristic (is_external(owner)) was tried and reverted as a production regression (it collapsed ~190 audited folders to 9).
  • boxadm_mcp/client.py — two read-only client classes sharing _FolderReadMixin (the shared authenticated GET plus the folder/collaboration getters and get_users(), so one implementation serves both auth modes): BoxClient (Client Credentials Grant, server-to-server) and BoxOAuthClient (OAuth 2.0 user auth with an auto-refreshed, cross-process-locked token cache — see below). Exception hierarchy: BoxError (base) → BoxAuthErrorBoxNotAuthenticatedError (no usable cache; run boxadm-mcp auth), and BoxErrorBoxRequestError (an argument would have built a request other than the one intended — raised instead of being sent). server.py callers only special-case BoxNotAuthenticatedError (surfaced as needs-login); a bare BoxAuthError falls through to the same except BoxError handling as any other Box API failure — it is not given its own except BoxAuthError clause anywhere in server.py today.
  • Ids decide the endpoint, so they are validated before interpolation. A folder id goes into the request PATH and httpx.URL resolves .. segments, so ../users rewrites /2.0/folders/../users into /2.0/users — a page of the enterprise directory, i.e. the enumeration get_user refuses. Two layers: _validate_resource_id() (decimal-only, in each folder getter, where a useful message about WHICH argument is possible) and _assert_endpoint_intact() in _get (no dot segment / query / fragment, root-relative), which covers every present and future path at the point the URL is assembled. BoxRequestError is a BoxError on purpose so _scan's per-folder handler absorbs one into fetch_errors instead of it escaping ThreadPoolExecutor.map as a raw traceback. That absorption is NOT the defence for a caller-supplied root: server._checked_root() validates that up front and returns an error dict, because an absorbed refusal would report a request that never left as a complete, empty result.
  • boxadm_mcp/config.pyallowed_domains() reads BOX_ALLOWED_DOMAINS (comma-separated); no organization-specific default — an unset/empty value yields no domains, so is_external() treats every address as external until configured (fail-safe for a leakage-detection tool).
  • boxadm_mcp/oauth.pylogin(): the one-time interactive OAuth flow run via boxadm-mcp auth. Spins up a local http.server to catch the redirect, then writes the token cache through the same cache_lock/write_token_cache path BoxOAuthClient uses for refreshes.
  • boxadm_mcp/__main__.py — CLI entry point (--version/auth) and the mcp.run() stdio server start.

Read the full file on GitHub · 187 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. 7d ago First seen · 187 lines · 2,957 tokens per session scan A a8250d58bcfb

Subscribe to this mod's changes

boxadm-mcp CLAUDE.md is an instructions file published in the GitHub repository shigechika/boxadm-mcp (0 stars, last pushed 4d ago), licensed MIT. It adds 2,957 tokens to every session, about $0.0148 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

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

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens