Skip to content

Skill freshness, self-introspection, and skill-in-instructions#28

Merged
rockfordlhotka merged 1 commit into
mainfrom
feature/skill-freshness-self-introspection
May 12, 2026
Merged

Skill freshness, self-introspection, and skill-in-instructions#28
rockfordlhotka merged 1 commit into
mainfrom
feature/skill-freshness-self-introspection

Conversation

@rockfordlhotka

Copy link
Copy Markdown
Member

Summary

Addresses four pieces of feedback from a Claude Desktop session about the aggregator's metadata surface area:

  • Skill freshness detection. update_skill now snapshots a SHA-256 fingerprint over the downstream's sorted tool + prompt names, plus its RemoteVersion, at the moment the skill is authored. list_services and get_service_details recompute the fingerprint against the live downstream and emit skillFreshness (fresh | stale | unknown), skillRecordedVersion, and skillRecordedAt. Drift is detected rather than auto-rewritten, since skill docs are operator-authored.
  • Aggregator self-introspection. The aggregator's own row in list_services now populates remoteName / remoteTitle / remoteVersion from the configured McpServerOptions.ServerInfo instead of leaving them null — so clients can identify what version of the aggregator they're talking to.
  • Skill doc in initialize handshake. data/skills/{SelfName}.md is read at server start and appended to McpServerOptions.ServerInstructions (capped at 16 KB). MCP clients now receive aggregator orientation during the initialize handshake without having to know to call get_service_skill. Skill changes require a server restart to re-embed.
  • refresh_service semantics. Description now spells out exactly what is invalidated (connection, ServerInfo, tool list, prompt list) and what is not (the skill document — that is admin-authored via update_skill).

New / changed types

  • RegisteredServer.SkillRecordedVersion / SkillRecordedFingerprint / SkillRecordedAt
  • ServiceIndex + ServiceDetails: SkillFreshness, SkillRecordedVersion, SkillRecordedAt
  • ServerRegistry.UpdateSkillSnapshotAsync(...)
  • SkillFingerprint.Compute(tools, prompts) utility (Core/Services)
  • SkillSnapshot.CaptureAsync(...) helper shared by AdminTools.UpdateSkill and AdminController.UpdateSkill

Test plan

  • dotnet build — clean
  • dotnet test — 89 passed, 0 failed (13 new tests covering fingerprint determinism / order-independence / drift, and registry snapshot persistence)
  • Manual: register a downstream server, update_skill, observe skillFreshness: fresh in list_services; then add a tool to the downstream and observe skillFreshness: stale
  • Manual: confirm aggregator's own row in list_services now reports remoteName/remoteVersion
  • Manual: connect a fresh MCP client and verify the initialize response's instructions includes both the discovery flow and the aggregator skill doc

Addresses four pieces of Claude Desktop feedback:

* Skill freshness detection: capture a fingerprint (SHA-256 over sorted
  tool+prompt names) and the downstream RemoteVersion when update_skill
  is called, then compare against the live surface area on every
  list_services / get_service_details to emit
  skillFreshness=fresh|stale|unknown plus skillRecordedVersion and
  skillRecordedAt. Skill docs are operator-authored, so the aggregator
  detects rather than auto-rewrites drift.
* Aggregator self-introspection: populate remoteName / remoteTitle /
  remoteVersion on the aggregator's own row in list_services from the
  configured McpServerOptions.ServerInfo, instead of leaving them null.
* Skill in initialize handshake: read data/skills/{SelfName}.md at
  server startup and append it (capped at 16KB) to
  McpServerOptions.ServerInstructions, so MCP clients get aggregator
  orientation during the initialize handshake without needing to know
  to call get_service_skill.
* refresh_service semantics: tighten the tool description to spell out
  that it clears the cached connection, ServerInfo, tools, and prompts,
  and that it does NOT modify the skill document (admin-authored via
  update_skill).
@rockfordlhotka
rockfordlhotka merged commit f0ad238 into main May 12, 2026
1 check passed
@rockfordlhotka
rockfordlhotka deleted the feature/skill-freshness-self-introspection branch May 12, 2026 14:17
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