Add MCP external executor with API key auth#17
Merged
Conversation
Enable Claude Code to interact with the orchestration engine via MCP (Model Context Protocol). External executors can claim, execute, and submit task results through REST endpoints with atomic CAS-based claiming. New features: - FastMCP stdio server with 11 tools for project/task management - API key auth (orch_ prefix) alongside existing JWT auth - External execution routes: claimable list, claim, submit, release - Three execution modes: auto, hybrid, external - complete_task_external with cost tracking and knowledge extraction - Migration 014: api_keys table + claimed_by/claimed_at on tasks 30 new tests (731 total), all passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
orch_prefix) for long-lived MCP/executor auth alongside existing JWTauto(engine-only),hybrid(Ollama internal, Claude external),external(all external)complete_task_external()with budget tracking, context forwarding, and knowledge extractionChanges
New files:
backend/mcp/server.py— FastMCP stdio server with project lifecycle + task execution toolsbackend/mcp/config.example.json— MCP server config templatebackend/routes/external.py— External execution REST endpointsbackend/migrations/versions/014_add_api_keys_and_claim_tracking.py— API keys table + task claim columnsModified:
backend/services/auth.py— API key CRUD (create, validate, list, revoke)backend/middleware/auth.py— API key auth path (checkorch_prefix before JWT decode)backend/routes/auth.py— API key management endpoints (create, list, revoke)backend/models/schemas.py— 6 new Pydantic schemas for API keys and external executionbackend/services/task_lifecycle.py—complete_task_external()functionbackend/db/connection.py+models_metadata.py— Schema for api_keys table and claim trackingbackend/app.py+container.py— Wire external router + DITest plan
/api/auth/api-keys, configure MCP server, claim + submit taskGenerated by Claude Code · Claude Opus 4.6