psquare-mcp: Instructions file for Claude Code

CLAUDE.md

psquare-mcp CLAUDE.md is an instructions file for Claude Code from thehesiod/psquare-mcp. It costs 8,353 tokens per session, scanned C, original, MIT.

Project instructions for ParentSquare MCP, a server that connects coding agents to ParentSquare, a school communication platform. They describe its structure, login handling, internal web API, and protected administrative changes.

In plain words
What is it for?
Use them when changing the ParentSquare MCP server, its page parsers, downloads, authentication, data models, or administrative tools.
Why use it?
They give an agent the project-specific knowledge needed to work safely in an unfamiliar codebase, including how authentication and write operations are handled.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

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

Reuse

Borrowing it

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/thehesiod/psquare-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/thehesiod/psquare-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/thehesiod/psquare-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/thehesiod/psquare-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 psquare-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/thehesiod/psquare-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/thehesiod/psquare-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8,353 This file is loaded in full into every session.
When invoked 8,353 The same file — it is already loaded in full.
Security scan C 2 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.08353 $0.08353
Opus 5 $0.04176 $0.04176
Sonnet 5 $0.01671 $0.01671
Haiku 4.5 $0.00835 $0.00835

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

Security

Grade C, and why

psquare-mcp CLAUDE.md scanned grade C with 2 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 9d 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

git config --global user.signingkey ~/.ssh/id_ed25519.pub

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

(`curl -s -o /dev/null -w '%{http_code}' https://pypi.org/pypi/parentsquare-mcp/X.Y.Z/json`) and the
CLAUDE.md · 328 lines

How it starts

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

ParentSquare MCP Server

Architecture

MCP server that scrapes ParentSquare's web UI. Runs as stdio transport. While there's no documented public API, ParentSquare has an internal JSON:API at /api/v2/ that some tools use (e.g. directory).

server.py          — MCP tool definitions, inline image/PDF fetching
client.py          — HTTP client with auto-relogin on session expiry
auth.py            — Cookie persistence (~/.parentsquare_cookies.json), credential loading (env vars → 1Password/LastPass), MFA flow
audit.py           — Write-gate (PS_ENABLE_WRITES) + JSONL audit log for admin write tools
config.py          — URL templates and constants (no personal data — auto-discovered at runtime)
models.py          — Dataclasses for all parsed entities
download.py        — File download with conflict handling
parsers/           — One module per page type (feeds, calendar, media, messages, etc.); parsers/admin.py holds roster/edit-form parsing + write-body builders
export_cookies.py  — CLI helper to bootstrap cookies from browser DevTools

Key Patterns

Authentication

  • Cookies are lazy-loaded from ~/.parentsquare_cookies.json on startup (no network call)
  • On session expiry (detected by redirect to /signin or missing gon.user_id on the root page), credentials are loaded via load_credentials(): first from PS_USERNAME/PS_PASSWORD env vars, then from the provider named by PS_CREDENTIAL_PROVIDER (default 1password). Options:
    • 1passwordop item get Parentsquare (item named "Parentsquare" with fields labeled username and password)
    • lastpasslpass show --json <item> where the item defaults to parentsquare.com and is overridable with PS_LASTPASS_ITEM (exact name or entry ID). Requires a prior lpass login <email>; lpass status --quiet is checked first (short timeout) so requests never hang on an interactive prompt. Credential values are never logged or included in error messages.
  • Important: ParentSquare's root page (/) returns HTTP 200 even for unauthenticated users, so /signin redirect alone is not sufficient to detect expired sessions. discover_account() and is_session_valid() also check for gon.user_id in the page content.
  • MFA code submission verifies the session is actually authenticated after the code is accepted
  • MFA state persists to disk (.parentsquare_mfa_state.json) so it survives server restarts
  • The server supports MCP elicitation for inline MFA code entry
  • User-Agent must include "Chrome" — ParentSquare returns 403 browser_unsupported otherwise, and (worse) can serve unauthenticated content to a script-looking request that carries valid cookies, which ends in placeholder data rather than an error. make_session() in client.py owns this and is PSClient's default session, so a bare PSClient() is browser-like too; app_lifespan just calls it. Do not re-apply the header at a call site.
  • The ps_s session cookie is httpOnly — it can't be read via document.cookie, which is why export_cookies requires the Network tab in DevTools
  • ps_s rotates on every request. PSClient calls _save_cookies_if_changed() after each successful request to persist the latest value.
  • GraphQL requests (used by list_groups) require a CSRF token extracted from a page's <meta name="csrf-token"> tag. MFA submit also requires a CSRF token from the MFA page.
  • The CSRF token is cached on PSClient for the life of the session. Rails derives it from a per-session secret, so it stays valid across requests even though ps_s rotates — verified live. Without the cache every single write paid an extra GET /. _with_csrf() wraps each write and retries once with a force-refreshed token if the response looks like a rejected token or a dead session (_is_csrf_rejection: a bounce to /signin, a 401/419, or a 403/422 whose body names the token). That detection is deliberately narrow — retrying a plain 422 validation error could re-apply a write that had actually landed. Because caching removed the implicit GET / (and its session-expiry check) from every write, this retry path is now the thing that recovers an expired session mid-write. _relogin() and MFA completion both call invalidate_csrf_token().

Read the full file on GitHub · 328 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. 9d ago First seen · 328 lines · 8,353 tokens per session scan C 0ad7f1e8c89f

Subscribe to this mod's changes

psquare-mcp CLAUDE.md is an instructions file published in the GitHub repository thehesiod/psquare-mcp (8 stars, last pushed 13d ago), licensed MIT. It adds 8,353 tokens to every session, about $0.0418 per session on Opus 5. A static security scan graded it C with 2 findings (reaches for credential files, makes network calls). 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

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens