Koog and MCP: build Compose apps with local models

Learn to add tools and conversational UI to a Koog app, connect an MCP server, and use local models on JVM and Android with Koog 1.0.

Player not loading? Watch on YouTube

John O'Reilly builds a climate emissions application with Koog and Compose Multiplatform. The tutorial starts with Gemini 2.5 Flash, then adds a Ktor client and an emissions tool to supply data from Climate Trace. He explains how the model requests a tool call while the agent executes it and returns the result.

A custom strategy turns the single-turn example into a conversation. Kotlin channels connect user replies to the suspended agent loop, and a population tool enables per-capita comparisons. The shared UI targets iOS, Android and JVM. Platform-specific configuration uses Kotlin's expect/actual mechanism, including a Langfuse telemetry integration.

The desktop demonstration switches to a local LLM through Ollama. O'Reilly reports roughly 20 GB of memory use for the selected model, with a slower first request and faster subsequent queries. He also builds a Kotlin MCP SDK server over standard IO, packages it as an executable JAR, tests it with MCP Inspector and connects it to Claude Desktop.

The final example uses Koog 1.0 and LiteRT to run an on-device Gemma model on Android. O'Reilly reports initial requests taking about 15 to 20 seconds and notes limitations in tool-response parsing and handling multiple tools. At the time of the talk, he describes iOS integration as forthcoming. Local inference still uses tools that fetch remote data.