MCP Execution Model
MCP Execution Model
หัวข้อที่มีชื่อว่า “MCP Execution Model”Runtime Topology
หัวข้อที่มีชื่อว่า “Runtime Topology”flowchart LR UI[Browser] --> BFF[kobi-ai /api/ai/*] BFF --> ENG[kobi-agent-service] ENG --> TE[tool_executor node] TE --> MCP[kobi-mcp-server] MCP --> DB[(Supabase)]
Active Tool Families
หัวข้อที่มีชื่อว่า “Active Tool Families”Current MCP registry includes these families:
- Shared:
search_perplexity - Idea:
create_chunk,create_idea,create_research,create_solution,propose_crystallization,reject_with_feedback,propose_deep_research - Strategy:
strategy_item,clear_framework - Maps:
map_location,save_location,heat_zone,air_quality
Interaction tools like confirm, ask_opinion, and select_option are not registered in current MCP code.
Execution Contract
หัวข้อที่มีชื่อว่า “Execution Contract”Engine tool executor injects context fields into MCP calls:
approved: trueuserIdthreadIdprojectIdagentType
For mutation tools, MCP normalizes/derives:
actionIdidempotencyKey
Validation Stack Inside MCP
หัวข้อที่มีชื่อว่า “Validation Stack Inside MCP”authenticateRequest: requiresuserId, checks thread ownership whenthreadIdis present.validateToolAccess: enforces agent scope and idea-phase gating (when applicable).enforceMutationContext: for mutating tools, requiresapproved=trueplus scope IDs and idempotency.
HITL Clarification
หัวข้อที่มีชื่อว่า “HITL Clarification”- Approval interrupt lifecycle is owned by engine (
interrupt+/resume). - MCP tools are execution handlers and do not emit approval-card protocol fields.
- Browser approval decisions are sent via BFF
/api/ai/resumeand normalized to engine resume payload.
Known Caveats in Current Code
หัวข้อที่มีชื่อว่า “Known Caveats in Current Code”propose_deep_researchis registered, but currently not included inGATED_TOOLSandMUTATING_TOOLSsets in MCP tool registry.- Engine workflow YAML still lists some non-registered tool names; runtime ultimately depends on MCP
list_toolsconversion.
Operational Expectations
หัวข้อที่มีชื่อว่า “Operational Expectations”- Tool calls should be deterministic under retries due to idempotency handling.
- Any missing scope fields on mutating tools should fail fast with validation errors.
- Engine should log tool execution context (
userId,threadId,projectId) for traceability.