Skip to main content

MCP server for uploading debug incidents to Debug Memory

Project description

Debug Incident MCP Server

An MCP (Model Context Protocol) server for uploading debug incidents to Debug Memory via Cursor.

Installation

1. Install the MCP Server

Clone or download this repository:

git clone https://github.com/yourusername/debug-mcp.git
cd debug-mcp

2. Install Dependencies

Using uv (recommended):

uv sync

This creates a virtual environment at .venv and installs all dependencies.

Or install from PyPI using uv:

uv pip install debug-mcp

3. Get Your API Key

  1. Go to your Debug Memory dashboard
  2. Navigate to SettingsAPI Keys
  3. Create a new API key
  4. Copy the key (starts with dm_)

4. Configure Cursor

See Cursor Setup Guide for detailed instructions.

Quick config - create or edit .cursor/mcp.json in your project:

{
  "mcpServers": {
    "debug-incident": {
      "command": "uvx",
      "args": ["debug-mcp"],
      "env": {
        "WORKSPACE_API_KEY": "dm_your_api_key_here"
      }
    }
  }
}

⚠️ Replace:

  • dm_your_api_key_here with your API key from Debug Memory

5. Restart Cursor

Close and reopen Cursor for the MCP server to load.

Usage

Once configured, the MCP server exposes these tools (see docs/tools.md for the full workflow and next_action behavior):

1) ranked_solutions

  • Search similar incidents and return env-aware ranked solutions
  • Inputs: query_text (required), env (required), limit (optional, default 5)
  • Output: lookup_id, ranked solutions, recommended solution, next_action

2) add_incident

  • Create a new incident + solution + outcome (blocks duplicates if a similar incident already exists)
  • Inputs: title, summary, error_signature, tags, steps, env, worked, notes (optional)

3) add_solution

  • Add a new fix (or env-specific variant) for an existing incident
  • Inputs: incident_id (required), steps (required), env (required), env_bucket (optional)
  • Next action: Record an outcome for this solution

4) record_outcome

  • Record whether a solution worked or failed
  • Inputs: solution_id (required), worked (required), env (required), env_bucket (optional), notes (optional)

Examples

Upload an incident:

Upload an incident: "TypeError in auth module"

Upload with details:

Upload an incident with title "API timeout in production" 
with summary "Payment API timing out after 30s" 
and tags ["api", "performance", "production"]

Search for similar incidents:

Search for incidents about "null pointer exception"
Find similar incidents to "cannot read property of undefined"

Workflow example:

1. "Search for incidents about TypeError in map function"
2. (Review results, if no solution found)
3. "Upload incident: TypeError when calling map on undefined array, 
    fixed by adding null check, root cause was API returning null"

How It Works

  1. The MCP client calls tools like ranked_solutions, add_solution, record_outcome, add_incident
  2. MCP server calls Debug Memory edge function endpoints
  3. Edge function authenticates your API key and creates the incident
  4. MCP server generates embeddings using all-MiniLM-L6-v2 model
  5. Embeddings are uploaded for title, summary, and error_signature fields
  6. Incident is stored in your workspace with semantic search enabled

Architecture

┌─────────┐           ┌─────────────┐           ┌──────────────┐
│ Cursor  │  ◄─MCP─►  │ MCP Server  │  ◄─HTTP─► │ Edge Function│
│   AI    │   stdio   │  (Python)   │   POST    │  (Supabase)  │
└─────────┘           └─────────────┘           └──────────────┘
                             │                          │
                             │                          ▼
                      Configured with            ┌──────────────┐
                      WORKSPACE_API_KEY          │   Database   │
                                                 └──────────────┘

Features

  • 🚀 Easy Integration: One-command setup with uv
  • 🔒 Secure: API keys stay in config, never exposed to LLM
  • 🧠 Semantic Search: Auto-generates embeddings for intelligent search
  • 🔍 Find Solutions: Search past incidents to find fixes for similar problems
  • 📝 Rich Incident Data: Capture title, summary, error signatures, fixes, and more
  • 🏷️ Tagging: Categorize incidents with custom tags

Security

  • ✅ API key stored in Cursor config (not in code)
  • ✅ API key never exposed to LLM or conversation logs
  • ✅ Edge function validates API key server-side
  • ✅ No direct database access from MCP server
  • ✅ Embeddings generated locally before upload

Technical Details

  • Embedding Model: all-MiniLM-L6-v2 (384 dimensions)
  • Transport: stdio (local execution)
  • Dependencies: Managed with uv
  • Python: 3.10+

Files

File Description
mcp_server.py Main MCP server implementation
requirements.txt Python dependencies
cursor-setup.md Detailed Cursor configuration guide
env.example Environment variable template (optional)
README.md This file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

debug_mcp-0.1.6.tar.gz (153.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

debug_mcp-0.1.6-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file debug_mcp-0.1.6.tar.gz.

File metadata

  • Download URL: debug_mcp-0.1.6.tar.gz
  • Upload date:
  • Size: 153.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for debug_mcp-0.1.6.tar.gz
Algorithm Hash digest
SHA256 e8b3cea12c377ed5b6ee7bf085d731fabb9a607e5406938bb3cd09457cd2204e
MD5 cb0b0b14e98b02d3d7f7426b30d7315b
BLAKE2b-256 71c96707e50d20afcac7b6dd45c8201661fe2f295e3bc7d7282508cb2239253b

See more details on using hashes here.

Provenance

The following attestation bundles were made for debug_mcp-0.1.6.tar.gz:

Publisher: publish.yml on s355park/debug-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file debug_mcp-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: debug_mcp-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for debug_mcp-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6f6ecf7c4b447406f8ead5f9cc0178ccc9707c0b0af2d4dac935749db3d00933
MD5 68b913255708c6e1da58cf8370278087
BLAKE2b-256 841768cfe94e79c3d8490f6dd71d49bfce2d240ccba875d61fb60d09bfe27003

See more details on using hashes here.

Provenance

The following attestation bundles were made for debug_mcp-0.1.6-py3-none-any.whl:

Publisher: publish.yml on s355park/debug-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page