psquare-mcp: Instructions file for Claude Code

CLAUDE.md

psquare-mcp CLAUDE.md is an instructions file for Claude Code from jasonko/psquare-mcp. It costs 6,570 tokens per session, scanned A, original, from a forked repository, MIT.

Instructions for a Claude Code project that connects to ParentSquare, a school communication service, through an MCP server. They describe its structure, authentication, data handling, and the service’s internal JSON:API.

In plain words
What is it for?
Working on ParentSquare data scraping, authentication, parsers, file downloads, admin actions, and audit logging.
Why use it?
They give an agent the project context needed to change the server without overlooking login, session, downloads, or protected write operations.

Instructions file for Claude Code

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

This is jasonko/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 jasonko/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/jasonko/psquare-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/jasonko/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/jasonko/psquare-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/jasonko/psquare-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/jasonko/psquare-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/jasonko/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/jasonko/psquare-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/jasonko/psquare-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,570 This file is loaded in full into every session.
When invoked 6,570 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin fork From a forked repository.
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.06570 $0.06570
Opus 5 $0.03285 $0.03285
Sonnet 5 $0.01314 $0.01314
Haiku 4.5 $0.00657 $0.00657

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

Security

Grade A, and why

psquare-mcp CLAUDE.md scanned grade A with 1 finding 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 8d 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.

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/psquare-mcp/X.Y.Z/json`) and the
CLAUDE.md · 224 lines

How it starts

The opening of the file, as written. The whole thing — 224 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. The server sets this in app_lifespan.
  • 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 · 224 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. 8d ago First seen · 224 lines · 6,570 tokens per session scan A 2cd816508897

Subscribe to this mod's changes

psquare-mcp CLAUDE.md is an instructions file published in the GitHub repository jasonko/psquare-mcp (1 stars, last pushed 13d ago), licensed MIT. It adds 6,570 tokens to every session, about $0.0329 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It comes from a forked repository.

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