contexts command helps you manage saved browser authentication contexts. This allows you to reuse login sessions across multiple MCP server generations without having to authenticate every time.
Usage
Subcommands
Show all saved authentication contexts
Display details for a specific domain’s context
Create a new authentication context for a domain
Remove a saved context for a domain
Examples
List All Contexts
View all saved authentication contexts:Show Context Details
View details for a specific domain:Create New Context
Create an authentication context for a domain:- Launch a live browser session
- Navigate to the domain
- Wait for you to complete authentication
- Save the browser state (cookies, local storage, etc.)
Complete all authentication steps including 2FA before pressing Enter.
Delete Context
Remove a saved authentication context:This action cannot be undone. You’ll need to authenticate again to create a
new context.
How Contexts Work
Authentication contexts store browser state to avoid repeated logins:1
Context Creation
When you authenticate during
mcpkit create or run mcpkit contexts create, the browser state is captured including:- Cookies
- Local storage
- Session storage
- IndexedDB data
2
Context Storage
The context is saved to your local machine:Each file contains the serialized browser context.
3
Context Reuse
When creating an MCP server for a domain with a saved context:The saved context is loaded, so you don’t need to log in again.
4
Context Expiry
Contexts can expire based on the website’s session policies. If a context is invalid, you’ll be prompted to authenticate again.
Context Files
Location
- macOS/Linux
- Windows
File Format
Context files are JSON containing browser state:Context files contain sensitive authentication data. Never share these files
or commit them to version control.
Use Cases
Multi-Site Workflow
Save contexts for multiple sites you frequently use:Context Refresh
If your session expires, refresh the context:Team Sharing (Advanced)
For authorized internal tools, you can share contexts (use caution):Only share contexts for authorized internal tools where you have permission.
Never share personal account contexts.
Domain Matching
Contexts are matched by domain name:| URL | Matched Context |
|---|---|
https://mcpkit.sh | mcpkit.sh |
https://www.mcpkit.sh | mcpkit.sh (or www.mcpkit.sh if exists) |
https://app.mcpkit.sh | mcpkit.sh (or app.mcpkit.sh if exists) |
https://mcpkit.sh/team/issue-123 | mcpkit.sh |
MCPKit normalizes domains by removing
www. and subdomains to find the base
domain context.Security Considerations
What’s Stored
Contexts contain:- ✅ Session cookies
- ✅ Authentication tokens
- ✅ Local storage data
- ✅ Session storage data
- ❌ Passwords (never stored)
- ❌ Credit card information
- ❌ Personal messages
Best Practices
Protect Your Contexts
Follow these practices to keep your authentication contexts secure:
- Use separate accounts - Create dedicated accounts for automation when possible
- Rotate contexts - Refresh contexts periodically
- Monitor usage - Check your account activity for unexpected sessions
- Delete unused contexts - Remove contexts you no longer need
- Secure your machine - Use disk encryption and strong passwords
Permissions
Ensure proper file permissions:Troubleshooting
Context Not Found
Context Not Found
If MCPKit can’t find a context:
-
List all contexts:
-
Check domain spelling:
-
Create new context:
Context Invalid or Expired
Context Invalid or Expired
If a saved context doesn’t work:
-
Delete and recreate:
- Check website session policies - Some sites expire sessions quickly
- Verify you’re still logged in to the website manually
Authentication Fails During Creation
Authentication Fails During Creation
If context creation fails:
- Complete all auth steps - Including 2FA, email verification, etc.
- Wait for full page load - Don’t press Enter until fully logged in
- Check browser state - Make sure cookies are enabled
- Try manual authentication:
- Open the site in a normal browser
- Log in completely
- Then run
mcpkit contexts create
Can't Delete Context
Can't Delete Context
If deletion fails:
-
Check file permissions:
-
Manually delete:
-
Verify deletion: