⚡️ Add MCP protocol tests & unify error handling with ToolError#118
Merged
renardeinside merged 9 commits intomainfrom Feb 22, 2026
Merged
⚡️ Add MCP protocol tests & unify error handling with ToolError#118renardeinside merged 9 commits intomainfrom
renardeinside merged 9 commits intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Shared project fixture via OnceLock + `apx init` - Server spawner using tokio::io::duplex - Tests: smoke, initialize handshake, list_tools (15), list_resources, list_resource_templates, resource reads (info/project/unknown), routes tool with structured content regression check (e29c897) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tasks 6-10: - check tool with structured content validation - get_route_info with operation discovery - Dev server lifecycle: start/stop/restart/logs - Registry tools: list and search components - Error handling: relative path, nonexistent path, unknown operation - Cross-cutting structured content object validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… module, add ValidatedAppPath
…function Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sertions - Replace subprocess apx/uv calls with apx_cli::init::run() + try_resolve_uv() - Switch from --no-addons to --addons=ui for richer test project - Remove defensive is_error bail-outs from routes/registry/structured content tests - Assert real values instead of skipping on error Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Make core OpenAPI spec types public with Serialize + Clone derives - Add missing fields (title, description, example) for lossless round-trip - Rewrite MCP openapi parsing to use typed structs instead of raw Value - Update callers (project.rs, resources.rs) to use OpenApiSpec::from_json - Import capitalize_first from core instead of duplicating Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # crates/mcp/src/tools/databricks.rs
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
ToolErrordomain enum (InvalidInput,NotConfigured,OperationFailed,IndexNotReady) that separates protocol-level errors from tool-level errorslist_registry_componentsno longer returns protocol-level error when project has no[tool.apx.ui]config — now returns tool-levelis_error=truelikesearch_registry_componentstools/openapi.rsmodule (project.rs reduced from ~970 to ~250 lines)ValidatedAppPathnewtype for compile-time safety on validated pathsrefresh_registries_if_stalemethod, eliminating ~14 lines of duplicationDebugderive totool_response!macro and all response structsTest plan
cargo build -p apx-mcp --release— clean compilecargo clippy -p apx-mcp -- -D warnings— zero warningscargo test -p apx-mcp --lib— 32 unit tests passcargo test -p apx-mcp --test mcp_protocol— 21 integration tests passtest_list_registry_componentsno longer hitsErr(e)branch🤖 Generated with Claude Code