🔧 Runheed Setup Python

Add Runheed error reporting to a Python app (FastAPI, Django, Flask, Celery, scripts) so production errors reach the coding agent over MCP. Use when the user asks to ”add error tracking”, ”set up Runh

NEEDS AN EXTERNAL SERVICE

Runheed Setup Python connects to an MCP server. It can need an account, an API key, or paid credits, and copying the prompt alone will not work. See the source repository for pricing and setup.

QUICK INSTALL
/plugin marketplace add getrunheed/runheed-plugin /plugin install runheed@runheed

Runheed Setup Python instructions

Set up Runheed in a Python app

Full reference, kept current: https://runheed.com/SETUP.txt (read it if anything here doesn't match the project).

1. The DSN (needs the user)

Ask the user to sign in at https://runheed.com/login, create a project under Projects and paste the DSN (runheed://pk_...@runheed.com/<project-id>). Save it as RUNHEED_DSN in the environment or the host's secrets. Never commit it. Django, Flask and FastAPI don't read .env on their own: export it in the service, or load the file with python-dotenv.

2. Install

pip install https://runheed.com/dl/runheed-0.1.7-py3-none-any.whl

Add the same URL to requirements.txt or pyproject.toml so the deploy installs it too.

3. Initialize

import os, runheed
runheed.init(dsn=os.environ["RUNHEED_DSN"])

Then add the framework hook, or errors inside request handlers won't be reported:

  • FastAPI: https://runheed.com/for/fastapi
  • Django: https://runheed.com/for/django (put the middleware LAST in MIDDLEWARE, so it sees the exception before other middleware turns it into a response)
  • Flask: https://runheed.com/for/flask
  • Celery: task failures are reported on their own once runheed.init() runs in the worker process. Other background jobs (FastAPI BackgroundTasks, management commands, cron scripts) need runheed.capture_exception(e) in their own except blocks.
  • Render or Railway (commit and environment tags): https://runheed.com/for/render, https://runheed.com/for/railway

The Python SDK sends each event before capture_exception returns, so there's no flush step.

4. Verify

Add a temporary view or script that raises, run it once, and confirm the error appears at https://runheed.com/dashboard/errors. Remove the test code.

5. Connect the agent

claude mcp add --transport http runheed https://runheed.com/api/mcp

Then /mcp > runheed > Authenticate. Cursor: {"mcpServers": {"runheed": {"url": "https://runheed.com/api/mcp"}}} in .cursor/mcp.json. Other clients: https://runheed.com/connect

Then use the runheed-fix-production-errors skill to work through what it records.

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.