feat(mcp,cli): MCP outputSchema forwarding + zeph doctor diagnostic (#2931, #2930)#3067
Merged
feat(mcp,cli): MCP outputSchema forwarding + zeph doctor diagnostic (#2931, #2930)#3067
Conversation
Add optional outputSchema forwarding from MCP tools to LLM tool declarations. When `mcp.forward_output_schema = true` (default: false), a bounded hint is appended to the tool description so the LLM can reason about structured return values. Key changes: - Add `output_schema: Option<serde_json::Value>` to McpTool, ToolDef, and ToolDefinition (serde skip_serializing_if = "Option::is_none") - Capture rmcp Tool.output_schema in both MCP registration paths - Sanitizer extended to walk output_schema with /output_schema prefix; drop-on-injection policy; cross-ref scan runs on pre-drop snapshot - New config fields: mcp.forward_output_schema (false), mcp.output_schema_hint_bytes (512) - Claude and OpenAI backends append schema hint within combined budget - tool_cache_key now hashes description + output_schema to prevent stale cache hits after server reconnect or operator toggle - Add URL-credential redaction (scheme://user:pass@host) to scrub_content Closes #2931
This was referenced Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcp.forward_output_schema = true(default:false), Zeph appends a bounded "Expected output schema" hint to each MCP tool description sent to the LLM, enabling typed tool chaining and more accurate result parsing.zeph doctor [--config <path>] [--json]subcommand runs 15 preflight checks (config, vault, LLM reachability, SQLite, Qdrant, skills, filesystem, MCP servers) and exits 0/1 based on pass/fail.scheme://user:pass@host) added toscrub_content.Changes
feat(mcp): outputSchema forwarding
output_schema: Option<serde_json::Value>added toMcpTool,ToolDef,ToolDefinitionTool.output_schemacaptured at both registration paths inclient.rs/output_schemawith drop-on-injection; cross-ref scan runs on pre-drop snapshot;output_schemas_droppedcountermcp.forward_output_schema = false,mcp.output_schema_hint_bytes = 512tool_cache_keynow hashesdescription+output_schemafeat(cli): zeph doctor
Command::Doctorvariant insrc/cli.rssrc/commands/doctor.rs: 15 async checks, plain + JSON (schema_version: 1) outputscrub_content(secrets + paths + URL creds).health_check(), feature-gatedtokio::spawn + timeout + JoinError::is_panic()fix(core): URL-credential redaction
URL_CREDS_REGEXinredact.rsstripsscheme://user:pass@hostinscrub_contentfix(clippy): pre-existing warnings
Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features "desktop,ide,server,chat,pdf,scheduler" -- -D warnings— cleancargo nextest run --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 8262 passedzeph doctor --config .local/config/testing.toml— validate output format and exit codesFollow-up issues
output_schemas_droppedaudit log event