Skip to content

feat(mcp)!: slim manifest, merge action pairs, auto-refresh skills#232

Merged
geodro merged 2 commits intomainfrom
mcp-slim-manifest-auto-refresh
Apr 22, 2026
Merged

feat(mcp)!: slim manifest, merge action pairs, auto-refresh skills#232
geodro merged 2 commits intomainfrom
mcp-slim-manifest-auto-refresh

Conversation

@geodro
Copy link
Copy Markdown
Owner

@geodro geodro commented Apr 21, 2026

Summary

  • Trim every MCP tool description and shared param description, pushing long-form guidance into the skill file rather than repeating it in each tool schema.
  • Collapse 13 start/stop/pin/add/remove groups into action-dispatcher tools with an action enum. This is a breaking change to the MCP API.
  • On lerd update, refresh per-project AI artefacts for every opted-in project so the skill/rules files stay aligned with the installed binary. Content-aware writes mean projects already current stay untouched (clean git status).

Manifest size

Measured against the live MCP server (lerd mcp stdio):

tools bytes ~tokens
Before (main at 02f2a99) 60 30,432 ~7,608
After 46 18,320 ~4,580
Saved −14 −12,112 ~−3,028 (−40%)

Merged tool mapping

New tool Replaces Action enum
service_control service_{start,stop,pin,unpin} start, stop, pin, unpin
queue queue_{start,stop} start, stop
reverb reverb_{start,stop} start, stop
horizon horizon_{start,stop} start, stop
schedule schedule_{start,stop} start, stop
stripe stripe_listen, stripe_listen_stop start, stop
worker worker_{start,stop} start, stop
node node_{install,uninstall} install, uninstall
site_domain site_domain_{add,remove} add, remove
site_tls secure, unsecure enable, disable
xdebug xdebug_{on,off,status} on, off, status
site_control site_{pause,unpause,restart,rebuild} pause, unpause, restart, rebuild
php_ext php_ext_{list,add,remove} list, add, remove

Old names are removed entirely, no aliases. Anyone pinned to stale prompts will get a clear unknown tool error from the server. The skill, Cursor rules, and Junie guidelines embedded in the binary all reference the new names; lerd update re-emits them globally and across opted-in projects.

Auto-refresh on lerd update

  • Iterates registered sites (from sites.yaml) plus immediate subdirs of each parked directory (catches non-PHP projects that ran mcp:inject without being linked).
  • Treats a project as opted-in iff at least one lerd-owned marker file exists: .claude/skills/lerd/SKILL.md, .cursor/rules/lerd.mdc, or the <!-- lerd:begin --> block in .junie/guidelines.md. Shared MCP config JSONs are not used as opt-in signals because they may contain unrelated servers.
  • Rewrites via the same helper as mcp:inject (WriteProjectAISkills), so the two flows cannot drift.
  • writeIfChanged skips the write when content matches, so unchanged projects keep their mtime and git status stays clean.

geodro added 2 commits April 21, 2026 21:30
…ect skills

Rewrites the lerd MCP tool manifest to cut the per-session token cost and keeps
per-project AI artefacts in sync on lerd update.

Trim pass: every tool description and shared param description was shortened.
Long-form guidance stays in the skill file, not in each tool schema. Zero
behaviour change, zero breaking surface.

Merge pass: 13 start/stop/pin/add/remove groups collapsed into single
action-dispatcher tools with an action enum. BREAKING change for the MCP API.

  service_control  <-  service_{start,stop,pin,unpin}
  queue            <-  queue_{start,stop}
  reverb           <-  reverb_{start,stop}
  horizon          <-  horizon_{start,stop}
  schedule         <-  schedule_{start,stop}
  stripe           <-  stripe_listen, stripe_listen_stop
  worker           <-  worker_{start,stop}
  node             <-  node_{install,uninstall}
  site_domain      <-  site_domain_{add,remove}
  site_tls         <-  secure, unsecure
  xdebug           <-  xdebug_{on,off,status}
  site_control     <-  site_{pause,unpause,restart,rebuild}
  php_ext          <-  php_ext_{list,add,remove}

Manifest: 60 tools / ~7,608 tokens  ->  46 tools / ~4,580 tokens (-40%,
measured against the live MCP server).

Project-skill refresh: lerd update iterates registered sites plus immediate
subdirs of parked directories, detects opted-in projects via lerd marker files
(.claude/skills/lerd/SKILL.md, .cursor/rules/lerd.mdc, lerd block in
.junie/guidelines.md), and rewrites their per-project artefacts in place.
Unchanged files stay untouched so git status stays clean. Projects that never
opted in are never touched.

WriteProjectAISkills was extracted from runMCPInject to back both flows.
Tests cover the opt-in detector, full artefact write, skip-if-unchanged
(mtime), and refresh-if-stale paths.
@geodro geodro merged commit e32e06f into main Apr 22, 2026
3 checks passed
geodro added a commit that referenced this pull request Apr 22, 2026
Reconcile with #232 (slim MCP manifest): drop the per-site and per-service
tool variants (site_pause/unpause/restart/rebuild, service_pin/unpin) in
favor of main's site_control / service_control / stripe action dispatchers.
Keep site_runtime as a new standalone tool and add its row to
docs/features/mcp.md.
geodro added a commit that referenced this pull request Apr 22, 2026
…, install/uninstall polish (#241)

- Bump internal/version to 1.18.0-beta.1.
- CHANGELOG entry covering all 11 PRs since v1.17.1 (#229 through #240)
  in Keep-a-Changelog sections: Added / Changed / Fixed / Docs / CI.
  Breaking change is #232 (slim MCP tool manifest, merged action pairs).
- docs/getting-started/installation.md: uninstall section now describes
  the four opt-in prompts (data, MCP integration, mkcert CA, images) and
  --force semantics.
- docs/troubleshooting.md: new entry for the aardvark-dns drift case
  (every DNS lookup stalling ~5 seconds after a dual-stack migration).
- docs/usage/lifecycle.md: new info block describing stale-site
  auto-cleanup — fsnotify fast path on parked dirs, 30s sweep across
  the full registry, eventbus publish so the dashboard refreshes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant