Skip to content

Kiro CLI Agent 2.2.1 — deserialization failure on initialize response in PhpStorm 2026.1 #3783

@asyou99

Description

@asyou99

Checks

Operating system

Linux 6.17.0-1017-oem - Ubuntu 24.04.4 LTS

Expected behaviour

The IDE should successfully connect to Kiro CLI Agent and establish a working session.

Actual behaviour

The connection is never established. The IDE's MCP client receives the initialize response but cannot deserialize it because the field names don't match any known MCP result type. The response is
dropped entirely and the server stays in "Starting" state permanently.

Steps to reproduce

Steps to reproduce

  1. Install Kiro CLI 2.2.1

  2. In PhpStorm 2026.1, go to Settings → Tools → AI Assistant → MCP Servers

  3. Add Kiro CLI as an MCP server with stdio transport:

    {
    "mcpServers": {
    "kiro": {
    "command": "kiro-cli",
    "args": ["mcp"] // or acp I also tried diffrent arguments and comnands
    }
    }
    }

  4. Observe the server stays in "Starting" state and never connects

Error from PhpStorm logs:

2026-04-29 00:02:05,176 SEVERE - io.modelcontextprotocol.kotlin.sdk.shared.ReadBuffer
Deserialization failed for line: {"jsonrpc":"2.0","result":{"protocolVersion":1,
"agentCapabilities":{...},"authMethods":[],"agentInfo":{...}},"id":"..."}

kotlinx.serialization.SerializationException:
Cannot determine RequestResult type from JSON:
[protocolVersion, agentCapabilities, authMethods, agentInfo]

at io.modelcontextprotocol.kotlin.sdk.types.RequestResultPolymorphicSerializer
.selectDeserializer(serializers.kt:339)

Analysis

Kiro CLI returns a custom response shape that doesn't match the standard MCP InitializeResult:

┌──────────────────┬───────────────────┬───────────────────────┐
│ Field │ Kiro CLI (actual) │ MCP spec (expected) │
├──────────────────┼───────────────────┼───────────────────────┤
│ capabilities │ agentCapabilities │ capabilities │
├──────────────────┼───────────────────┼───────────────────────┤
│ server info │ agentInfo │ serverInfo │
├──────────────────┼───────────────────┼───────────────────────┤
│ protocol version │ 1 (integer) │ "2025-03-26" (string) │
├──────────────────┼───────────────────┼───────────────────────┤
│ extra fields │ authMethods │ not in spec │
└──────────────────┴───────────────────┴───────────────────────┘

Kiro CLI returns:

{
"jsonrpc": "2.0",
"id": "...",
"result": {
"protocolVersion": 1,
"agentCapabilities": { ... },
"authMethods": [],
"agentInfo": {
"name": "Kiro CLI Agent",
"title": "Kiro CLI Agent",
"version": "2.1.1"
}
}
}

MCP spec expects:

{
"jsonrpc": "2.0",
"id": "...",
"result": {
"protocolVersion": "2025-03-26",
"capabilities": { ... },
"serverInfo": {
"name": "Kiro CLI Agent",
"version": "2.1.1"
}
}
}

The RequestResultPolymorphicSerializer.selectDeserializer() cannot match the field set to any known result type, so deserialization fails and the message is dropped.

Suggested fix

Align the initialize response to the MCP spec:

  • agentCapabilities → capabilities
  • agentInfo → serverInfo
  • protocolVersion: 1 → protocolVersion: "2025-03-26" (or applicable version string)
  • Move authMethods and other Kiro-specific fields into an extension namespace or remove from the initialize response

Environment

<This will be visible to anyone. Do not include personal or sensitive information>

[q-details]
version = "2.1.1"
hash = "1d2ba18834ea4e6a88312b0dc70b2014b703aa6e"
date = "2026-04-25T00:26:23.098938Z (4d ago)"
variant = "full"

[system-info]
chip = "Intel(R) Core(TM) Ultra 7 255H"
total-cores = 16
memory = "62.23 GB"

[system-info.os.linux]
kernel_version = "6.17.0-1017-oem"
id = "ubuntu"
name = "Ubuntu"
pretty_name = "Ubuntu 24.04.4 LTS"
version_id = "24.04"
version = "24.04.4 LTS (Noble Numbat)"

[environment]
cwd = "/home/USER"
cli-path = "/home/USER"
os = "Linux"
shell-path = "/usr/bin/bash"
shell-version = "5.2.21"
terminal = "Gnome Terminal"
install-method = "unknown"

[env-vars]
DISPLAY = ":1"
PATH = "/home/USER/.local/bin:/home/USER/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin"
QTERM_SESSION_ID = "fa7cb490524e4056b0a7f35470611af3"
QT_IM_MODULE = "ibus"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "2.1.1"
SHELL = "/bin/bash"
TERM = "xterm-256color"
XDG_CURRENT_DESKTOP = "ubuntu:GNOME"
XDG_SESSION_DESKTOP = "ubuntu"
XDG_SESSION_TYPE = "x11"
XMODIFIERS = "@im=ibus"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions