Koog
Koog is a JVM (Java and Kotlin) framework for building predictable, fault-tolerant and enterprise-ready AI agents across all platforms – from backend services to Android and iOS, JVM, and even in-browser environments. Koog is based on our AI products
What is Koog?
Koog is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to koog is a jvm (java and kotlin) framework for building predictable, fault-tolerant and enterprise-ready ai agents across all platforms – from backend services to android and ios, jvm, and even in-brow...
Koog is a JVM (Java and Kotlin) framework for building predictable, fault-tolerant and enterprise-ready AI agents across all platforms – from backend services to Android and iOS, JVM, and even in-browser environments. Koog is based on our AI products
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Koog is a JVM (Java and Kotlin) framework for building predi
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx koogConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Koog
Koog is a JetBrains-developed JVM framework for building fault-tolerant, enterprise-ready AI agents in Kotlin and Java that run across backend services, Android, iOS, and in-browser (Kotlin Multiplatform) environments. It provides a structured agent API with support for multiple LLM providers (OpenAI, Anthropic, Google, DeepSeek, OpenRouter, Ollama, AWS Bedrock), built-in MCP tool integration, vector embeddings for knowledge retrieval, and coroutine-based async execution via kotlinx.coroutines. Development teams at enterprises adopt Koog to build predictable, testable agent systems with Spring Boot or Ktor integration that can be deployed reliably in production.
Prerequisites
- JDK 17 or later
- Gradle or Maven build tool
- Kotlin 1.9+ (Kotlin Multiplatform supported)
- An LLM provider API key: OPENAI_API_KEY, ANTHROPIC_API_KEY, or equivalent for other providers
- kotlinx-coroutines 1.10.2 and kotlinx-serialization 1.8.1 (pulled in transitively by Koog)
Add the Koog dependency to your project
Add the koog-agents artifact to your Gradle or Maven build file. For JVM-only projects use koog-agents; for Kotlin Multiplatform use koog-agents-jvm or the appropriate target artifact.
// build.gradle.kts
dependencies {
implementation("ai.koog:koog-agents:0.5.0")
}
repositories {
mavenCentral()
}Set your LLM provider API key
Koog reads LLM credentials from environment variables. Set the key for your chosen provider. The framework supports OpenAI, Anthropic, Google, DeepSeek, OpenRouter, Ollama, and AWS Bedrock.
# For OpenAI:
export OPENAI_API_KEY=sk-...
# For Anthropic:
export ANTHROPIC_API_KEY=sk-ant-...
# For Google:
export GOOGLE_API_KEY=AIza...Write a basic AI agent
Create a Kotlin file that builds an AIAgent with an executor, system prompt, and LLM model. Koog's coroutine-based API makes agent execution straightforward.
import ai.koog.agents.core.agent.AIAgent
import ai.koog.agents.core.executor.simpleOpenAIExecutor
import ai.koog.agents.core.model.OpenAIModels
import kotlinx.coroutines.runBlocking
fun main() = runBlocking {
val apiKey = System.getenv("OPENAI_API_KEY")
val agent = AIAgent(
executor = simpleOpenAIExecutor(apiKey),
systemPrompt = "You are a helpful assistant.",
llmModel = OpenAIModels.Chat.GPT4o
)
val result = agent.run("Summarize the key benefits of MCP servers")
println(result)
}Add MCP tools to the agent
Koog supports integrating MCP servers as tool providers for agents. Register MCP tool sets with your agent builder to give the agent access to external MCP capabilities.
// Register MCP tools during agent construction:
val agent = AIAgent(
executor = simpleOpenAIExecutor(apiKey),
systemPrompt = "You are an assistant with tool access.",
llmModel = OpenAIModels.Chat.GPT4o,
tools = listOf(mcpToolSet) // MCP tool integration
)Integrate with Spring Boot or Ktor
For production deployments, Koog provides Spring Boot and Ktor integrations. Add the appropriate integration artifact and wire the agent into your web framework's dependency injection.
// Spring Boot integration:
dependencies {
implementation("ai.koog:koog-agents-spring:0.5.0")
}
// Ktor integration:
dependencies {
implementation("ai.koog:koog-agents-ktor:0.5.0")
}Koog Examples
Client configuration
Koog is a JVM library, not a standalone MCP server. This shows the Gradle dependency and environment setup needed to use Koog in a project that itself acts as an MCP-capable agent host.
// build.gradle.kts
plugins {
kotlin("jvm") version "1.9.25"
}
dependencies {
implementation("ai.koog:koog-agents:0.5.0")
}
repositories {
mavenCentral()
}Prompts to try
Example tasks you can implement as Koog agents for enterprise use cases.
- "Build a Koog agent that monitors a REST API and summarizes new entries every hour"
- "Create an Android AI assistant using Koog that answers questions about local calendar events"
- "Implement a multi-step research agent that searches the web and synthesizes a report"
- "Write a Spring Boot service that exposes a Koog agent as a REST endpoint for customer support"Troubleshooting Koog
Dependency resolution fails with 'Could not find ai.koog:koog-agents'
Ensure mavenCentral() is listed in your repositories block in build.gradle.kts. Run './gradlew --refresh-dependencies' to clear the Gradle cache and re-fetch. Check https://central.sonatype.com for the latest published version if 0.5.0 is unavailable.
Agent throws IllegalStateException about missing API key at runtime
Koog reads API keys from System.getenv() at agent construction time. Verify the environment variable is set in the same shell session where you run the JVM process. For IDE runs, add the variable to the Run Configuration's environment settings, not just the terminal.
Coroutine suspension errors or agent hangs indefinitely
Ensure kotlinx-coroutines version 1.10.2 is on the classpath and not being overridden by a conflicting transitive dependency. Use './gradlew dependencies' to inspect the dependency tree. Wrap agent.run() calls with a timeout using withTimeout() from kotlinx.coroutines.
Frequently Asked Questions about Koog
What is Koog?
Koog is a Model Context Protocol (MCP) server that koog is a jvm (java and kotlin) framework for building predictable, fault-tolerant and enterprise-ready ai agents across all platforms – from backend services to android and ios, jvm, and even in-browser environments. koog is based on our ai products It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Koog?
Follow the installation instructions on the Koog GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Koog?
Koog works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Koog free to use?
Yes, Koog is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Koog Alternatives — Similar Coding Agents Servers
Looking for alternatives to Koog? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Koog in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Koog?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.