mitmproxy-mcp AGENTS.md

mitmproxy-mcp AGENTS.md is an instructions file for Codex, OpenCode from moha-abdi/mitmproxy-mcp. It costs 2,436 tokens per session, scanned A, original, MIT.

Development instructions for an add-on that connects an AI coding agent to mitmproxy, a tool that captures and inspects web traffic. They describe its Python setup, structure, and connection method.

In plain words
What is it for?
Use them when developing, testing, or changing the mitmproxy add-on and its connection to AI-agent tools.
Why use it?
They give the agent the project rules it needs to work safely, including the required Python version and package manager. This reduces setup mistakes and changes that do not fit the project.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/moha-abdi/mitmproxy-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/moha-abdi/mitmproxy-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mitmproxy-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/moha-abdi/mitmproxy-mcp/agents-md.svg)](https://agentmods.dev/instructions/moha-abdi/mitmproxy-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/moha-abdi/mitmproxy-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/moha-abdi/mitmproxy-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,436 This file is loaded in full into every session.
When invoked 2,436 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02436 $0.02436
Opus 5 $0.01218 $0.01218
Sonnet 5 $0.00487 $0.00487
Haiku 4.5 $0.00244 $0.00244

Measured 4d ago against content hash 61908b3d58bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mitmproxy-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 337 lines

How it starts

The opening of the file, as written. The whole thing — 337 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mitmproxy-mcp Development Guide for AI Agents

Project: MCP Server for mitmproxy -- HTTP traffic analysis via Model Context Protocol

Status: Feature-complete (v0.1.0), pre-PyPI publish

Stack: Python 3.10+, mitmproxy 11, MCP SDK, Pydantic v2 (v1 compat API)

Repo: moha-abdi/mitmproxy-mcp


Architecture

MCP server runs inside mitmproxy as an addon. Not a separate process -- it's embedded directly in the proxy event loop via the running() hook and asyncio.create_task().

mitmproxy (proxy process)
  addon.py (thin wrapper, loads from mitmproxy_mcp.addon)
    MitmproxyAddon
      flow hooks: request(), response(), error()
      MCP server: SSE on port 9011 (default)
        20 tools across 4 categories

The SSE transport uses Starlette + uvicorn. Each connecting client gets its own ServerSession with a unique session ID -- multi-client is handled natively by the MCP SDK.


Dependency Management

Always use uv, never pip:

uv pip install -e ".[dev]"
uv pip install <package>
uv pip install --upgrade <package>

Python Version

  • Minimum: Python 3.10 (required by mcp package)
  • System Python: 3.9.6 (too old, don't use)
  • Available: /Users/moha/.local/bin/python3.10
/Users/moha/.local/bin/python3.10 -m venv .venv
source .venv/bin/activate
uv pip install -e ".[dev]"
mitmproxy-mcp install-shims --force

Project Structure

mitmproxy-mcp/
  addon.py                  thin wrapper (mitmproxy loads this)
  pyproject.toml            package config, dependencies
  pytest.ini                asyncio_mode=auto
  README.md                 user docs with client setup guides
  SKILL.md                  agent skill definition (agentskills.io format)
  LICENSE                   MIT
  .github/workflows/ci.yml  CI: ruff + mypy + pytest

  mitmproxy_mcp/            main package
    __init__.py             version = "0.1.0"
    __main__.py             CLI stub
    addon.py                mitmproxy addon, MCP server lifecycle
    models.py               pydantic models for flow serialization
    storage.py              thread-safe in-memory flow storage
    privacy.py              redaction engine (tokens, keys, passwords, JWTs)
    transport.py            stdio, sse, tcp transport layer
    tools/
      __init__.py
      flows.py              8 flow query/export tools
      replay.py             4 replay and modification tools
      intercept.py          5 interception control tools
      config.py             3 proxy configuration tools

  tests/                    174 tests, all passing
    conftest.py             shared fixtures
    test_models.py          model serialization tests
    test_flow_tools.py      flow query tool tests
    test_replay_tools.py    replay tool tests
    test_intercept_tools.py intercept tool tests
    test_config_tools.py    config tool tests
    test_privacy.py         redaction engine tests
    test_transport.py       transport layer tests
    test_integration.py     addon integration tests

Read the full file on GitHub · 337 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 337 lines · 2,436 tokens per session scan A 61908b3d58bc

Subscribe to this mod's changes

mitmproxy-mcp AGENTS.md is an instructions file published in the GitHub repository moha-abdi/mitmproxy-mcp (9 stars, last pushed 6mo ago), licensed MIT. It adds 2,436 tokens to every session, about $0.0122 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens