Skip to content

feat(post1-T-4.1): MCP protocol_version 2 — natural JSON value encoding (0.7.x)#40

Merged
escapeboy merged 2 commits into0.7.xfrom
post1/T-4.1-protocol-v2
Apr 29, 2026
Merged

feat(post1-T-4.1): MCP protocol_version 2 — natural JSON value encoding (0.7.x)#40
escapeboy merged 2 commits into0.7.xfrom
post1/T-4.1-protocol-v2

Conversation

@escapeboy
Copy link
Copy Markdown
Owner

Summary

Breaking change for the 0.7.x branch — bumps TOOL_RESPONSE_PROTOCOL_VERSION from 1 to 2.

  • Option::Nonenull (was {"option": "None"})
  • Option::Some(v)v unwrapped (was {"option": "Some", "value": v})
  • Result::Ok(v){"ok": v} (was {"result": "Ok", "value": v})
  • Result::Err(v){"err": v} (was {"result": "Err", "value": v})
  • Records → named-field objects {"field1": v1, "field2": v2} using the module type table (was positional {"type":"record","type_id":N,"fields":[...]})
  • Enum variants{"VariantName": payload} for tagged, "VariantName" for unit (was {"type":"enum","type_id":N,"variant":"Name","payload":...})

Fallback for missing type info: records fall back to positional arrays; enums fall back to the v1 shape.

Why 0.7.x only

This is a breaking wire-format change that cannot go on the 1.x LTS master branch. 0.7.x is the designated channel for LTS-incompatible improvements.

Files

  • crates/boruna-mcp/src/tools/run.rs — new format_value_v2(value, module), updated format_value_capped to accept &Module
  • crates/boruna-mcp/src/tools/mod.rs — version constant 1 → 2, lock test updated
  • docs/reference/mcp-server.md — updated Stability section + value encoding table
  • CHANGELOG.md — unreleased entry

Test plan

  • cargo test --workspace passes (all crates, locally verified)
  • cargo clippy --workspace -- -D warnings clean
  • cargo fmt --all -- --check clean

🤖 Generated with Claude Code

escapeboy and others added 2 commits April 29, 2026 16:46
…ng (0.7.x)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@escapeboy escapeboy merged commit de53494 into 0.7.x Apr 29, 2026
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.

1 participant