Skip to content

MCP reference

yardmaster-mcp is a stdio MCP server. It lets an agent on your machine ask what holds a port, pick a free one, stop its own dev server, and check config, secrets, and limits. It has no tool that changes what your agents load, and it sends nothing over the network.

Run one command per agent:

Terminal window
claude mcp add yardmaster -- yardmaster-mcp
codex mcp add yardmaster -- yardmaster-mcp

For any other client, add this to its MCP configuration:

{ "mcpServers": { "yardmaster": { "command": "yardmaster-mcp" } } }

Yardmaster can also do the connecting for you. This prints a dry run for every installed agent; add --yes to apply it:

Terminal window
yardmaster mcp connect
yardmaster mcp status

mcp connect runs each agent’s own mcp add command. mcp status shows which agents start the server and from where. See the CLI reference for every flag.

The server uses a stricter policy than the CLI.

  • It has no write tools. An agent cannot add servers or skills to other agents through it.
  • kill_port stops a process gracefully (SIGTERM, wait, verify). Pass force only after a graceful attempt reported still_running.
  • It refuses protected processes (databases, Docker, editors, OS services) with no override.
  • It refuses a server that a different agent session started and that is still running. A server the calling agent started, one whose session has ended, or one with no known owner can be stopped.

A refusal is a normal result with a sentence telling the agent to ask you, not a protocol error. See Safety for the rules behind this.

The server offers these tools, in the order it lists them. You can switch tools off in Settings or with yardmaster mcp tools --disable <names>; a tool that is off is missing from this list for your agents.

What an agent session actually did: every tool call in order (kind, target, risk flags), distinct commands run, files written, and counts. Defaults to the calling session; pass session_id to audit another. Read-only.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
risky_only boolean no Only actions with at least one risk flag (default false).
session_id string no Vendor session id; default: the session that launched this server.

Check the rule files (CLAUDE.md, AGENTS.md, GEMINI.md, …) for the user and project: which agents read each, and where two files for one folder have drifted apart (what differs, how many lines stop loading if one imports the other). Each drift carries a read-only preview of the fix (a diff) and the command the user runs to apply it; nothing is changed. Call it when instructions seem to be ignored by one agent, or before editing CLAUDE.md or AGENTS.md. Pass project to keep user-level files plus one folder’s.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
project string no A folder (absolute path): keep user-level files plus those of this project.

Find API keys, tokens, and other credentials left in the agents’ config files or in one session transcript. Call it before committing, sharing, or publishing config, or when you suspect a key leaked into a transcript. scope “config” (default) scans the files the agents load (MCP configs, settings, rule files); scope “session” scans one stored session (yours by default, or session_id). Reports each credential’s kind, key name, confidence, fingerprint, a masked preview, and file:line places; the value itself is never returned. Never scans every transcript (that is yardmaster hygiene). since_last: true also marks each credential is_new against the Yardmaster app’s record of full scans and returns that record’s latest run (time, high and medium counts, the credentials it found new). Read-only.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
scope string no config (default): the configuration files the agents load (MCP configs, settings, rule files). session: one stored session’s transcript and files.
session_id string no With scope: "session": a vendor session id or its first characters. Default: the session that launched this server.
since_last boolean no Compare with the Yardmaster app’s record of full scans: mark each credential is_new and add last_scan (when it ran, its counts, and the credentials it found new). Reads the record, never writes it.

Check the skills agents load: broken links, stale copies that differ from ~/.agents/skills, SKILL.md files that are missing front matter or invalid, and skills one agent has that others lack. Each problem comes with the command (yardmaster skills link ...) or the place in the Yardmaster app that fixes it; the user applies it, this tool changes nothing. Call it when a skill does not show up in an agent.

Annotations: read-only: yes, idempotent: yes.

Takes no arguments.

Where development data sits on this machine’s disk: free space, then package caches, Xcode and simulators, Android, toolchains, test browsers, editor caches, local AI models, container disks, project build output, and old installers, by group and by target, each safe (caches re-created on demand), review, or elsewhere (cleaned by its owner’s command or app). Measures the disk now, which can take several seconds. Call it when a build fails for lack of space or before suggesting a cleanup. Pass group to narrow it, top for more targets. Read-only: it never cleans; the user does that in Yardmaster -> Reclaim.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
group string no Only this group: xcode, android, package_caches, toolchains, test_browsers, editors, local_ai, containers, projects, downloads, or app_caches. All when absent.
top integer no How many of the largest targets to list (default 10, at most 50).

One cheap health summary of this machine’s agent setup: counts and the top findings across MCP servers, skills, rule-file drift, hooks, permissions, credentials in config files (counts by kind only), processes left behind by ended agent sessions, and plan limits above 80 %. Each finding has a severity and a fix hint (a command, or “ask the user to open Yardmaster -> …”). Call it at the start of a session or when something feels off, then drill down with check_secrets, check_rules, check_skills, get_limits, or my_footprint. Pass project to scope it. Read-only.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
project string no A folder (absolute path): keep user-level items plus those of this project.

What the AI coding agents on this machine load: MCP servers (grouped by identity, with which agents have each), skills (where installed, links vs copies, stale), rule files (CLAUDE.md / AGENTS.md and drift between them), hooks, permissions, and findings (warnings/info). Read from local config files only.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
project string no A folder (absolute path): keep user-level items plus those of this project.
what string no Which section: mcp, skills, rules, hooks, permissions, findings, or all (default). Other sections come back empty.

Return a TCP port nobody is listening on, checked against the socket table and by actually binding it. Default range 3000-3999. Pass stable_for (a folder path) to get that folder’s own port instead: the same one every run while it is free, so a worktree always lands on the same port; running_here=true means a server from that folder already holds it, so reuse it.

Annotations: read-only: yes.

Parameter Type Required Description
from integer no First port to try (default 3000).
stable_for string no A folder path; returns that folder’s stable port, the same every run while it is free (or already held by a server running from that folder).
to integer no Last port to try (default 3999).

Every tool’s last plan-limit readings on this machine (Claude Code, Codex, Cursor, Gemini): used percent per window (5-hour, weekly, …), when it resets, the plan, and free resets. Read from local files only, no network and no credentials. stale means the reading is over an hour old or a window has reset since (reset_since), so the percentage is out of date. Call it before starting a long or expensive task to see how much room is left. Read-only.

Annotations: read-only: yes, idempotent: yes.

Takes no arguments.

Tokens AI coding agents (Claude Code, Codex, Gemini CLI, OpenCode, Cursor, Antigravity, Pi, Qwen Code, Kimi Code) used on this machine, per local day, agent, project folder, model, and model provider, plus the largest sessions and the last plan limits Codex and Claude Code reported (Claude Code’s only when the user relays its statusLine to yardmaster limits relay; other agents keep none on disk). Read from local files; token counts only, no cost. Default: the last 7 days.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
agent string no Only claude (Claude Code), codex, gemini (Gemini CLI), opencode, cursor, antigravity, pi, qwen (Qwen Code), or kimi (Kimi Code) sessions.
days integer no Local calendar days to cover, today included (default 7; 1 = today; 0 = all).
project string no Only sessions that ran in this folder or below it (absolute path).

Stop the process listening on a TCP port. Graceful by default: SIGTERM, wait, verify the port is free. Pass force=true only after a call reported still_running. Refuses databases, Docker, editors, OS services, other users’ processes, and servers started by a different agent session that is still running.

Annotations: read-only: no, destructive: yes, idempotent: no.

Parameter Type Required Description
force boolean no Escalate to SIGKILL (taskkill /F) if the process ignores the graceful stop. Only pass this after a previous call reported still_running.
grace_ms integer no Milliseconds to wait after the graceful signal (default 3000).
port integer yes TCP port whose owning process should be stopped.

List every TCP port something is listening on locally, with the owning process, project, framework, git branch, and the AI agent session that started it. Hidden system/editor ports are excluded unless asked.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
include_hidden boolean no Include system daemons, editor helpers, and other users’ processes.
include_udp boolean no Include bound UDP sockets as well as TCP listeners.
only_orphans boolean no Only servers that look abandoned (agent session ended, folder deleted).

What the calling agent session holds right now: its processes (including servers it backgrounded), memory, and listening ports, plus processes earlier sessions left running in the same project. Read-only. Call it before finishing a task and stop servers you no longer need with kill_port.

Annotations: read-only: yes, idempotent: yes.

Takes no arguments.

Full-text search over the user’s stored agent sessions (Claude Code, Codex, Gemini CLI, OpenCode, …): prompts and replies, not tool output. Call it to find how something was done in an earlier session, or why a decision was made. Returns the newest matching sessions with redacted snippets (at most 3 each); pass the session_id on to audit_session. Query of at least 2 characters; default 10 sessions, at most 30. Filter by agent or project folder. The current session can match its own query. Read-only.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
agent string no Only claude, codex, gemini, opencode, cursor, antigravity, pi, qwen, or kimi sessions.
limit integer no Most sessions to return (default 10, max 30).
project string no Only sessions that ran in this folder or below it (absolute path).
query string yes Text to find in earlier prompts and replies (at least 2 characters; case-insensitive; one phrase).

Block until a TCP port is listening (default) or free (until_free=true), polling every 250 ms. Use after starting a dev server or after kill_port. Default timeout 30 s, max 300 s.

Annotations: read-only: yes.

Parameter Type Required Description
port integer yes TCP port to watch.
timeout_ms integer no Give up after this many milliseconds (default 30000, max 300000).
until_free boolean no Wait for the port to become free instead of listening.

Everything known about one TCP port: process, project, framework, branch, agent session, orphan status. When nothing visible is listening, reports whether the port can be bound and, if not, why (another user, reserved range). Always includes a verdict for an agent that wants to bind the port: kind (who holds it), action (bind, reuse the running server, stop_then_retry for a leftover of an ended session, or use_another_port), a message to act on, and a free alternative port when the action is to use another one.

Annotations: read-only: yes, idempotent: yes.

Parameter Type Required Description
port integer yes TCP port number.