I have an MCP server (using Kotlin MCP SDK) in the...
# koog-agentic-framework
j
I have an MCP server (using Kotlin MCP SDK) in the same project as my Koog agent and seeing issue after updating to Koog 0.7.1 or later that Claude can no longer work with the MCP Server. It works fine with following combination (also tried with Kotlin MCP SDK 0.10.0...still using Koog 0.6.4....and works fine with that too).
Copy code
koogAgents = "0.6.4"
mcpKotlin = "0.8.3"
this is the error Claude is reporting
Copy code
2026-03-29T14:26:35.862Z [ClimateTrace] [error] Unexpected token 'k', "kotlin-log"... is not valid JSON {
  metadata: {
    context: 'connection',
    stack: `SyntaxError: Unexpected token 'k', "kotlin-log"... is not valid JSON\n` +
asked Junie and it made following changes which look like at least provide workaround for now
Copy code
### Summary
- Resolved a persistent JSON syntax error ("Unexpected token 'k', 'kotlin-log'...") in the MCP Server that occurred after updating Koog to version 0.7.1.
- The issue was caused by the new version of `koog-agents` (via `kotlin-logging`) or other libraries writing diagnostic messages to `System.out`, which interferes with the MCP stdio protocol.

### Changes
- Implemented a fail-safe in `McpServer.kt` that redirects `System.out` to `System.err` at the start of the `main` function, while preserving the original `stdout` for the MCP transport.
a
Hey John! Thanks for reporting the bug, I'll look into it
👍 1