← Back to Index

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:

CapabilityWhat it isWho decides when to use it
ToolsActions the model can invoke (query a DB, call an API, search docs)The model decides (like built-in tools)
PromptsPre-written prompt templates the server offersYou invoke them explicitly
ResourcesData 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:

ScopeLocationApplies to
Workspace.kiro/settings/mcp.jsonThis workspace only
User (global)~/.kiro/settings/mcp.jsonAll 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:

FieldRequiredWhat it does
commandYes (for stdio)The command to launch the server process
argsNoArguments passed to the command
envNoEnvironment variables set for the server process (API keys, config)
disabledNoSet 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.

Security note: stdio servers run locally with your full privileges - same access as Kiro itself (files, env vars, credentials). Only install MCP servers from sources you trust. Remote servers are sandboxed by the network boundary, but still receive whatever data you send them.

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:

Ad

How to Add an MCP Server

Three methods:

  1. Edit mcp.json directly - create/edit .kiro/settings/mcp.json in your workspace
  2. Use the MCP Servers panel - click the "+" in the MCP Servers section of the Kiro sidebar (the ghost icon tab)
  3. 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

ServerWhat it doesCommand
GitHubInteract with repos, PRs, issuesnpx @modelcontextprotocol/server-github
Atlassian (Jira + Confluence)Search/create issues, read Confluence pagesnpx @aashari/mcp-server-atlassian-jira
SlackRead messages, post replies, search historynpx @anthropic/slack-mcp-server
SonarQubeAccess code quality metrics and issuesnpx sonarqube-mcp-server
PostgreSQLQuery and manage PostgreSQL databasesnpx @modelcontextprotocol/server-postgres
MemoryPersistent key-value memory across sessionsnpx @modelcontextprotocol/server-memory
AWS DocsSearch and read AWS documentationuvx awslabs.aws-documentation-mcp-server@latest
FilesystemRead/write files in specified directoriesnpx @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:

How MCP Relates to What You Already Know

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.

Quiz

You have 5 MCP servers configured but only use 2 daily. What's the most efficient approach?

Leave all 5 enabled - the unused ones don't cost anything
Set "disabled": true on the 3 you're not using - their tool definitions won't consume context tokens
Delete the configs for unused servers and re-add them when needed

A workspace mcp.json and your user-level mcp.json both define a server called "github". Which one does Kiro use?

The workspace config - more specific scope wins
The user-level config - global always takes precedence
Both - they merge together

What's the main difference between a stdio and streamable HTTP MCP server?

stdio is faster, HTTP is more reliable
stdio runs as a local process on your machine; HTTP connects to a remote server over the network
stdio only works on Linux; HTTP works everywhere