Lesson 5
MCP Servers: Using
What MCP Is
Model Context Protocol (MCP) is an open protocol that lets Kiro communicate with external servers to gain new capabilities. If built-in tools are what Kiro can do natively (read files, run commands, search), MCP servers extend that with anything else - databases, APIs, documentation, cloud services, third-party tools.
An MCP server is just a program that exposes capabilities over a standard interface. Kiro connects to it, discovers what it offers, and can then use those capabilities as tools during your session.
What MCP Servers Can Expose
An MCP server can provide three types of capabilities:
| Capability | What it is | Who decides when to use it |
|---|---|---|
| Tools | Actions the model can invoke (query a DB, call an API, search docs) | The model decides (like built-in tools) |
| Prompts | Pre-written prompt templates the server offers | You invoke them explicitly |
| Resources | Data the server makes available (file contents, API responses, schemas) | The application/model reads them as context |
Most MCP servers you'll use primarily expose tools. Prompts and resources are less common but useful for specific integrations.
Where MCP Config Lives
MCP servers are configured via JSON files:
| Scope | Location | Applies to |
|---|---|---|
| Workspace | .kiro/settings/mcp.json | This workspace only |
| User (global) | ~/.kiro/settings/mcp.json | All workspaces |
If the same server is defined in both, workspace config wins (same precedence as steering). In multi-root workspaces, each folder can have its own .kiro/settings/mcp.json.
The Configuration Format
Here's the complete structure:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-token-here"
},
"disabled": false
}
}
}
Each server entry has:
| Field | Required | What it does |
|---|---|---|
command | Yes (for stdio) | The command to launch the server process |
args | No | Arguments passed to the command |
env | No | Environment variables set for the server process (API keys, config) |
disabled | No | Set to true to disable without removing the config |
Two Transport Types
MCP servers connect to Kiro via one of two transports:
1. stdio (local process)
The server runs as a local subprocess on your machine. Kiro launches it, communicates over stdin/stdout. This is the most common type.
{
"mcpServers": {
"aws-docs": {
"command": "uvx",
"args": ["awslabs.aws-documentation-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}
The command is typically npx (for Node-based servers - most natural if you're in a JavaScript/TypeScript environment), uvx (for Python-based servers), or docker/podman (for containerised servers).
2. Streamable HTTP (remote server)
The server runs somewhere else (cloud, shared infrastructure) and Kiro connects over HTTPS. No local process needed.
{
"mcpServers": {
"my-remote-server": {
"url": "https://mcp.internal.example.com/mcp",
"headers": {
"Authorization": "Bearer your-token-here"
}
}
}
}
Remote servers use url instead of command, and headers for authentication.
Context Cost of MCP Servers
This is important: every MCP server you connect loads its tool definitions (names, descriptions, parameter schemas) into the context window at startup. Five servers might collectively add 100+ tool definitions consuming 50,000+ tokens - potentially 40% of your context window - before you even type a prompt.
This is why you should:
- Only enable servers you're actively using
- Use
"disabled": trueto turn off servers you're not using right now - Consider Powers (Lesson 7) which solve this by loading MCP servers on-demand
How to Add an MCP Server
Three methods:
- Edit
mcp.jsondirectly - create/edit.kiro/settings/mcp.jsonin your workspace - Use the MCP Servers panel - click the "+" in the MCP Servers section of the Kiro sidebar (the ghost icon tab)
- Ask Kiro - "add the AWS documentation MCP server" and Kiro will configure it for you
After adding or changing config, servers reconnect automatically - no restart needed.
Common MCP Servers
| Server | What it does | Command |
|---|---|---|
| GitHub | Interact with repos, PRs, issues | npx @modelcontextprotocol/server-github |
| Atlassian (Jira + Confluence) | Search/create issues, read Confluence pages | npx @aashari/mcp-server-atlassian-jira |
| Slack | Read messages, post replies, search history | npx @anthropic/slack-mcp-server |
| SonarQube | Access code quality metrics and issues | npx sonarqube-mcp-server |
| PostgreSQL | Query and manage PostgreSQL databases | npx @modelcontextprotocol/server-postgres |
| Memory | Persistent key-value memory across sessions | npx @modelcontextprotocol/server-memory |
| AWS Docs | Search and read AWS documentation | uvx awslabs.aws-documentation-mcp-server@latest |
| Filesystem | Read/write files in specified directories | npx @modelcontextprotocol/server-filesystem |
Most use npx (Node-based) or uvx (Python-based) to download and run the server on first use - no separate installation step. There's also a combined Atlassian server (uvx mcp-atlassian) that covers both Jira and Confluence together if you use both.
What uvx Is
You'll see uvx as the command for many MCP servers. It's part of uv, a Python package manager. It downloads and runs a Python package without installing it globally - similar to npx for Node.
If you don't have it installed, install uv via Homebrew:
brew install uv
Once installed, uvx handles downloading and running MCP server packages automatically.
Elicitation: When Servers Ask You Questions
Some MCP servers support elicitation - they can request additional input from you during tool execution. For example, a database server might ask "Which table do you want to query?" before proceeding.
When this happens, Kiro surfaces the question to you in the chat. You respond, and the answer is passed back to the server. It's a back-and-forth conversation between you and the MCP server, mediated by Kiro.
Viewing Connected Servers
To see what's currently connected:
- Open the Kiro sidebar (ghost icon) and look for "MCP Servers"
- Each connected server shows its status and the tools it exposes
- You can reconnect or disable servers from this panel
How MCP Relates to What You Already Know
- Tools (from Lesson 3): MCP tools work identically to built-in tools from the agent's perspective. Hooks can gate them with
@mcpmatchers. - Context (from Lesson 2): MCP tool definitions consume context tokens. More servers = less room for everything else.
- Powers (Lesson 7): Powers solve the context-bloat problem by only loading MCP servers when relevant keywords are mentioned.
Your Tangible Win
You can now configure MCP servers (both local and remote), understand the context cost they impose, know how to manage them efficiently, and understand how they integrate with hooks and the broader Kiro system. You know where the config lives, what the JSON schema looks like, and how to add/disable/reconnect servers.