Hey team! sorry for the 100 questions :grin:! but ...
# koog-agentic-framework
e
Hey team! sorry for the 100 questions 😁! but im working on a Koog agent and MCP server... i added this dependencies in the commonMain:
Copy code
implementation(libs.koog.agents)
implementation(libs.mcp)
mcp = { module = "io.modelcontextprotocol:kotlin-sdk", version.ref = "mcp" }
and
koog-agents = { module = "ai.koog:koog-agents", version.ref = "koog" }
with this version:
koog = "0.3.0"
mcp = "0.6.0"
but when i tried to add the mcp tool to my agent like this:
Copy code
// Start the MCP server (e.g., as a process)
val process = ProcessBuilder("path/to/mcp/server").start()

// Create a ToolRegistry with tools from the MCP server
val toolRegistry = McpToolRegistryProvider.fromTransport(
    transport = McpToolRegistryProvider.defaultStdioTransport(process)
)

// Use the tools in an AI agent
val agent = AIAgent(
    promptExecutor = executor,
    strategy = strategy,
    agentConfig = agentConfig,
    toolRegistry = toolRegistry
)

// Run the agent
agent.run("Your task here")
my Android Studio can't find these classes
McpToolRegistryProvider
,
McpTool
and
McpToolRegistryProvider
a
Hi Eduardo! Could you please share the imports in the file where you define the agent? Also, just an assumption, but did you sync Gradle changes agter adding the dependencies?
e
Hey Anastasiia! sure let me send you that and yes i suync gradle changes
more information, i have another koog project but only Android, that works fine the import but for this project that is KMM for Android and WasmJS where i define the dependency inside of the
Copy code
commonMain.dependencies {
is not
👀 1
for kmm project, do we need another import like this:
Copy code
koog-mcp = { module = "ai.koog:koog-agents-mcp", version.ref ="koog" }
or with this one is okay:
Copy code
koog-agents = { module = "ai.koog:koog-agents", version.ref = "koog" }
p
koog-mcp is currently jvm only. Try adding it directly like this:
Copy code
koog-mcp = { module = "ai.koog:agents-mcp-jvm", version.ref = "koog" }
Also note that koog 0.3.0 is using mcp client version 0.5.0. There were breaking changes introduced in version 0.6.0, so compatibility between client and server of different versions is not guaranteed
🙌 1
thank you frog 1
🙏 1
e
cool! let me try it! thanks Pavel
so, for example the
McpToolRegistryProvider
inside the commonMain is not working?
p
Unfortunately, no( There is in jvmMain https://github.com/JetBrains/koog/blob/develop/agents/agents-mcp/src/jvmMain/kotlin/ai/koog/agents/mcp/McpToolRegistryProvider.kt But with the new version of mcp 0.6.0, we’ll be able to add this to common in the upcoming releases
e
gotcha!! thanks for this information