mattergate AGENTS.md

A project-specific instruction file for Mattergate, a self-hosted gateway that controls which legal-software actions each user can access. It documents the project structure, tools, commands, tests, and important design documents.

In plain words
What is it for?
Building, testing, and running the Mattergate project, including its TypeScript workspaces, server, administration interface, landing page, and local MCP service.
Why use it?
It gives a coding agent the project’s working rules and current context, reducing mistakes such as using the wrong commands or adding real vendor credentials to a mock connector.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/dschnurbusch/mattergate/agents-md
Clone the repo
git clone --depth 1 https://github.com/dschnurbusch/mattergate

Made for: Codex, OpenCode.

Per session 788 This file is loaded in full into every session.
When invoked 788 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00788 $0.00788
Opus 5 $0.00394 $0.00394
Sonnet 5 $0.00158 $0.00158
Haiku 4.5 $0.00079 $0.00079

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

Security

Grade A, and why

mattergate AGENTS.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 2d 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.

AGENTS.md · 83 lines

How it starts

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

AGENTS.md

Project summary

Legal MCP Gateway is a self-hostable/local MCP permissions gateway for legal-tech systems. It lets an admin connect vendor accounts, provision team users, assign job-title presets, and expose only the MCP tools and actions a user is allowed to use.

Tooling

  • Runtime/package manager: Node + npm workspaces.
  • Language: TypeScript, strict mode.
  • Tests: Vitest.
  • Admin UI scaffold: Vite + React.
  • Current scaffold intentionally uses a mock legal connector. Do not add real vendor credentials.

Commands

npm install
npm run build
npm test
npm run verify
npm run dev:server
npm run dev:admin
npm run dev:landing
npm run dev:stdio

npm run verify is the normal pre-finish check. It builds all workspaces and runs tests.

Important docs

Tracked project docs live in docs/:

  • docs/project-plan.md — MVP scope, architecture, roadmap, and build phases.
  • docs/project-tracker.md — current status, decisions, next actions, and open questions.
  • docs/brand.md — working brand direction, name candidates, recommended name, and landing-page copy blocks.
  • docs/auth-model.md — user login, per-client MCP grants, token validation, and Lawmatics auth assumptions.
  • docs/lawmatics-connector-plan.md — first connector scope, existing Railway MCP Lawmatics tools to port, OAuth flow, and API pitfalls.
  • docs/architecture.md — system architecture.
  • docs/policy-model.md — RBAC/ABAC permission model.
  • docs/connector-development.md — how to add connectors safely.
  • docs/deployment.md — local/self-hosted deployment notes.
  • docs/oauth-broker-railway.md — Railway-hosted OAuth broker plan for low-friction connector installs.
  • docs/self-hosting-railway.md — future one-click Railway deploy/self-hosting plan.

Local research files live in docs/research/ and are intentionally gitignored. They currently include:

  • docs/research/oauth-permissions-research.md
  • docs/research/legal-tech-integration-catalog.md
  • docs/research/weave-legal-notes.md

Read the full file on GitHub · 83 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. 2d ago First seen · 83 lines · 788 tokens per session scan A 303abcb738fa

Subscribe to this mod's changes

mattergate AGENTS.md is an instructions file published in the GitHub repository dschnurbusch/mattergate (0 stars, last pushed 1mo ago), licensed MIT. It adds 788 tokens to every session, about $0.0039 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.