Skip to content

Add MCP external executor with API key auth#17

Merged
JMRussas merged 3 commits intomainfrom
feature/mcp-external-executor
Mar 5, 2026
Merged

Add MCP external executor with API key auth#17
JMRussas merged 3 commits intomainfrom
feature/mcp-external-executor

Conversation

@JMRussas
Copy link
Owner

@JMRussas JMRussas commented Mar 5, 2026

Summary

  • Add FastMCP stdio server (11 tools) for Claude Code to manage projects and execute tasks externally
  • Add API key authentication (orch_ prefix) for long-lived MCP/executor auth alongside existing JWT
  • Add external execution REST endpoints: list claimable tasks, claim (atomic CAS), submit results, release
  • Support three execution modes: auto (engine-only), hybrid (Ollama internal, Claude external), external (all external)
  • Add complete_task_external() with budget tracking, context forwarding, and knowledge extraction

Changes

New files:

  • backend/mcp/server.py — FastMCP stdio server with project lifecycle + task execution tools
  • backend/mcp/config.example.json — MCP server config template
  • backend/routes/external.py — External execution REST endpoints
  • backend/migrations/versions/014_add_api_keys_and_claim_tracking.py — API keys table + task claim columns

Modified:

  • backend/services/auth.py — API key CRUD (create, validate, list, revoke)
  • backend/middleware/auth.py — API key auth path (check orch_ 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 execution
  • backend/services/task_lifecycle.pycomplete_task_external() function
  • backend/db/connection.py + models_metadata.py — Schema for api_keys table and claim tracking
  • backend/app.py + container.py — Wire external router + DI

Test plan

  • 30 new tests across 3 files (API keys, external routes, MCP server)
  • Full suite: 731 tests passing
  • Manual: create API key via /api/auth/api-keys, configure MCP server, claim + submit task

Generated by Claude Code · Claude Opus 4.6

JMRussas and others added 3 commits March 4, 2026 23:32
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>
@JMRussas JMRussas merged commit fcd386a into main Mar 5, 2026
3 checks passed
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