feat(mcp): record input aliases used from a server-owned alias map - #5117
Conversation
Pass the schema's normalizeParamAliases map to getToolInputProperties as inputAliases, so the SDK records $mcp_input_aliases_used (alias:canonical) in place of the server's own $mcp_param_aliases_used (alias->canonical). describeAliasesUsed is removed; its rule tests now run through describeInputShape. Taxonomy, generated JSON, and the analytics vocabulary are updated. Depends on PostHog/posthog-js#5117 (stacked on #5048): CI fails until both are released and the @PostHog/mcp-analytics pin is bumped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 8a3c5163-fb8f-423e-8008-17af786b8cae
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note 🤖 Automated comment by QA Swarm — not written by a human Multi-perspective review: router (cheap-first pass) + delegated lenses (qa-team, paul-reviewer, xp-reviewer, security-audit, engineering-systems-thinking as warranted) Verdict: ✅ APPROVE (round 1 @ 5eab9ee)No actionable findings. Key findingsNone. ConvergenceNone (single reviewer). Reviewer summaries
Automated by QA Swarm — not a human review |
|
@gesh this is the alias telemetry you asked for on #5048, built now instead of later. The server passes its own alias map as |
The PR was retargeted to a different base branch, so the approved diff is no longer what was reviewed. Stamphog re-reviews automatically.
getToolInputProperties takes inputAliases (canonical name to aliases). Alias names count as declared in $mcp_input_keys, and $mcp_input_aliases_used records alias:canonical for each canonical the call did not send, using the first alias present. Argument values are never read. Closes #5116 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 8a3c5163-fb8f-423e-8008-17af786b8cae
5eab9ee to
02543de
Compare
There was a problem hiding this comment.
Approved.
This adds a new public option/type to the MCP SDK, but it's optional, additive, well-tested (including a test proving argument values are never read), and the author has STRONG familiarity with this exact code (100% of touched lines, 52 merged PRs in these paths), which substitutes for a fresh independent review on risky public-API surface. No unresolved concerns in the reviews or discussion.
- Author wrote 100% of the modified lines and has 52 merged PRs in these paths (familiarity STRONG).
- 👍 on the PR from chatgpt-codex-connector[bot].
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 45L, 4F substantive, 114L/7F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (114L, 7F, two-areas, feat) |
| stamphog 2.2.0 | .stamphog/policy.yml @ 02543de · reviewed head 02543de |
Pass the schema's normalizeParamAliases map to getToolInputProperties as inputAliases, so the SDK records $mcp_input_aliases_used (alias:canonical) in place of the server's own $mcp_param_aliases_used (alias->canonical). describeAliasesUsed is removed; its rule tests now run through describeInputShape. Taxonomy, generated JSON, and the analytics vocabulary are updated. Depends on PostHog/posthog-js#5117 (stacked on #5048): CI fails until both are released and the @PostHog/mcp-analytics pin is bumped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 8a3c5163-fb8f-423e-8008-17af786b8cae
Problem
MCP servers that accept alternative argument names (for example
experimentIdforid) want to know which spelling agents use. Without SDK support, each server adds its own$mcp_*property and format. Review on #5048 asked for this to be SDK work.Changes
getToolInputProperties(args, schema, { inputAliases })takes a server-owned map of canonical name to aliases, in the order the server tries them.$mcp_input_keys.$mcp_input_aliases_used, for example["experimentId:id"]: one entry for each canonical name the call did not send, using the first alias present. It is omitted when no alias was needed, and it is capped at 20. Argument values are never read.InputAliasMap. Documented inARCHITECTURE.md.Stacked on #5048. The PostHog MCP server will use this in place of its own
$mcp_param_aliases_used(PostHog/posthog#101133).Closes #5116
Release info Sub-libraries affected
Libraries affected
Checklist
Created with PostHog Desktop
🤖 Generated with Claude Code