Session Tools
Aether MCP provides 3 session management tools for authentication and session control.session_auth
Generate an authentication challenge for wallet signature. Parameters:walletAddress(optional): Your Solana wallet address
nonce: Challenge identifier (32 bytes)message: Message to sign with your walletexpiresAt: Challenge expiration time (5 minutes)
Challenges expire in 5 minutes for security. Rate limited to 5 requests per minute per wallet/IP.
session_info
Get information about your current session. No Parameters Required Returns (if authenticated):walletAddress: Authenticated walletauthenticated: trueisProvider: Whether you’ve registered as a service providerstats: Conversation count, order count, payment historyrecentConversations: Last 5 conversationsrecentOrders: Last 5 orders
session_restore
Restore a session from a JWT token (validates and refreshes if needed). Parameters:token: JWT session token from previous authentication
- Session information
- New token if auto-refreshed (< 1 hour remaining)
Auto-Refresh: If your token expires in < 1 hour, a new token is automatically returned.
Session Fingerprinting
The server creates a session fingerprint to associate sessions with specific clients:- Link wallets to clients: The server stores fingerprint-wallet associations in the
fingerprint_wallet_linksdatabase table - Auto-restore sessions: When a client reconnects with the same fingerprint, its previous wallet session is restored
- Devnet keypair restoration: On devnet, the encrypted wallet keypair is automatically decrypted and restored
Configurable Session Timeout
In-memory session lifetime is configurable via environment variable:| Variable | Default | Description |
|---|---|---|
MCP_SESSION_TIMEOUT_MS | 3600000 (1 hour) | Time before inactive in-memory session is cleaned up |
This controls in-memory cleanup only. Session data persists in the database (SQLite or Redis) and survives server restarts. When a session is cleaned from memory, it can be reconstructed from the database.
Automatic Session Reconstruction
When an in-memory session expires but persisted data exists, the server automatically reconstructs it: What gets reconstructed:- Wallet address and session metadata
- Provider profile (if registered)
- Conversation and order history
- On devnet: wallet keypair (from encrypted storage)
- JWT token (must be stored client-side or use
session_restore) - Connections from new devices/IPs (different fingerprint)
Session Lifecycle
Token Revocation
Revoke Current Session
Usewallet_disconnect to revoke your current session token:
- Current JWT token added to blacklist
- Token becomes invalid immediately
- Session data persists (can reconnect later)
- Any requests with this token will fail
HTTP Revocation Endpoints
For direct HTTP access (non-MCP clients):Revoke Current Token
Revoke All Sessions
Emergency revocation of all sessions for your wallet:JWT Token Structure
Tokens are standard JWTs with custom claims:walletAddress: Your authenticated Solana walletsessionId: Unique session identifier (for multi-device support)jti: JWT ID for revocation (blacklist lookup)iat: Issued at timestampexp: Expiration timestamp (7 days from issue)iss: Issuer (aether-mcp)aud: Audience (mcp-client)
Session Persistence
Sessions are stored in SQLite (or Redis for distributed deployments): Stored Data:- Wallet address (primary key)
- Session creation/expiration timestamps
- Last activity timestamp
- Provider profile (if registered)
- Conversation history (marketplace)
- Order history (marketplace)
- Payment references
- Fingerprint-wallet links
- Server restarts
- MCP transport reconnections
- Different MCP clients (same wallet)
Rate Limiting
Authentication endpoints have strict rate limits to prevent brute force:| Endpoint | Limit | Window |
|---|---|---|
session_auth | 5 attempts | 15 minutes |
/auth/challenge | 5 attempts | 15 minutes |
/auth/verify | 5 attempts | 15 minutes |
session_info | 60 requests | 1 minute |
IP address + wallet address
Best Practices
Token Storage
Token Storage
Session Lifecycle Management
Session Lifecycle Management
Error Handling
Error Handling
