@muggleai/mcp
v1.0.26
Published
Unified MCP server for Muggle AI - Cloud QA and Local Testing tools
Maintainers
Readme
@muggleai/mcp
Unified MCP server for Muggle AI - combines Cloud QA and Local Testing tools into a single package.
Installation
npm install -g @muggleai/mcpThis automatically:
- Installs the package
- Downloads the Electron app binary (via postinstall)
- Sets up CLI commands
Quick Start
1. Add to your MCP client
Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"muggle": {
"command": "muggle-mcp",
"args": ["serve"]
}
}
}2. Start using MCP tools
Ask your AI assistant to test your application! Authentication happens automatically when needed.
CLI Commands
# Server (main command - starts MCP server for AI clients)
muggle-mcp serve # Start server with all tools (default)
muggle-mcp serve --qa # Cloud QA tools only
muggle-mcp serve --local # Local testing tools only
# Setup & Diagnostics
muggle-mcp setup # Download/update Electron app
muggle-mcp setup --force # Force re-download
muggle-mcp doctor # Diagnose installation issues
# Authentication (optional - auth happens automatically)
muggle-mcp login # Manually trigger login
muggle-mcp logout # Clear credentials
muggle-mcp status # Show auth status
# Info
muggle-mcp --version # Show version
muggle-mcp --help # Show helpAuthentication
Authentication happens automatically when you first use a tool that requires it:
- A browser window opens with a verification code
- You log in with your Muggle AI account
- The tool call continues with your credentials
Your credentials are stored in ~/.muggle-ai/credentials.json and persist across sessions.
Handling Expired Tokens
Tokens expire after a period of time. When this happens:
- Check status: Run
muggle-mcp statusor callmuggle-remote-auth-statusto see expiration - Re-authenticate: Run
muggle-mcp loginor callmuggle-remote-auth-loginto get fresh tokens - If login fails with "unauthorized_client": Check your runtime target configuration (see Troubleshooting)
The MCP server will attempt to auto-refresh tokens when possible, but manual re-authentication may be required if the refresh token has also expired.
Available Tools
Cloud QA Tools (muggle-remote-*)
Tools that work with the Muggle AI cloud backend:
muggle-remote-project-create- Create QA projectmuggle-remote-project-list- List projectsmuggle-remote-use-case-create-from-prompts- Create use casesmuggle-remote-test-case-generate-from-prompt- Generate test casesmuggle-remote-workflow-start-*- Start various workflows- And more...
Local QA Tools (muggle-local-*)
Tools that work with local testing:
muggle-local-check-status- Check local statusmuggle-local-list-sessions- List sessionsmuggle-local-execute-test-generation- Generate test scriptmuggle-local-execute-replay- Replay test scriptmuggle-local-run-result-list- List run resultsmuggle-local-publish-test-script- Publish to cloud- And more...
Data Directory
All Muggle AI data is stored in ~/.muggle-ai/:
~/.muggle-ai/
├── credentials.json # Auth credentials (auto-generated)
├── projects/ # Local test projects
├── sessions/ # Test execution sessions
└── electron-app/ # Downloaded Electron app
└── 1.0.0/
└── MuggleAI.exeRequirements
- Node.js 22 or higher
- For local testing: Electron app (downloaded automatically)
Development
Building
npm install
npm run buildTesting
npm test # Run tests once
npm run test:watch # Watch modeLinting
npm run lint # Auto-fix issues
npm run lint:check # Check onlyCI/CD Workflows
| Workflow | Trigger | Description |
| :------- | :------ | :---------- |
| ci.yml | Push/PR to main | Lint, test, build on multiple platforms/versions |
| publish-mcp.yml | Tag v* | Publish package to npm |
| release-electron-app.yml | Tag electron-app@* | Build and release Electron binaries |
Publishing a new version
- Update version in
package.json - Commit and push
- Create a git tag:
git tag v1.0.1 && git push --tags - The
publish-mcp.ymlworkflow publishes to npm automatically
Releasing Electron app
- Update
muggleConfig.electronAppVersioninpackage.json - Run the
release-electron-app.ymlworkflow manually - Or create a tag:
git tag [email protected] && git push --tags
Troubleshooting
Expired Token Errors
If you see authentication errors like "Not authenticated" or token expiration messages:
Check auth status:
muggle-mcp statusRe-authenticate:
muggle-mcp loginClear and retry (if login keeps failing):
muggle-mcp logout muggle-mcp login
"unauthorized_client" Error During Login
This error indicates a mismatch between your Auth0 client configuration and the target environment.
Cause: The MCP is configured for one environment (dev/production) but trying to authenticate against another.
Fix: Ensure your MCP configuration matches your intended environment by setting the MUGGLE_MCP_PROMPT_SERVICE_TARGET environment variable in your MCP config:
For Production (~/.cursor/mcp.json):
{
"mcpServers": {
"muggle": {
"command": "muggle-mcp",
"args": ["serve"],
"env": {
"MUGGLE_MCP_PROMPT_SERVICE_TARGET": "production"
}
}
}
}For Development (local services):
{
"mcpServers": {
"muggle": {
"command": "muggle-mcp",
"args": ["serve"],
"env": {
"MUGGLE_MCP_PROMPT_SERVICE_TARGET": "dev"
}
}
}
}After changing the configuration, restart your MCP client (e.g., restart Cursor).
Credential Files
Credentials are stored in ~/.muggle-ai/:
| File | Purpose |
| :--- | :------ |
| auth.json | OAuth tokens (access token, refresh token, expiry) |
| credentials.json | API key for service calls |
If you need to reset authentication completely:
rm ~/.muggle-ai/auth.json
rm ~/.muggle-ai/credentials.json
muggle-mcp loginLicense
MIT
