Skip to content

Raw-text passthrough (spec #11): verbatim text/JSON/XML/YAML + README onboarding + e2e - #15

Merged
ChHsiching merged 7 commits into
mainfrom
spec/11-raw-text-passthrough
Oct 31, 2026
Merged

ChHsiching merged 7 commits into
mainfrom
spec/11-raw-text-passthrough

Conversation

@ChHsiching

Copy link
Copy Markdown
Owner

What

Fetching a raw text document no longer fails with unsupported content type. All text/* types, JSON including +json vendor types, the XML family, the YAML family, and application/javascript now return the body verbatim, decoded to UTF-8. This is the exact case reported in #11: raw.githubusercontent.com markdown, JSON files, and friends.

HTML responses keep the extraction path byte-for-byte unchanged. Binary and other non-text types are still rejected with a clear error.

Changes

  • Decision records: CONTEXT.md Passthrough term, ADR-0006, research note (ea6aa8a)
  • Core passthrough in internal/fetch (ticket Ticket: raw-text passthrough core behavior #13): content-type classification, charset decoding via x/net/html/charset, verbatim result with URL-basename title
  • Tool description, READMEs, error comment updated (ticket Ticket: surface raw-text passthrough in tool description, READMEs, error comment #14)
  • Dedup body read and unify content-type parsing refactor from code review (71b26ec)
  • README onboarding restructure in both languages: 3-step quick start with collapsed per-client configs, Usage section showing raw-text passthrough, comparison table, FAQ, contributor guidance. Patterns researched from high-star MCP tools, note at docs/research/readme-onboarding-patterns.md (cb9aaa2)
  • E2E suite driving the built binary as a real MCP server over stdio, -tags=e2e (7bde64c)
  • Server version string bumped to v0.2.0 (21c86cb)

Closes #13. Closes #14.

Verification

  • go test ./... and go vet ./... green
  • go test -tags=e2e ./internal/mcpserver green: verbatim text/plain and JSON passthrough, iso-8859-1 decoding, HTML still extracted, image/png rejected as IsError, tool description surfaces passthrough
  • With AWF_E2E_REAL=1: live raw.githubusercontent.com/.../README.md fetch returns the markdown source verbatim

…6, research note)

Research and design for issue #11. No behavior change.
Patterns researched from high-star MCP tools (see
docs/research/readme-onboarding-patterns.md): 3-step quick start and
details-collapsed per-client configs (browser-tools-mcp, official fetch
server), comparison table and FAQ (wigolo), go install channel (fzf).
Adds Usage section showing raw-text passthrough, Troubleshooting, and
Contributing. Removes em-dash punctuation throughout; fixes stale Go
1.22 requirement (go.mod is 1.26).
go test -tags=e2e ./internal/mcpserver builds the actual
cmd/agent-web-fetch binary, runs it as a subprocess on the stdio
transport (SDK CommandTransport), and exercises it with a real MCP
client against a local httptest server: verbatim text/plain and JSON
passthrough, iso-8859-1 decoding, HTML still extracted, image/png
rejected as IsError, tool description surfaces passthrough. A
successful session also proves stdout stays clean (any stray write
would corrupt the ndjson framing).

Set AWF_E2E_REAL=1 to additionally fetch a live
raw.githubusercontent.com URL (issue #11's exact scenario); that case
needs network and is skipped by default.
@ChHsiching
ChHsiching merged commit 8d070b2 into main Oct 31, 2026
1 check passed
@ChHsiching
ChHsiching deleted the spec/11-raw-text-passthrough branch October 31, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ticket: surface raw-text passthrough in tool description, READMEs, error comment Ticket: raw-text passthrough core behavior

1 participant