Build a Centralized Dynamic Prompt Library with MCP and Kiro
Learn how to implement a scalable solution for managing and distributing standardized AI prompts across your organization using Kiro, GitHub, and the Model Context Protocol (MCP).
Introduction
In this post, we demonstrate how to build a centralized prompt management system using the Model Context Protocol (MCP) that automatically distributes organizational prompts to all team members through Kiro CLI.
The Challenge
Organizations adopting AI-assisted development often encounter these problems:
- Inconsistent AI outputs due to varying prompt quality and structure across teams
- Knowledge silos where effective prompts remain isolated within individual teams
- Manual distribution of prompt updates, leading to version drift
- Onboarding challenges as new team members lack access to established prompts
Consider a typical scenario: your engineering team has developed excellent prompts for code reviews, while your product team has crafted effective user story templates. However, these valuable organizational assets remain trapped in individual workflows, unable to benefit the broader organization.
Solution Overview
The Model Context Protocol (MCP) provides an elegant solution for this challenge. Our implementation enables organizations to:
- Centralize knowledge in version-controlled GitHub repositories
- Automate distribution to all team members without configuration overhead
- Enable dynamic updates that propagate automatically across Kiro instances
- Maintain governance through standard Git workflows and permissions
- Scale effortlessly as teams and prompt libraries grow
Architecture
The solution leverages three key components:
The solution leverages three key components:
1
2
GitHub Repository → MCP Server → Kiro CLI
(Centralized Storage) (Protocol Bridge) (Zero-Config Access)
Components:
- GitHub Repository: Stores organizational prompts with team-based organization and version control
- MCP Server: Node.js application that bridges GitHub with Kiro using the MCP protocol
- Kiro Integration: Automatic prompt discovery and execution through the
/promptscommand
This architecture ensures that prompt updates flow seamlessly from your central repository to every team member's development environment.
Prerequisites
Before you begin, ensure you have the following:
- Node.js 18 or later
- Git configured with GitHub authentication
- A GitHub repository for storing prompts
- Kiro CLI installed
Implementation
Step 1: Set Up Your Prompts Repository
Create a GitHub repository with this structure:
1
2
3
4
5
6
7
8
9
10
11
your-org-prompts/
├── shared/
│ ├── meeting-notes.md
│ └── daily-checklist.md
└── teams/
├── engineering/
│ └── code-review.md
├── product/
│ └── user-story.md
└── design/
└── ui-review.md
Each prompt file uses a simple metadata format:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
**Team**: Engineering
**Purpose**: Standardized code review with org-specific guidelines
**Usage**: `/prompt engineering-code-review`
Review the code by {{developer_name}} on branch {{branch_name}}.
Focus on:
- Correctness and logic
- Security vulnerabilities
- Performance considerations
{{
Apply {{language}} best practices.
{{/if}}
Templates use Handlebars syntax —
{{variable}} for required fields, {{#if}} blocks for optional sections. Teams can build sophisticated prompts without touching any server code.Step 2: Deploy the MCP Server
The MCP server is a Node.js application. Clone the sample repo and install dependencies:
1
2
cd mcp-server
npm install
That's it. No build step, no compilation. The server handles:
- Cloning your GitHub repo on first request
- Caching prompts for 5 minutes to avoid hammering GitHub
- Auto-syncing when the cache expires
- On-demand refresh via a
refresh-promptstool - Prompt preview via a
preview-prompttool so users can inspect templates before using them
Step 3: Configure Kiro
Add the MCP server to your Kiro configuration. Create or update
.kiro/settings/mcp.json:1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"mcpServers": {
"org-prompts": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/index.js"],
"env": {
"GITHUB_OWNER": "your-github-org",
"GITHUB_REPO": "your-prompts-repo"
},
"disabled": false,
"autoApprove": ["prompts/list", "prompts/get", "refresh-prompts", "preview-prompt"]
}
}
}
Replace the path and environment variables with your actual values. You can place this at the user level (
~/.kiro/settings/mcp.json) to apply across all workspaces, or at the workspace level for project-specific setups.Restart Kiro to load the new MCP server.
Step 4: Using Prompts
Once configured, your team gets immediate access to all organizational prompts.
List available prompts:
1
/prompts list
Use a prompt:
1
@engineering-code-review developer_name="Sarah" language="Python" branch_name="feature/auth"
The prompt renders with all your organization's standards baked in. Every team member gets the same consistent process.
Preview a prompt before using it:
"preview the engineering-code-review prompt"
This shows the raw template with placeholders and the list of required arguments — handy when using a prompt for the first time.
Refresh after updates:
"refresh the organizational prompts"
This pulls the latest changes from GitHub immediately, without waiting for the 5-minute cache to expire.
How Dynamic Updates Work
The update workflow is just standard Git:
1
2
3
git add teams/engineering/code-review.md
git commit -m "feat(prompts): add accessibility check to code review"
git push origin main
Within 5 minutes, every team member has the update automatically. For immediate access, users can ask Kiro to refresh. The MCP server sends a
notifications/prompts/list_changed notification, and Kiro re-fetches the prompt list — no restart needed.Tips for Getting Started
Start small. Don't try to migrate every prompt on day one. Pick 3-5 high-value prompts — a solid code review template and a user story prompt go a long way toward demonstrating the value.
Get team leads involved early. The repo works best when teams actually contribute. If it becomes one person's side project, adoption stalls.
Use the shared directory. Cross-team prompts like meeting notes templates or daily checklists belong in
shared/ where everyone benefits.Leverage Git workflows. Branch protection, pull request reviews, and CODEOWNERS files give you governance over prompt quality without adding new tools.
Try It Out
The full implementation — MCP server code, example prompts, and detailed setup instructions — is available on GitHub:
Setup takes about 10 minutes. If your team is using AI-assisted development and struggling with prompt consistency, give this pattern a shot. It's one of those things that's simple to set up but compounds in value as more people contribute.
Additional Resources
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article