Skip to content

Commit 127a255

Browse files
author
Suresh Sivasankaran
committed
Add changeset
1 parent a5799c4 commit 127a255

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.changeset/good-pigs-beam.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
"@kilocode/cli": minor
3+
---
4+
5+
This PR improves the display of MCP tool requests and responses in the CLI, addressing issues with truncated payloads, poor formatting, and lack of metadata.
6+
7+
- MCP request arguments were difficult to read (no formatting, no preview mode)
8+
- MCP response payloads were displayed as raw text dumps, overwhelming the terminal
9+
- No JSON detection or pretty-printing
10+
- No metadata about content size or type
11+
- Missing error handling for malformed data
12+
- No indication when content is truncated/previewed
13+
14+
Created new `SayMcpServerResponseMessage` component for MCP responses and refactored `AskUseMcpServerMessage` to share formatting logic. Both will make use of newly added utility functions for JSON detection, formatting, and metadata display.
15+
`formatContentWithMetadata()` - Detects JSON, formats it, handles preview logic (>20 lines → show 5)
16+
`formatJson()` - Pretty-prints JSON with configurable indentation
17+
`calculateByteSize()` - Chunked processing for large strings (>10KB) to avoid memory spikes
18+
`formatByteSize()`, `buildMetadataString()` - Display helpers
19+
20+
| before | after |
21+
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
22+
| <img width="1511" height="890" alt="before" src="https://github.com/user-attachments/assets/9b57d85c-1846-42d5-ba7b-2511a96e77b2" /> | <img width="1510" height="884" alt="after" src="https://github.com/user-attachments/assets/1a7599ce-4112-40d0-ac47-678d626cb51c" /> |
23+
24+
Run the KiloCode CLI and let it automatically use any configured MCP server.

0 commit comments

Comments
 (0)