Skip to content

feat(mcp): send the client's identity on lookups and grade requests#91

Merged
RubenSousaDinis merged 1 commit into
mainfrom
feat/agent-identity-on-lookups
Jul 3, 2026
Merged

feat(mcp): send the client's identity on lookups and grade requests#91
RubenSousaDinis merged 1 commit into
mainfrom
feat/agent-identity-on-lookups

Conversation

@RubenSousaDinis

Copy link
Copy Markdown
Member

The lookup tools called polygraph.so anonymously — only request_grade attributed its caller. Now check_server, list_servers, and request_grade all carry the connected client's identity from the MCP initialize handshake, feeding polygraph.so's aggregate per-agent usage counters (software metadata only — name/version, declared title/website/description, and capability keys like sampling/roots; nothing about the user).

  • clientAgent(server) in client-id.ts collects the handshake identity.
  • postCheck/postGradeRequest send source/agent_id/agent_meta in the body; getList via query params.
  • Both servers bind the handlers with the client identity, as request_grade already did.
  • All fields optional server-side; older deployments ignore them.

Verified: 23 tests (updated for the new fields), typecheck clean, build green, and a live end-to-end run — a client announcing {title, sampling, roots} shows up in the grade index's agent counters with exactly that profile.

Release: 0.26.0 in a follow-up version PR per the release flow.

The lookup tools called polygraph.so anonymously; only request_grade carried
the caller's name/version. Now all three (check_server, list_servers,
request_grade) attribute the connected client, so polygraph.so's aggregate
per-agent usage counters see MCP clients as themselves rather than as a
generic runtime User-Agent.

- client-id.ts: clientAgent(server) — name/version plus whatever the
  initialize handshake declared (title, websiteUrl, description, capability
  keys such as sampling/roots). Software metadata only; nothing about the
  user is read or sent.
- api.ts: postCheck/postGradeRequest carry source/agent_id/agent_meta in the
  body; getList via query params.
- both servers bind the tool handlers with the connected client's identity,
  as request_grade already did.

All fields are optional server-side — older deployments ignore them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011FW3vDMau8UYnNWCanfT4k
@RubenSousaDinis
RubenSousaDinis merged commit 316c15f into main Jul 3, 2026
11 checks passed
@RubenSousaDinis
RubenSousaDinis deleted the feat/agent-identity-on-lookups branch July 3, 2026 18:04
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