Embedded Rust MCP: HTTP protocol with auth provider#6
Open
deangoodmanson wants to merge 10 commits intomainfrom
Open
Embedded Rust MCP: HTTP protocol with auth provider#6deangoodmanson wants to merge 10 commits intomainfrom
deangoodmanson wants to merge 10 commits intomainfrom
Conversation
…label - Extract shared text_response() and parse_uuid() into tools/mod.rs, removing identical copies from execution, observability, visualization, and control modules. - Remove single-variant McpTransport enum, transport field, and --mcp-transport CLI arg (dead code — only HTTP is supported). Stdio rejection kept as simple env var check. - Correct "SSE" references to "Streamable HTTP" throughout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onse Pass 2: Make async-trait, jsonwebtoken, http optional behind mcp-server feature flag for smaller binaries when MCP is not needed. Pass 3: Standardize all handler dispatch to uniform run_* pattern, migrate all application-level error responses to error_response (is_error=true) for proper MCP protocol error signaling, add TODO comments for raw SQL migration and silent defaults, and document manually-maintained catalogs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add McpError thiserror enum with Result type alias (convention alignment) - Add 31 unit tests across tool modules (36 total MCP tests) - Deduplicate SQL queries in control.rs list_waiting_workflows - Add compile-time catalog count assertion in discovery.rs - Surface warnings array in estimate_workflow_cost for silent defaults - Annotate unused config field on handler with allow + doc comment - Fix mod.rs re-exports, update serve.rs to use short paths - Restore CLAUDE.md from main branch - Add RAII EnvGuard for env var cleanup in config tests - Implement graceful MCP server shutdown with 5s timeout - Fix 5 clippy warnings (collapsible_if, manual_map) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Development artifacts (user stories, implementation plans, prompt logs) belong in the internal planning repo, not the crate source directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace McpJwtAuthProvider (HS256) with McpAuthAdapter that delegates to the project's AuthenticationService (RS256). One token now works across both the REST API and MCP server. - Remove jwt_secret and auth_required from McpConfig (auth is determined by whether an AuthenticationService is passed to spawn_mcp_server) - Remove jsonwebtoken from mcp-server feature deps - Remove max_concurrent_requests and request_timeout config fields (parsed but never enforced by the SDK) - Fix "edges" terminology in visualization.rs comments (CLAUDE.md convention) - Add 15 unit tests for visualization pure functions (node_id, status_style, extract_status_map, extract_activity_name_map, build_workflow_mermaid, build_cost_mermaid) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Embedded Rust MCP server for Kruxia Flow, providing AI agents with workflow management tools via Streamable HTTP transport.
MCP Server
rust-mcp-sdkv0.8.2mcp-server(opt-in at compile time)AuthenticationService(RS256) — same token works on REST API and MCPCode Review Pass 1 Fixes (issues 1-10)
McpErrorthiserror enum withResult<T>type alias (project convention)control.rsdiscovery.rsestimate_workflow_costfor silent LLM defaultsmod.rsre-exports, updated consumers to use short pathsEnvGuardfor env var cleanup in config testsCLAUDE.mdfrom mainCode Review Pass 2 Fixes
McpJwtAuthProvider(HS256) withMcpAuthAdapterdelegating toAuthenticationService(RS256). One token works everywhere. Removedjsonwebtokenfrom MCP feature deps.max_concurrent_requests,request_timeout,jwt_secret,auth_required— parsed but never enforcedRepo Cleanup
Test plan
cargo clippy --features mcp-server— zero warningscargo check(without feature) — compiles cleancargo test --features mcp-server -p kruxiaflow -- mcp— 50/50 tests pass--mcp-enabled, verify tool responses via MCP client🤖 Generated with Claude Code