mitmproxy-mcp: Instructions file for Codex

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

Written for Codex and OpenCode: the file is AGENTS.md.

This is moha-abdi/mitmproxy-mcp's own configuration. It tells Codex and OpenCode how to work on mitmproxy-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mitmproxy-mcp configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/moha/.local/bin/python3.10.

Reuse

Borrowing it

Nothing to install: this file belongs to moha-abdi/mitmproxy-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/moha-abdi/mitmproxy-mcp/main/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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mitmproxy-mcp AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02436 $0.02436
Opus 5.5 $0.00974 $0.00974
Sonnet 5.5 $0.00487 $0.00487
Haiku 4.5 $0.00244 $0.00244

Measured 1mo ago against content hash 61908b3d58bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 8mo ago), licensed MIT. It adds 2,436 tokens to every session, about $0.0097 per session on Opus 5.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 · 9,715 tokens

next.js AGENTS.md

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,581 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens