claude-code

A guide for connecting Claude Code to MCP servers, which provide extra tools and data to an AI coding agent. It explains project, user, and machine-only configuration.

In plain words
What is it for?
Use it to configure a server in .mcp.json or with the Claude command line, select its scope, verify it, and use its tools for source-grounded answers.
Why use it?
It removes uncertainty when adding MCP servers, checking their registration, and choosing where their settings apply.

Agent

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 agents/andreibrosmaster/ph-compliance-mcp/claude-code
Clone the repo
git clone --depth 1 https://github.com/andreibrosmaster/ph-compliance-mcp
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 485 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00485
Opus 5 $0.00000 $0.00243
Sonnet 5 $0.00000 $0.00097
Haiku 4.5 $0.00000 $0.00049

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

Security

Grade A, and why

claude-code 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.

docs/agents/claude-code.md · 68 lines

What it actually says

Claude Code

Claude Code connects to MCP servers declared in .mcp.json at the project root (project scope) or via the claude mcp add CLI. As of August 2026, .mcp.json uses the mcpServers schema with stdio entries.

Quick start (CLI)

cd /path/to/your/project
claude mcp add ph-compliance -- node /abs/path/ph-legal-mcp/dist/src/server.js
claude mcp list                      # verify

Scopes: --scope user (all projects), --scope project (this project), --scope local (this machine only).

Project .mcp.json

{
  "mcpServers": {
    "ph-compliance": {
      "command": "node",
      "args": ["/abs/path/ph-legal-mcp/dist/src/server.js"],
      "env": {
        "PH_COMPLIANCE_CONFIDENCE_THRESHOLD": "0.5"
      }
    }
  }
}

Or via pnpm (no build step needed if you prefer tsx, slower startup):

{
  "mcpServers": {
    "ph-compliance": {
      "command": "pnpm",
      "args": ["--dir", "/abs/path/ph-legal-mcp", "start"]
    }
  }
}

Using it

Claude Code auto-discovers the tools. Ask grounded questions and it will chain search_statuteget_provisioncite_validate. For legal work, always end with cite_validate so the final answer cites corpus-resolved text.

Check whether a written contract claim filed 12 years after breach is
prescribed, then validate the underlying citation.

Claude will compute the period (compute_prescription), pull the provision (get_provision), and validate (cite_validate).

Troubleshooting

  • claude mcp list shows connection status; claude mcp get ph-compliance shows details.
  • The server logs to stderr — run claude mcp doctor or check the session transcript if a tool call times out.
  • First run downloads the corpus; allow a minute on a cold cache.
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 · 68 lines · 0 tokens per session scan A a3c4e4a8488b

Subscribe to this mod's changes

claude-code is an agent published in the GitHub repository andreibrosmaster/ph-compliance-mcp (1 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 485 tokens. 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.