Koog

v1.0.0Coding Agentsstable

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

agentframeworkagentic-aiagentsaiai-agents-framework
Share:
4,218
Stars
0
Downloads
0
Weekly
0/5

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

JVM framework for building fault-tolerant AI agents
Enterprise-ready agents across backend and mobile
JetBrains

Maintainer

LicenseApache-2.0
Languagekotlin
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx koog

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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)
1

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()
}
2

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...
3

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)
}
4

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
)
5

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.

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.

Quick Config Preview

{ "mcpServers": { "koog": { "command": "npx", "args": ["-y", "koog"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides