We are upgrading to the latest koog, but we found ...
# koog-agentic-framework
r
We are upgrading to the latest koog, but we found an issue when our ToolRegistry is building. We have a custom-mcp-transport (because we standardized our tools on MCP and we can run them local or remote), but the
MCPToolRegistryProvider.fromClient
is now failing for us, because our custom transport isn't one of the 2 provided. Here's the code that throws this exception Could this be updated - so custom transports can be used? Or would that break other functionality?
v
That’s an interesting case. Do you mean that you have non-standartized transport (not HTTP, not SSE, and not STDIO)? Not sure if that’s something we expected, but if that’s what you need we can just change this part to
null
value:
Copy code
McpMetadataKeys.McpTransportType to when (mcpClient.transport) {
                        is SseClientTransport -> McpTransportType.Tcp
                        is StdioClientTransport -> McpTransportType.Stdio
                        else -> error("Unexpected null for client transport: ${mcpClient.transport}")
                    }.value,
But we have to check with folks who added this lines for OTel — that it wouldn’t break their OTel client. In the meantime, feel free to just copy-paste
McpToolRegistryProvider.fromClient
and write your own logic there (just remove that
error
esentially). It’s just ~20 lines of code.
r
Yup - that’s what we did for now
👍 1
We have a “local client” that just calls the tool in memory without us having to change our code if it’s local or remote
That’s just how we standardized internally even before we started using Koog
👌 1
v
I’ve already asked the author if that’s fine for the OpenTelemetry client if we just change to
null
. Hope he responds tomorrow — and then we can update it 🙂
r
Appreciate it
v
Ok, he came back to me. We can change to ‘null’ there. It would only cause a warning in JB opentelemetry plugin in IDE logs :) Would you like to open a PR?
r
Thanks for the follow up. Right now, I copied the code, as you suggested. If I have time, I'll open up a PR, but right now a bit of a crunch to get a large refactor out...
(refactoring all our AI logic from the last 2 years into Koog...)
🔥 1
v
Ok, no problem, I’ll open my PR :)