Skip to content

Add current user info capability - #444

Merged
kentcdodds merged 1 commit into
mainfrom
cursor/user-info-capability-4679
May 12, 2026
Merged

kentcdodds merged 1 commit into
mainfrom
cursor/user-info-capability-4679

Conversation

@kentcdodds

@kentcdodds kentcdodds commented May 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add meta_get_current_user to expose safe signed-in user identity fields to trusted LLM workflows.
  • Register the capability in the meta domain and cover authenticated, anonymous, and registry behavior.

Testing

  • npm run test -- packages/worker/src/mcp/capabilities/meta/meta-get-current-user.node.test.ts
  • npm run format:check -- packages/worker/src/mcp/capabilities/meta/meta-get-current-user.ts packages/worker/src/mcp/capabilities/meta/domain.ts packages/worker/src/mcp/capabilities/meta/meta-get-current-user.node.test.ts
  • npm run validate
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added a new capability to retrieve current signed-in user information, returning user ID, email, and display name. This read-only, non-destructive operation provides secure access to authenticated user identity details.
  • Tests

    • Comprehensive test coverage added to verify capability functionality and authentication requirements.

Review Change Stack

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented May 12, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ec8fb0c-3ace-4873-a976-7b47e8164cf4

📥 Commits

Reviewing files that changed from the base of the PR and between bedb8ee and b80a8db.

📒 Files selected for processing (3)
  • packages/worker/src/mcp/capabilities/meta/domain.ts
  • packages/worker/src/mcp/capabilities/meta/meta-get-current-user.node.test.ts
  • packages/worker/src/mcp/capabilities/meta/meta-get-current-user.ts

📝 Walkthrough

Walkthrough

This PR adds a new meta_get_current_user MCP capability that returns the authenticated user's identity fields (user_id, email, display_name). The capability validates required authentication, is read-only and idempotent, and is registered in the meta domain alongside existing meta capabilities.

Changes

Current User MCP Capability

Layer / File(s) Summary
meta_get_current_user capability definition, tests, and registration
packages/worker/src/mcp/capabilities/meta/meta-get-current-user.ts, packages/worker/src/mcp/capabilities/meta/meta-get-current-user.node.test.ts, packages/worker/src/mcp/capabilities/meta/domain.ts
Defines the meta_get_current_user capability with a Zod output schema for user identity fields, implements the handler to fetch and return the authenticated user via requireMcpUser, adds three test cases covering successful output, authentication rejection, and capability metadata validation, and registers the capability in metaDomain's capabilities array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • kentcdodds/kody#180: Both PRs extend the metaDomain by adding new MCP capabilities to its capabilities array.

Poem

🐰 A user emerges from the auth's embrace,
Their identity safe in a well-guarded place,
With id, email, name—no secrets to steal,
The capability's done, the pattern is real!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add current user info capability' directly and clearly describes the main change: adding a new MCP capability to expose current user information.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/user-info-capability-4679

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kentcdodds
kentcdodds marked this pull request as ready for review May 12, 2026 05:15
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-444.kentcdodds.workers.dev

Worker: kody-pr-444
D1: kody-pr-444-db
KV: kody-pr-444-oauth-kv

Mocks:

@kentcdodds
kentcdodds merged commit 0e64f68 into main May 12, 2026
8 checks passed
@kentcdodds
kentcdodds deleted the cursor/user-info-capability-4679 branch May 12, 2026 05:29
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.

2 participants