Skip to main content

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:
npm install -g @ladybugs/mcp

Configuration

Claude Desktop

Add the Ladybugs MCP server to your Claude Desktop configuration:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
  "mcpServers": {
    "ladybugs": {
      "command": "npx",
      "args": ["-y", "@ladybugs/mcp"],
      "env": {
        "LADYBUGS_SERVER_URL": "http://localhost:4866"
      }
    }
  }
}

Claude Code CLI

For Claude Code CLI, create or edit .claude/config.json in your project:
{
  "mcpServers": {
    "ladybugs": {
      "command": "npx",
      "args": ["-y", "@ladybugs/mcp"],
      "env": {
        "LADYBUGS_SERVER_URL": "http://localhost:4866"
      }
    }
  }
}

Environment Variables

Configure the MCP server with these environment variables:
VariableDescriptionDefault
LADYBUGS_SERVER_URLURL of your Ladybugs serverhttp://localhost:4866
LADYBUGS_API_KEYAPI key for authentication (if configured)-

Verify Installation

After configuring, restart your AI assistant and verify the connection:
  1. Open a new conversation
  2. Ask: “Can you access Ladybugs?”
  3. 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:
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
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
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

  • Verify your Ladybugs server is running
  • Check the LADYBUGS_SERVER_URL is correct
  • Ensure no firewall is blocking the connection
  • Restart your AI assistant after configuration changes
  • 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
  • Verify the LADYBUGS_API_KEY is set correctly (if using authentication)
  • Check your user has access to the project data

Next Steps