AgentEnv and REA: Turn a Recorded Web Capture Into an MCP Server
Version status, verified before you read further: AgentEnv — the rea feature that projects a recorded web network capture into a connectable MCP server — ships in rea-agents 6.8.0, published to npm on 2026-10-25, and we ran the entire chain end to end on 2026-10-26: capture → manifest → state → serve → export → one-step build. The contrast with a week earlier is stark: on 2026-10-24, on npm 6.7.0, the same commands returned COMMAND_NOT_FOUND in our lab — the feature was merged on main but no npm release carried it. So this page now shows both sides: the 6.7.0 refusal (so you can recognize it if you are pinned to an older release) and the full 6.8.0 run. Everything upstream of serving — the HAR inspection chain — worked on 6.7.0 and still works.
what AgentEnv is in the agentenv rea environment model
AgentEnv is the agentenv rea environment layer: it takes one recorded web network capture — a HAR file, a mitmproxy or Fiddler SAZ log, a QUIC qlog, or a browser scenario REA recorded itself — and projects it into a running MCP server. An agent connects to that rea environment server and gets exactly one tool per captured HTTP method and path template, an environment card for discovery, and a data plane for resets. Per the developer-published agentenv rea documentation, "Nothing is fetched from the recorded application; every answer comes from retained Evidence." That single sentence is the whole philosophy of the agentenv rea model: the capture is the ground truth, the live network is never touched.
Three routes make up every served rea environment: POST /mcp exposes the tool surface, GET /.well-known/agent-env.json publishes the environment card that the agentenv framework uses for discovery, and POST /agentenv is the data plane with data/reset, data/add and data/get. Two answering modes exist inside a rea environment: the default derives state from the capture, and --replay-only is pure replay — write requests are accepted and ignored, with zero side effects. [Source type: developer-published documentation, docs/agent-environments.md @ main, commits 2026-10-22/23]
the agentenv rea pipeline: capture to served environment
The developer-published agentenv rea pipeline, from raw capture to served environment, has three stages:
rea inspect-web-network-capture <capture> har --format json > capture.json— turn the raw capture into an Evidence record.rea inspect-analysis-view— project the capture view (the environment-manifest view feeds AgentEnv).rea environment-serve manifest.json --evidence capture.json --port 8765— serve it.
Stage 3 — the rea environment serving command — requires rea-agents 6.8.0 or later: on 6.7.0 and below it does not exist (the before/after section below has both proof runs). Stages 1 and 2 run on either version, and we ran them for real under both — 6.7.0 outputs below from 2026-10-24, rea-agents 6.7.0, Node 22.22.0, Linux x86_64; the 6.8.0 serving run from 2026-10-26.
We built a tiny local API and recorded six real HTTP exchanges into a HAR 1.2 file: list users, read one, a 404, a POST that creates user id=3, a re-read confirming the write, and a read of the new item. Then the inspection chain:
verified: ran 2026-10-24
$ rea inspect-web-network-capture lab08-session.har har --format jsonevidence_id: ev_a94aa7273d27a8af0dbed4882600d645acbf5dbc9234b3c0a6d394eb47a0cdb9
decoder: har-schema/lossless-json (har-schema@2.0.0;jsonc-parser@3.3.1;lossless-json@4.3.1)
total_records: 6 — 6/6 records retained, request and response bodies included
$ rea inspect-analysis-view (view.kind=capture, inline evidence)
evidence_id: ev_e9e4cf4c58252e408c5ff07d159d23a674cdc1f1f6bf87fb68f351d4af8c77d3
kind: capture, items: 6, parent_evidence_id: ev_a94aa727…
Both agentenv rea stages passed on the first run after one HAR construction fix (below). The key structural takeaway: the capture view's output is the same standard Evidence JSON every other REA workflow produces. AgentEnv is an extension of the existing evidence pipeline, not a separate universe — which matters because everything on our REA evidence contract page applies to these records unchanged.
from COMMAND_NOT_FOUND to fully served: the rea agentenv 6.8.0 before/after
This is the section most agentenv rea writeups cannot show, and it is why this page exists: we tested AgentEnv before it shipped and again the day after release, on the same machine, with the same capture. The before side first. On 2026-10-24, on 6.7.0 installed clean from npm, both serving commands were absent:
verified: ran 2026-10-24
$ rea environment-servecode: COMMAND_NOT_FOUND
message: 'environment-serve' is not a command for 'rea'.
$ rea environment-export
code: COMMAND_NOT_FOUND
message: 'environment-export' is not a command for 'rea'. Did you mean 'evidence-export'?
It was not an install quirk: rea --help's 336-line command list had no environment entry, the 6.7.0 view enum had exactly 20 kinds with no environment-manifest, and a full-text grep of the installed dist/ for agentenv returned zero hits. verified: ran 2026-10-24 The commits were merged on main Oct 21–23; no npm release carried them.
The after side: rea-agents 6.8.0, published to npm 2026-10-25, ships all four commands — environment-serve, environment-export, environment-build (a new one-step offline build) and environment-compare — plus two new view kinds, environment-manifest and environment-state, that did not exist in the 6.7.0 enum. On 2026-10-26 we re-ran the whole chain on 6.8.0 with the same HAR file we used for the failed attempt (6 records, sha256 d2e45b8d…):
verified: ran 2026-10-26, rea-agents 6.8.0
$ rea inspect-web-network-capture lab08-session.har har --format jsonevidence_id: ev_d864f4a7df7c… # same file as lab08: 6.7.0 stamped ev_a94aa727… (contract recompute)
$ rea inspect-analysis-view (kind=environment-manifest)
evidence_id: ev_a70dc8173320… tools: 3 # view kind absent from 6.7.0's 20-kind enum
$ rea inspect-analysis-view (kind=environment-state)
evidence_id: ev_37de4d0183e8…
$ rea environment-serve <manifest> --evidence <capture> --port 18777
MCP transport listening: http://127.0.0.1:18777/mcp (streamable HTTP)
GET /.well-known/agent-env.json → card: name 127-0-0-1-5231, tools [get_users, get_users_by_id]
MCP initialize → serverInfo rea/6.8.0
tools/call get_users → 200, recorded 2 users, replay.exact_match:true, state.source "recording"
tools/call get_users_by_id(id=99) → 404 {"error":"not found"} # the capture's own 404, replayed faithfully
Every result carried _meta.provenance.untrusted_content: true — the documentation's "treat even tool names as captured data" stance, confirmed live. The export and one-step build also passed on first run:
verified: ran 2026-10-26, rea-agents 6.8.0
$ rea environment-export <manifest> <dir> --evidence <capture>status: exported, tool_count 2, files[7]: README.md / env.toml / Dockerfile / manifest.json /
evidence.json / artifacts/check_*/verify.py / tasks/smoke.json
$ rea environment-build lab08-session.har <dir> # one-step: inspect→manifest→state→bundle
status: built, manifest tools 3, template_rules 4 (adds prefix-variance vs the manual chain),
coverage: reads state 0 / recorded 2, state served:true
One more fail-closed data point from the live server: a bare POST /agentenv {"method":"data/reset"} was refused with -32600 invalid request — data-plane calls must use the agentenv protocol shape, and the server does not improvise. And the write-model learning step we flagged here as merged-but-unreleased (commit aba487ee, PR #7034) shipped in 6.8.0: a prompt-built environment now learns derived values from write responses instead of pinning constants, later creates merge into the plan, and sorted arrays are accepted in any order [source type: developer-published changelog, Changes → State learning]. What we have not re-tested is macOS-only surface — the serve/export/build run above is Linux x86_64.
If you are pinned to 6.7.0 or below, the practical reading is unchanged from our original warning: any tutorial that shows you rea environment-serve without telling you it needs 6.8.0+ is sending you into COMMAND_NOT_FOUND. Follow our REA setup guide for the pinned-install baseline (and its Node version warning — 6.8.0 tightened that too), and see our REA 6.8.0 changelog breakdown for the rest of the release.
fail-closed by design: what the agentenv rea pipeline refuses to do with your capture
Our lab run surfaced two refusals worth reading closely, because they show how the rea environment chain treats your data.
Strict agentenv rea input validation, with a pointer to the exact field. Our first HAR draft gave a GET request a "postData": null field. The whole file was rejected — not parsed partially, not repaired silently:
verified: ran 2026-10-24
issues[0]: path /log/entries/0/request/postData
reason: invalid_format
message: "HAR schema validation failed: type (must be object)."
The validator is a pinned upstream har-schema (draft-06): if a field exists it must be a valid object. Removing the stray field made the identical file pass. That is schema-level fail-closed behavior — the same principle our fail-closed glossary entry describes across REA.
A manifest cannot be served from records it did not cite. Per the developer-published documentation, serving refuses any manifest whose parent evidence IDs do not match, reporting both IDs back in a structured invalid_request. The capture check itself is purely offline — the limitation text in our own evidence output reads "Recorded URLs are never fetched," and the unknowns field explicitly lists what the record cannot prove: "Historical records do not establish live runtime attribution or deployment authenticity." verified: ran 2026-10-24 An evidence format that documents its own limits is exactly what you want when a rea environment will serve it to an agent later when an agent will reason over it later.
Two more agentenv rea fail-closed properties come from the developer-published documentation rather than our lab: every tool result — including MCP-layer parameter errors — carries _meta.provenance.untrusted_content: true, and even tool names, parameter names and observed values are treated as captured data, never as instructions. Write tools are not served at all unless the capture's subsequent reads confirm the write took effect ("no call claims a change it does not make"). And replay is not emulation: a served rea environment makes no authorization model, no response semantics, no state transitions. [Source type: developer-published documentation]
agentenv rea vs a normal rea mcp session
The most common agentenv rea question is how a rea environment differs from the MCP server REA already ships. We measured the normal one directly:
verified: ran 2026-10-24
healthy: true, server rea@6.7.0, protocol 2025-11-25
inventory: tools expected=207 observed=207 missing=none unexpected=none duplicates=none
identity: catalog_digest expected==observed (96d8f6e6…2441c)
Captured 2026-10-24 on 6.7.0; the same doctor on 6.8.0 reports expected=229 observed=229 with catalog digest fe938a7c… — see our 6.8.0 changelog page for the full baseline.
- Tool surface: an agentenv rea server differs from a normal
rea mcpsession (229 analysis tools as of 6.8.0, verified 2026-10-26 — 207 on 6.7.0): an AgentEnv server exposes one tool per captured HTTP method and path template — the capture defines the surface. - Side effects: analysis tools may execute the target or a debugger; a served rea environment is zero-outbound by default — recorded URLs are never fetched, and replay mode ignores writes.
- Trust model: both treat content as untrusted, but the environment additionally marks every result with provenance metadata.
- Determinism: an agentenv rea environment is deterministic: per the developer-published documentation, ids, clocks and UUIDs generated by writes derive deterministically from state Evidence ids — "the same calls after a reset give the same state" — and
data/resetreturns the rea environment to the captured moment in one call. - Isolation and distribution: each rea environment is its own server;
rea environment-exportproduces a Docker bundle (pinned node:24.18.0-bookworm-slim, pinned rea-agents version, verifier script) that the agentenv framework runs withagent-env run— "an environment an engineer deploys on a laptop runs unchanged on a shared platform." [Source type: developer-published documentation] - Budgets: a served agentenv rea catalog reserves 1 MiB for discovery, replies cap at 256 KiB, state intake at 32 MiB, and
data/addaccepts up to 4 MiB inline; over-limit requests get a structuredresource_constraintrefusal — "Fields and tools are never silently omitted." [Source type: developer-published documentation]
should you use an agentenv rea environment today? the practical answer
Yes — if you are on 6.8.0 or later. Every stage of the rea environment chain now runs from a plain npm install, and we have run all of them: inspect, manifest, state, serve, export, and the one-step environment-build. Two things to know going in: the evidence_id values in our examples are 6.8.0-era (6.7.0 stamped different IDs on the same files — the contract recompute), and environment-serve now derives state by default, so add --replay-only where you want pure stateless replay. If you are still pinned to 6.7.0, the inspection chain works today but every environment command will refuse with COMMAND_NOT_FOUND — upgrade first, and re-read our 6.8.0 changelog Node warning before you do. If your actual goal is agent access to analysis rather than to an agentenv rea capture, the 229-tool rea mcp server is the supported path; see the wiring notes on our REA vs Ghidra MCP page. This page carries re-verification flags on every dated block precisely so stale claims cannot hide.
FAQ
- What is the agentenv rea environment, in one sentence?
- AgentEnv — sometimes searched as agentenv rea — is the rea environment feature that projects one recorded web network capture (HAR, mitmproxy, Fiddler SAZ, qlog, or a REA-recorded browser scenario) into a connectable MCP server whose tools answer only from the retained evidence — never from the live network.
- Why did the agentenv rea command
rea environment-servesay COMMAND_NOT_FOUND — and does it still? - It did on every npm release up to 6.7.0 — we reproduced the exact refusal on 2026-10-24 — because the feature was merged on main (commits Oct 21–23, 2026) but no npm release carried it. As of rea-agents 6.8.0 (npm, 2026-10-25) all four environment commands ship in the package, and we ran the full chain on 6.8.0 on 2026-10-26. If you still see COMMAND_NOT_FOUND, you are on an old pin — check your version first.
- Is connecting to a rea environment safe? Does it call the recorded site? Does it call the recorded site?
- The capture check and the served rea environment are offline by design: the evidence output itself states "Recorded URLs are never fetched," replay mode ignores writes, and per the developer-published documentation write tools are only served when the capture's later reads confirm their effect. Results are still marked untrusted content — treat everything as data, not instructions.
- How is an agentenv rea environment different from
rea mcp? rea mcpis one server with 229 fixed analysis tools as of 6.8.0 (verified withrea mcp doctoron 2026-10-26; 207 on 6.7.0). A rea environment is one server per capture, with one tool per captured HTTP route, deterministic reset-and-replay state, and answers drawn exclusively from evidence. Analysis of binaries uses the former; reproducible replay of recorded web traffic uses the latter.- Can I export an agentenv rea environment and run it elsewhere?
- That is
rea environment-export: the rea environment export produces a Docker bundle with pinned node and rea-agents versions plus a verifier, runnable via the agentenv framework'sagent-env run— the same bundle behaves identically on a laptop and a shared platform. We ran it on 6.8.0 on 2026-10-26: 7 files exported, and the one-stepenvironment-buildproduced an equivalent bundle in a single command. - Do I need new skills to read AgentEnv evidence?
- No. The agentenv rea capture and view stages emit standard REA evidence records — the same format documented on our evidence contract page — so verification tooling and reading habits carry over unchanged.
Related: REA setup guide · the REA evidence contract · the 6.5–6.7 changelog: what changed · REA vs Ghidra MCP wiring · fail-closed, explained