MCP vs Hooks in Kiro
Kiro has two extension mechanisms that are often confused: MCP and Hooks. They solve different problems and work in completely different ways.
Quick Summary
Section titled “Quick Summary”| MCP | Hooks | |
|---|---|---|
| Purpose | Connect Kiro to external data and tools | Automate actions when events happen |
| Direction | Kiro pulls data in | Kiro pushes actions out |
| Triggered by | Kiro’s AI deciding it needs information | File events, test results, git events |
| Runs | During a conversation/request | Automatically in the background |
| Example | Read a Jira ticket before writing code | Run linter automatically when you save a file |
MCP — Model Context Protocol
Section titled “MCP — Model Context Protocol”MCP gives Kiro access to external information sources. It’s about what Kiro can read and know.
When you ask Kiro to do something, it decides whether it needs more context from an external system. If you say “implement issue #42”, Kiro calls the GitHub MCP server to fetch the issue. If you say “write a query for the orders table”, Kiro calls the SQL Server MCP server to read the schema.
You: "Fix bug in issue #42" │ ▼Kiro decides: "I need to read that issue" │ ▼Kiro calls GitHub MCP → fetches issue #42 │ ▼Kiro has context → generates code fixMCP is about context — giving Kiro the information it needs.
When to use MCP
Section titled “When to use MCP”- You want Kiro to reference project management tickets (Jira, GitHub Issues, GitLab Issues)
- You want Kiro to understand your live database schema without manual pasting
- You want Kiro to read documentation from Confluence or a wiki
- You want Kiro to check cloud resource state (AWS, Azure)
Hooks — Automated Event-Triggered Actions
Section titled “Hooks — Automated Event-Triggered Actions”Hooks trigger Kiro to automatically perform actions when events occur in your workspace. They’re about what Kiro does without you asking.
You save a file │ ▼File save hook fires │ ▼Kiro automatically runs: "Fix any lint errors in the saved file" │ ▼Kiro edits the file and fixes the issuesHooks are defined in .kiro/hooks/ as YAML files — each hook specifies an event trigger and what Kiro should do.
Hooks are about automation — making Kiro act without you prompting it.
When to use Hooks
Section titled “When to use Hooks”- Auto-fix linting errors whenever you save
- Automatically update documentation when a function changes
- Run tests automatically when you modify a service file
- Generate a PR description when you open a pull request
- Update type definitions when you change an interface
Hook Configuration
Section titled “Hook Configuration”Hooks live in .kiro/hooks/ as YAML files:
name: Auto-fix lint on savetrigger: event: file_saved filePattern: "**/*.{ts,tsx,js,jsx}"action: prompt: | The file {{file}} was just saved. Run ESLint on it and fix any lint errors automatically. Do not change any logic — only fix lint issues.name: Run tests when service changestrigger: event: file_saved filePattern: "src/services/**/*.ts"action: prompt: | A service file was changed: {{file}}. Run the related tests and if any fail, fix the implementation to make them pass. Show me the test results.name: Generate PR descriptiontrigger: event: pull_request_openedaction: prompt: | A pull request was opened for this branch. Read the diff and write a clear PR description with: - What changed and why - How to test it - Any breaking changesAvailable Hook Events
Section titled “Available Hook Events”| Event | Fires when |
|---|---|
file_saved | A file is saved in the editor |
file_created | A new file is created |
file_deleted | A file is deleted |
test_failed | A test run produces failures |
pull_request_opened | A PR/MR is opened |
code_merged | Code is merged to a branch |
build_failed | A build step fails |
Using MCP and Hooks Together
Section titled “Using MCP and Hooks Together”MCP and Hooks work well in combination. A hook can trigger Kiro to run a task, and during that task Kiro uses MCP to get the context it needs:
name: Verify implementation matches tickettrigger: event: pull_request_openedaction: prompt: | A PR was opened. Check the branch name for a Jira ticket key (e.g. PROJ-123). If found, read that Jira ticket and verify that the changes in this PR address all the acceptance criteria. Report any gaps.In this example:
- Hook triggers on PR opened
- Kiro identifies the ticket key from the branch name
- Atlassian MCP fetches the Jira ticket
- Kiro compares the diff against acceptance criteria
Side-by-Side Comparison
Section titled “Side-by-Side Comparison”MCP example:
User types: "Write a SQL query to get monthly sales by region" │ └── Kiro calls SQL Server MCP, reads schema └── Kiro writes accurate query with real column namesHook example:
User saves a file (no typing required) │ └── Hook fires automatically └── Kiro runs linter and fixes issues └── File is clean before you even switch windowsSummary
Section titled “Summary”- Use MCP when Kiro needs to look something up — external data, tickets, databases, documentation
- Use Hooks when you want Kiro to do something automatically — without you having to ask — whenever a specific event happens