# Feature Plan: MCP Server for Tasks + Wiki/Knowledgebase ## Goal Create an MCP server that allows agents to: - read/write task context, - create/update knowledgebase/wiki artifacts during task execution, - retrieve coding guidelines/project layout for continuity between runs. ## Why This Fits GIA - Tasks, approvals, and command-driven automation already exist. - This provides durable agent memory and operator visibility of "what changed, why, and how to use it". ## Scope - MCP server with authenticated tools for: - `tasks.list`, `tasks.get`, `tasks.search`, `tasks.events` - `tasks.create_note`, `tasks.link_artifact` - `wiki.create_article`, `wiki.update_article`, `wiki.list`, `wiki.get` - `project.get_layout`, `project.get_guidelines`, `project.get_runbook` - Permission model tied to user and chat/project scope. - Audit log for all MCP tool calls. ## Proposed Data Additions - `KnowledgeArticle` (title, slug, markdown, tags, status, owner, related_task). - `KnowledgeRevision` (article, revision, author/tool, diff, created_at). - Optional `TaskArtifactLink` (task, kind, uri/path, summary). ## Implementation 1. Build MCP server process (Python) with JSON-RPC transport and token auth. 2. Implement task read tools against existing task models/views. 3. Implement wiki CRUD tools with revision history. 4. Implement project context tools that read: - `AGENTS.md`, - coding standards docs, - key architecture docs. 5. Add agent-run convention: - on task start: fetch task + related wiki + guidelines, - during run: append execution notes, - on completion: publish "what was done / how to use" article and link to task. 6. Add web UI page for knowledge articles and task-linked docs. 7. Add approvals for destructive knowledge actions (delete/overwrite). ## Acceptance Criteria - Agent can fetch full task context in one MCP call sequence. - Agent can publish/update wiki pages tied to tasks. - Operators can open a task and see linked implementation notes + usage docs. - MCP actions are fully auditable and scoped by user permissions. ## Security and Guardrails - Tool-level RBAC and per-user scoping. - Redact secrets from returned context. - Rate limits and request signing for external agent clients. ## Rollout 1. Read-only task tools. 2. Wiki write tools with revisioning. 3. Task artifact linking + UI surfaces. 4. Agent workflow templates and docs. ## Out of Scope - Autonomous code execution from MCP itself.