MCP Server Setup
Configure the MCP server for AI agent integration.
Prerequisites
Requirements
- Node.js: Version 16+
- DebuggAI Account: Sign up
- API Key: From DebuggAI settings
Get API Key
- Sign in at debugg.ai
- Settings → API Keys
- Generate new key
- Copy and save securely
Installation Methods
NPX (Recommended)
npx -y @debugg-ai/debugg-ai-mcp
NPM Global
npm install -g @debugg-ai/debugg-ai-mcp
debugg-ai-mcp
Docker
docker run -e DEBUGGAI_API_KEY=your_key debugg-ai/mcp-server
Claude Desktop Integration
1. Locate Config File
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%/Claude/claude_desktop_config.json
Linux:
~/.config/Claude/claude_desktop_config.json
2. Add Configuration
claude_desktop_config.json
{
"mcpServers": {
"debugg-ai-mcp": {
"command": "npx",
"args": ["-y", "@debugg-ai/debugg-ai-mcp"],
"env": {
"DEBUGGAI_API_KEY": "your_api_key_here",
"DEBUGGAI_LOCAL_PORT": "3000"
}
}
}
}
3. Restart Claude Desktop
Close and reopen Claude Desktop to load the MCP server.
Environment Variables
Required Variables
DEBUGGAI_API_KEY=your_key # API key from debugg.ai
DEBUGGAI_LOCAL_PORT=3000 # Your app's port
Optional Variables
# Test credentials
TEST_USERNAME_EMAIL=test@example.com
TEST_USER_PASSWORD=testpassword123
# Project context
REPO_NAME=my-project
BRANCH_NAME=main
REPO_PATH=/path/to/repo
# Advanced settings (rarely needed)
DEBUGGAI_TIMEOUT=30000 # Test timeout in milliseconds
DEBUGGAI_RETRIES=2 # Number of retry attempts
Docker Deployment
Basic Docker
Dockerfile
FROM node:18-alpine
WORKDIR /app
# Install MCP server
RUN npm install -g @debugg-ai/debugg-ai-mcp
# Expose port
EXPOSE 3000
# Start server
CMD ["debugg-ai-mcp"]
Build and run:
docker build -t debuggai-mcp .
docker run -d \
-e DEBUGGAI_API_KEY=your_key \
-e DEBUGGAI_LOCAL_PORT=3000 \
-p 3000:3000 \
debuggai-mcp
Docker Compose
docker-compose.yml
version: '3.8'
services:
debuggai-mcp:
image: node:18-alpine
command: sh -c "npm install -g @debugg-ai/debugg-ai-mcp && debugg-ai-mcp"
environment:
- DEBUGGAI_API_KEY=your_key
- DEBUGGAI_LOCAL_PORT=3000
ports:
- "3000:3000"
Testing Setup
1. Verify Installation
# Check if MCP server is available
npx @debugg-ai/debugg-ai-mcp --version
2. Test in Claude Desktop
In Claude Desktop, type:
Test my homepage loads correctly using debugg_ai_test_page_changes
3. Check Logs
Monitor the MCP server logs for connection and test execution.
Advanced Configuration
Custom MCP Server
custom-mcp-server.js
const { MCPServer } = require('@debugg-ai/debugg-ai-mcp');
const server = new MCPServer({
apiKey: process.env.DEBUGGAI_API_KEY,
localPort: 3000,
timeout: 30000,
retries: 2
});
server.start();
Programmatic Usage
example.js
const { DebuggAIClient } = require('@debugg-ai/debugg-ai-mcp');
const client = new DebuggAIClient({
apiKey: process.env.DEBUGGAI_API_KEY
});
async function runTest() {
const result = await client.testPageChanges({
description: 'Test user registration form',
localPort: 3000
});
console.log('Test result:', result);
}
runTest();
Troubleshooting
MCP Server Not Starting
# Check Node.js version
node --version
# Verify API key
echo $DEBUGGAI_API_KEY
# Test connection
curl -I localhost:3000
Claude Desktop Issues
- Restart Claude: Close and reopen application
- Check JSON syntax: Validate claude_desktop_config.json format
- Check logs: Look for MCP connection errors in Claude Desktop
Connection Problems
- Firewall: Allow localhost connections
- Port conflicts: Use different port
- Network: Verify internet connectivity
API Issues
- Invalid key: Regenerate in DebuggAI settings
- Quota exceeded: Check usage limits
- Account suspended: Contact support
Production Deployment
Security Considerations
- Store API keys securely (env variables, secrets)
- Use HTTPS for external connections
- Limit network access to required ports
- Monitor for unusual activity
Scaling
- Use load balancers for multiple instances
- Implement health checks
- Set up monitoring and alerting
- Configure auto-restart on failures
Monitoring
# Check server status
curl -f localhost:3000/health || echo "Server down"
# Monitor logs
tail -f /var/log/debuggai-mcp.log
# Resource usage
docker stats debuggai-mcp