Skip to content

Commit 5e16840

Browse files
authored
Merge pull request #223 from joreilly/dep_updates
dependency updates
2 parents 2a68a0d + 25b5dc8 commit 5e16840

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

gradle/libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ agp = "8.12.0"
99
android-compileSdk = "36"
1010
android-minSdk = "24"
1111
android-targetSdk = "36"
12-
androidx-activityCompose = "1.12.0"
12+
androidx-activityCompose = "1.12.1"
1313
androidx-datastore = "1.2.0"
14-
compose = "1.9.5"
14+
compose = "1.10.0"
1515
compose-plugin = "1.9.3"
1616
composeAdaptiveLayout = "1.2.0"
1717
harawata-appdirs = "1.5.0"
@@ -25,10 +25,10 @@ ktor = "3.3.3"
2525
treemapChart = "0.1.3"
2626
voyager= "1.1.0-beta03"
2727
molecule = "2.2.0"
28-
mcp = "0.7.7"
28+
mcp = "0.8.0"
2929
shadowPlugin = "9.2.2"
30-
jib = "3.4.5"
31-
googleAdk = "0.3.0"
30+
jib = "3.5.1"
31+
googleAdk = "0.4.0"
3232
koogAgents = "0.5.4"
3333
markdownRenderer = "0.38.1"
3434
buildkonfig = "0.17.1"

mcp-server/src/main/kotlin/McpServer.kt

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import dev.johnoreilly.climatetrace.data.ClimateTraceRepository
22
import dev.johnoreilly.climatetrace.di.initKoin
33
import io.ktor.server.cio.CIO
4-
import io.ktor.server.engine.*
5-
import io.ktor.utils.io.streams.*
6-
import io.modelcontextprotocol.kotlin.sdk.*
7-
import io.modelcontextprotocol.kotlin.sdk.server.*
4+
import io.ktor.server.engine.embeddedServer
5+
import io.ktor.utils.io.streams.asInput
6+
import io.modelcontextprotocol.kotlin.sdk.types.TextContent
7+
import io.modelcontextprotocol.kotlin.sdk.server.Server
8+
import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions
9+
import io.modelcontextprotocol.kotlin.sdk.server.StdioServerTransport
10+
import io.modelcontextprotocol.kotlin.sdk.server.mcp
11+
import io.modelcontextprotocol.kotlin.sdk.types.CallToolResult
12+
import io.modelcontextprotocol.kotlin.sdk.types.Implementation
13+
import io.modelcontextprotocol.kotlin.sdk.types.ServerCapabilities
14+
import io.modelcontextprotocol.kotlin.sdk.types.ToolSchema
815
import kotlinx.coroutines.Job
916
import kotlinx.coroutines.runBlocking
1017
import kotlinx.io.asSink
@@ -63,7 +70,7 @@ fun configureMcpServer(): Server {
6370
server.addTool(
6471
name = "get-country-asset-emissions",
6572
description = "Get sector emission information for the given countries",
66-
inputSchema = Tool.Input(
73+
inputSchema = ToolSchema(
6774
properties = buildJsonObject {
6875
putJsonObject("countryCodeList") {
6976
put("type", JsonPrimitive("array"))
@@ -75,7 +82,7 @@ fun configureMcpServer(): Server {
7582
required = listOf("countryCodeList")
7683
)
7784
) { request ->
78-
val countryCodeList = request.arguments["countryCodeList"]
85+
val countryCodeList = request.arguments?.get("countryCodeList")
7986
if (countryCodeList == null) {
8087
return@addTool CallToolResult(
8188
content = listOf(TextContent("The 'countryCodeList' parameters are required."))
@@ -96,7 +103,7 @@ fun configureMcpServer(): Server {
96103
server.addTool(
97104
name = "get-emissions",
98105
description = "Get total emission information for the given countries",
99-
inputSchema = Tool.Input(
106+
inputSchema = ToolSchema(
100107
properties = buildJsonObject {
101108
putJsonObject("countryCodeList") {
102109
put("type", JsonPrimitive("array"))
@@ -110,8 +117,8 @@ fun configureMcpServer(): Server {
110117
)
111118

112119
) { request ->
113-
val countryCodeList = request.arguments["countryCodeList"]
114-
val year = request.arguments["year"]
120+
val countryCodeList = request.arguments?.get("countryCodeList")
121+
val year = request.arguments?.get("year")
115122
if (countryCodeList == null || year == null) {
116123
return@addTool CallToolResult(
117124
content = listOf(TextContent("The 'countryCodeList' and `year` parameters are required."))
@@ -142,7 +149,7 @@ fun configureMcpServer(): Server {
142149
* a close event.
143150
*/
144151
fun `run mcp server using stdio`() {
145-
` val server = configureMcpServer()
152+
val server = configureMcpServer()
146153
val transport = StdioServerTransport(
147154
System.`in`.asInput(),
148155
System.out.asSink().buffered()
@@ -156,7 +163,7 @@ fun `run mcp server using stdio`() {
156163
}
157164
done.join()
158165
}
159-
`}
166+
}
160167

161168
/**
162169
* Launches an SSE (Server-Sent Events) MCP (Model Context Protocol) server on the specified port.

0 commit comments

Comments
 (0)