What is MCP?
The Model Context Protocol (MCP) is an open standard that allows AI assistants to securely connect to external data sources and tools. Ladybugs uses MCP to provide your AI coding assistant with direct access to production runtime data, enabling instant bug analysis and debugging.Prerequisites
- Ladybugs server running (see installation guide)
- An MCP-compatible AI assistant:
- Claude Desktop
- Claude Code CLI
- Other MCP-compatible tools
Installation
Install the Ladybugs MCP server:Configuration
Claude Desktop
Add the Ladybugs MCP server to your Claude Desktop configuration:- macOS
- Windows
- Linux
Edit
~/Library/Application Support/Claude/claude_desktop_config.json:Claude Code CLI
For Claude Code CLI, create or edit.claude/config.json in your project:
Environment Variables
Configure the MCP server with these environment variables:| Variable | Description | Default |
|---|---|---|
LADYBUGS_SERVER_URL | URL of your Ladybugs server | http://localhost:4866 |
LADYBUGS_API_KEY | API key for authentication (if configured) | - |
Verify Installation
After configuring, restart your AI assistant and verify the connection:- Open a new conversation
- Ask: “Can you access Ladybugs?”
- You should see confirmation that the MCP server is connected
Using Ladybugs with Your AI Assistant
Once configured, you can ask your AI assistant to debug production issues naturally:Example: Debug a specific error
Example: Debug a specific error
You: I tried to create a post with the title ‘Banana’ and it failed. Can you check what happened?AI: Let me search the Ladybugs runtime data for that request…The AI will automatically:
- Search for relevant function calls
- Examine runtime parameters and return values
- Trace the execution flow
- Identify the root cause
- Suggest a fix
Example: Investigate unexpected behavior
Example: Investigate unexpected behavior
You: Users are reporting that the checkout flow sometimes skips the payment step. Can you investigate?AI: Let me query Ladybugs for checkout flows where the payment step was skipped…The AI will:
- Find instances of the anomalous behavior
- Analyze conditional logic that was evaluated
- Check variable states at critical points
- Identify the conditions that trigger the issue
Example: Understand a crash
Example: Understand a crash
You: The app crashed for user ID 12345 this morning. What happened?AI: Let me look up the runtime data for user 12345…The AI will:
- Locate the crash in the runtime data
- Examine the full stack trace with runtime values
- Show the exact data that caused the crash
- Suggest a fix with the specific edge case
Troubleshooting
MCP server not connecting
MCP server not connecting
- Verify your Ladybugs server is running
- Check the
LADYBUGS_SERVER_URLis correct - Ensure no firewall is blocking the connection
- Restart your AI assistant after configuration changes
No data available
No data available
- Confirm your application is instrumented with Ladybugs
- Verify the Babel plugin is configured correctly
- Check that your application is sending data to the server
- Ensure you’ve triggered the code path you’re trying to debug
Permission errors
Permission errors
- Verify the
LADYBUGS_API_KEYis set correctly (if using authentication) - Check your user has access to the project data