Skip to content

PRD: Add Template MCP Tools

Project: ai-plans Date: 2026-02-12 Status: draft

Context

Currently, PRD and Tasks templates are stored in templates/ folder within the ai-plans project. When working in other projects, these templates are not accessible, making it difficult to maintain consistent PRD/Tasks structure across different projects.

The AI agent needs access to templates to generate properly structured PRD and Tasks documents, but currently relies on templates being in the local project.

Goals

  • Make PRD and Tasks templates accessible from any project via MCP
  • Centralize template management in ai-plans project
  • Enable consistent document structure across all projects
  • Simplify template updates (single source of truth)

Requirements

Functional

  • Add get_prd_template MCP tool that returns PRD template content
  • Add get_tasks_template MCP tool that returns Tasks template content
  • Templates should be read from templates/ folder in ai-plans repo
  • Return templates as plain text (markdown)
  • Update steering file to document new tools

Non-functional

  • Fast response time (<100ms)
  • No parameters needed (simple getter)
  • Clear error messages if template files missing

Technical Approach

  1. Create new MCP tools:
  2. mcp-server/src/tools/get-prd-template.ts
  3. mcp-server/src/tools/get-tasks-template.ts

  4. Implementation:

    export async function getPrdTemplate(): Promise<string> {
      const templatePath = path.join(config.repoPath, 'templates/PRD.md');
      return await fs.readFile(templatePath, 'utf-8');
    }
    

  5. Register in server.ts:

  6. Add to tools list with schema
  7. Add to handler switch case
  8. No parameters needed

  9. Update steering file:

  10. Document new tools in .kiro/steering/ai-plans-workflow.md
  11. Add workflow: call get_prd_template before creating PRD

  12. Workflow example:

    User: "Create PRD for user-auth"
    AI: 
      1. Call get_prd_template() -> get template
      2. Generate content based on template
      3. Call publish_prd(project, task, content)
    

Constraints and Risks

  • Templates must exist in templates/ folder
  • If template file is missing, tool should return clear error
  • Templates are static (no variable substitution in MCP)
  • AI agent responsible for filling in template values

Open Questions

  • Should we add get_notes_template as well?
  • Should templates support variables/placeholders?
  • Should we version templates?