Skip to content

refactor(server): move content-parse adapter into tools#376

Merged
randomparity merged 1 commit into
mainfrom
refactor/server-move-content-parse-to-tools-332
May 29, 2026
Merged

refactor(server): move content-parse adapter into tools#376
randomparity merged 1 commit into
mainfrom
refactor/server-move-content-parse-to-tools-332

Conversation

@randomparity
Copy link
Copy Markdown
Owner

mcp/content.rs held the async wrappers over rimap_content::parse_message (parse_message_async, walk_attachment_parts_async, classify_content_error) guarded by PARSE_SEMAPHORE. It touches no JSON-RPC, catalog, audit, or wire concern and is consumed only by crate::tools::retrieval, so it belonged under tools, not the protocol layer.

This relocates it to crate::tools::content_parse (pure git mv, zero content change), narrows the module to pub(crate) since every caller is in-crate, and repoints fetch_message and download_attachment.

The shared spawn_blocking_panic_error helper stays in mcpaudit_envelope and tools::retrieval::sandbox also use it. Its now-stale "every mcp/* wrapper" doc and the moved file's bare intra-doc link to it (which would otherwise become an unresolved-link cargo doc warning after the move) are updated to the qualified path.

Verification:

  • cargo clippy -p rimap-server --all-targets --all-features clean
  • cargo doc --no-deps --document-private-items introduces no new warnings
  • 2 relocated content_parse unit tests pass

Closes #332

🤖 Generated with Claude Code

`mcp/content.rs` held async wrappers over `rimap_content::parse_message`
(`parse_message_async`, `walk_attachment_parts_async`,
`classify_content_error`) guarded by `PARSE_SEMAPHORE`. It touches no
JSON-RPC, catalog, audit, or wire concern and is consumed only by
`crate::tools::retrieval`, so it belonged under `tools`, not the
protocol layer.

Relocate it to `crate::tools::content_parse` (pure `git mv`), narrow the
module to `pub(crate)` since every caller is in-crate, and repoint
`fetch_message` and `download_attachment`. The shared
`spawn_blocking_panic_error` helper stays in `mcp` — `audit_envelope`
and `tools::retrieval::sandbox` also use it. Its now-stale "every mcp/*
wrapper" doc and the moved file's bare intra-doc link to it are updated.

Closes #332
@randomparity randomparity merged commit 16db2e4 into main May 29, 2026
12 checks passed
@randomparity randomparity deleted the refactor/server-move-content-parse-to-tools-332 branch May 29, 2026 12:57
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.

refactor(server): move content-parse adapter out of mcp/ into tools

1 participant