About ClimateTraceKMP
ClimateTraceKMP is a Kotlin/Compose Multiplatform project for viewing climate emissions data from Climate TRACE across several app targets. It also includes an MCP server and Kotlin agents for querying emissions by country.
Key features
- 01Emissions data by country
- 02Android, iOS, desktop, and WebAssembly apps
- 03Shared Compose Multiplatform UI
- 04Kotlin Notebook example
- 05Koog and Google ADK agents
Use cases
- 01View emissions data across supported app targets
- 02Query country emissions with an AI agent
- 03Connect an MCP client to country emissions tools
MCP support
Its mcp-server module exposes per-country emissions data as MCP tools. The included Google ADK agent connects to that server as an MCP client.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEClimateTraceKMP
Kotlin/Compose Multiplatform project to show climate related emission data from https://climatetrace.org/data.
Running on
- iOS (SwiftUI + shared Compose Multiplatform UI)
- Android
- Desktop
- Web (Wasm)
- Kotlin Notebook
- MCP Server
- AI Agents (Koog + Google ADK)
The iOS client as mentioned includes shared Compose Multiplatform UI code. It also includes option to use either SwiftUI or Compose code for the Country List screen (in both cases selecting a country will navigate to shared Compose emissions details screen).
Related posts:
- Using Amper with Fleet in a Kotlin/Compose Multiplatform project
- Kotlin MCP 💜 Kotlin Multiplatform
- Initial exploration of using Koog for developing Kotlin based AI agents
- Using Google's Agent Development Kit for Java from Kotlin code
- Deploying a Kotlin-based remote MCP Server to Google Cloud Run
- Rendering AI agent generated UI using Jetpack Compose A2UI and Koog
Project structure
composeApp- shared Kotlin Multiplatform code (data layer, view models and Compose Multiplatform UI) along with desktop and web entry pointsandroidApp- Android appiosApp- iOS app (SwiftUI + shared Compose UI)mcp-server- MCP server that exposes emissions data as MCP tools (using the Kotlin MCP SDK)agents- Kotlin based AI agent built using Google's Agent Development Kit (ADK), which connects tomcp-serveras an MCP client
Uses, amongst other things, Ktor, Koin, kstore, Voyager, KoalaPlot and Koog.
Building and running
- Android: open the project in Android Studio, or run
./gradlew :androidApp:installDebug - iOS: open
iosApp/iosApp.xcodeprojin Xcode and run - Desktop:
./gradlew :composeApp:run - Web (Wasm):
./gradlew :composeApp:wasmJsBrowserDevelopmentRun - MCP server:
./gradlew :mcp-server:shadowJar(see MCP Server section below) - ADK agent Dev UI:
./gradlew :agents:startDevUI(see AI Agents section below; requires the MCP server to be running)
Android (Compose)
iOS (SwiftUI/Compose)
Compose for Desktop
Compose for Web (Wasm)
Kotlin Notebook
MCP Server
The mcp-server module uses the Kotlin MCP SDK to expose an MCP tools endpoint (returning per country emission data) that
can for example be plugged in to Claude Desktop as shown below. That module uses same KMP shared code.
To integrate the MCP server with Claude Desktop for example you need to firstly run gradle shadowJar task and then select "Edit Config" under Developer Settings and add something
like the following (update with your path)
{
"mcpServers": {
"climatetrace": {
"command": "java",
"args": [
"-jar",
"/path/to/ClimateTraceKMP/mcp-server/build/libs/serverAll.jar",
"--stdio"
]
}
}
}
AI Agents
The app includes an Agents screen, built using Koog, that allows querying emissions data using an LLM based agent.
The agents module also includes a Kotlin based agent built using Google's Agent Development Kit for Kotlin (ADK). Rather than
depending on the shared KMP code directly, it acts as an MCP client and connects to the mcp-server module (over the Streamable HTTP transport) to fetch emissions data as tools.
To run it, first start the MCP server in Streamable HTTP mode, then the ADK Dev UI (in a separate terminal):
./gradlew :mcp-server:run --args="--streamable-http-server 8080"
./gradlew :agents:startDevUI
The Dev UI is then available at http://localhost:8081. A gemini_api_key entry in local.properties (the same one used by the Koog agent) is picked up automatically; alternatively set a GEMINI_API_KEY/GOOGLE_API_KEY environment variable.
There's also a ./gradlew :agents:runAdkAgent task that runs the agent once against a fixed prompt from the console.
UI tests
There's a Maestro UI test flow shared by the Android and iOS clients, run by CI on
an emulator and a simulator (e.g. maestro test -e APP_ID=dev.johnoreilly.climatetrace maestro/ClimateTraceKMP.flow).
Full set of Kotlin Multiplatform/Compose/SwiftUI samples
- PeopleInSpace (https://github.com/joreilly/PeopleInSpace)
- GalwayBus (https://github.com/joreilly/GalwayBus)
- Confetti (https://github.com/joreilly/Confetti)
- BikeShare (https://github.com/joreilly/BikeShare)
- FantasyPremierLeague (https://github.com/joreilly/FantasyPremierLeague)
- ClimateTrace (https://github.com/joreilly/ClimateTraceKMP)
- GeminiKMP (https://github.com/joreilly/GeminiKMP)
- MortyComposeKMM (https://github.com/joreilly/MortyComposeKMM)
- StarWars (https://github.com/joreilly/StarWars)
- WordMasterKMP (https://github.com/joreilly/WordMasterKMP)
- Chip-8 (https://github.com/joreilly/chip-8)
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.