user-context
Purpose
Generate personalized messages based on authenticated user data from JWT tokens.
Description
The user-context prompt creates context-aware messages that incorporate the user's profile information including name, email, and group memberships. This demonstrates how prompts can access authentication context to create personalized content.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| messageType | enum | No | Message type: welcome, status, summary (default: welcome) |
Note: The
messageTypeparameter is case-insensitive. Values like"Welcome","STATUS", or"summary"are all accepted.
Using in Claude Code
In Claude Code, MCP prompts appear as slash commands. To use the user-context prompt:
- Type
/seed:user-contextin the chat - Claude Code will show
seed:user-context (MCP)as an autocomplete option - Select it to invoke the prompt with default values
Example
/seed:user-contextNote: Claude Code does not display parameter dialogs for MCP prompts. The prompt is invoked with default values (welcome message type). Parameters are only available in clients that support them like Claude Desktop.
Note: MCP prompts provide conversation context, not direct output. When you invoke this prompt, the user context message is injected into Claude's conversation history, and Claude responds based on that context.
Limitation: You cannot ask Claude to "use the user-context prompt" conversationally. MCP prompts must be invoked directly via slash commands. See claude-code#11054.
Using in Claude Desktop
In Claude Desktop, MCP prompts can be invoked through the prompt picker:
- Click the prompt icon (speech bubble with lines) in the chat input area
- Select seed from the server list
- Choose user-context from the available prompts
- Select the message type in the dialog
Alternatively, some clients support natural language invocation:
"Use the user-context prompt to show my status"
"Generate a welcome message with my user info"Response Examples
welcome (Default)
Welcome back, Jane Developer!
You are logged in as developer@example.com.
Your groups: admin, developers, users
How can I assist you today?status
User Status Report:
User: Jane Developer
ID: user-123
Email: developer@example.com
Groups: admin, developers, users
You are currently authenticated and have access to this system.summary
Quick Summary:
Jane Developer (user-123) is authenticated with 3 group(s).Message Type Comparison
| Aspect | welcome | status | summary |
|---|---|---|---|
| Length | Medium | Long | Short |
| Detail | Basic | Comprehensive | Minimal |
| Tone | Friendly | Professional | Neutral |
| Best For | Login/Return | Admin/Profile | Menu/Header |
Authentication
Required: Yes
This prompt requires a valid JWT token. If authentication is disabled or no token is present:
Error: User context not available. Authentication may be disabled or user data not present.User Data Fields
The prompt accesses these JWT token claims:
| Field | Type | Description |
|---|---|---|
| sub | string | Unique user identifier (required) |
| name | string | Display name (falls back to email or ID) |
| string | Email address | |
| groups | string[] | Group memberships/roles |
Response Format
The prompt returns a message in MCP format:
{
"messages": [
{
"role": "assistant",
"content": {
"type": "text",
"text": "Welcome back, Jane Developer!..."
}
}
]
}The role: "assistant" indicates this message appears as prior assistant output in the conversation context.
Troubleshooting
"User context not available" Error
| Cause | Solution |
|---|---|
| Not authenticated | Complete OAuth flow |
| Token expired | Refresh token |
| AUTH_REQUIRED=false | Enable authentication |
| Missing claims | Check IdP configuration |
Missing User Fields
If fields show as "(not available)" or "(none)", verify your IdP includes the required claims in the JWT token.
Related
- greeting - Generate style-appropriate greetings (no auth required)
- user-info tool - Get user data in structured JSON format
- user://profile resource - Access user data programmatically
- All Prompts - Return to prompts overview