Skip to content

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

ParameterTypeRequiredDescription
messageTypeenumNoMessage type: welcome, status, summary (default: welcome)

Note: The messageType parameter 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:

  1. Type /seed:user-context in the chat
  2. Claude Code will show seed:user-context (MCP) as an autocomplete option
  3. Select it to invoke the prompt with default values

Example

/seed:user-context

Note: 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:

  1. Click the prompt icon (speech bubble with lines) in the chat input area
  2. Select seed from the server list
  3. Choose user-context from the available prompts
  4. 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

Aspectwelcomestatussummary
LengthMediumLongShort
DetailBasicComprehensiveMinimal
ToneFriendlyProfessionalNeutral
Best ForLogin/ReturnAdmin/ProfileMenu/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:

FieldTypeDescription
substringUnique user identifier (required)
namestringDisplay name (falls back to email or ID)
emailstringEmail address
groupsstring[]Group memberships/roles

Response Format

The prompt returns a message in MCP format:

json
{
  "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

CauseSolution
Not authenticatedComplete OAuth flow
Token expiredRefresh token
AUTH_REQUIRED=falseEnable authentication
Missing claimsCheck IdP configuration

Missing User Fields

If fields show as "(not available)" or "(none)", verify your IdP includes the required claims in the JWT token.

Released under the MIT License.