| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps [org.jetbrains.kotlinx:kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.10.2 to 1.11.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/Kotlin/kotlinx.coroutines/releases">org.jetbrains.kotlinx:kotlinx-coroutines-test's releases</a>.</em></p> <blockquote> <h2>1.11.0</h2> <h3>Various</h3> <ul> <li>Kotlin was updated to 2.2.20 (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4545">#4545</a>).</li> <li>Improved the published jar files (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/3842">#3842</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4599">#4599</a>).</li> <li>Various documentation improvements, including complete rewrites of structured concurrency and error handling-related KDoc (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4433">#4433</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4596">#4596</a>).</li> </ul> <h3>Breaking changes and deprecations</h3> <ul> <li>Moved <code>Promise</code>-related functions from JS and Wasm/JS to the new <code>web</code> target. On Wasm/JS, this is a breaking change. Before the change, <code>Promise</code> on Wasm/JS could work with arbitrary Kotlin types, but now, only <code>JsAny</code> subtypes are accepted (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4563">#4563</a>).</li> <li>Changed handling of coroutine exceptions that can't be propagated on JS and Wasm/JS. B efore, exceptions were logged, but now, they are reported to the JS runtime (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4451">#4451</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4631">#4631</a>).</li> <li>Deprecated using <code>CoroutineDispatcher</code> as the coroutine context key; now, <code>ContinuationInterceptor</code> has to be used instead (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4333">#4333</a>).</li> <li>Advanced the deprecation levels on <code>kotlinx-coroutines-test</code> APIs (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4604">#4604</a>).</li> <li>Added lint functions that mark passing a <code>Job</code> to coroutine builders as deprecated (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4435">#4435</a>).</li> </ul> <h3>Bug fixes and improvements</h3> <ul> <li>Added a <code>callsInPlace(EXACTLY_ONCE)</code> contract to <code>runBlocking</code> in code shared between JVM and Native (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4368">#4368</a>).</li> <li>Added a <code>callsInPlace(EXACTLY_ONCE)</code> contract to <code>suspendCancellableCoroutine</code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4574">#4574</a>).</li> <li>Fixed <code>flowOn</code> incorrectly handling <code>ThreadContextElement</code> updates (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4403">#4403</a>).</li> <li>Fixed exceptions in user-supplied <code>Thread.UncaughtExceptionHandler</code> instances causing the internal coroutines machinery to fail (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4516">#4516</a>).</li> <li>Fixed <code>CoroutineDispatcher.asScheduler</code> in the RxJava integration not cancelling outstanding work when a <code>Worker</code> gets cancelled, which led to memory leaks in some scenarios (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4615">#4615</a>).</li> <li>Fixed <code>SharedFlow</code> entering an invalid state when a subscriber and an emitter are cancelled simultaneously (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4583">#4583</a>).</li> <li>Fixed an R8 optimization leading to <code>shareIn</code>/<code>stateIn</code> coroutines getting garbage-collected (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4646">#4646</a>). Thanks, <a href="https://github.com/solevic"><code>@solevic</code></a>!</li> </ul> <h3>Small additions</h3> <ul> <li>Added <code>CompletableDeferred.asDeferred</code> for obtaining a read-only <code>Deferred</code> view (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4408">#4408</a>).</li> <li>Added <code>SharedFlow.asFlow</code> for obtaining a <code>Flow</code> view with hidden hot flow semantics (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4530">#4530</a>). Thanks, <a href="https://github.com/g000sha256"><code>@g000sha256</code></a>!</li> <li>Added a <code>StateFlow.collectLatest</code> overload returning <code>Nothing</code> to assist with finding unreachable code (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4454">#4454</a>).</li> <li>Added <code>ReceiveChannel.consumeTo</code> for consuming a <code>ReceiveChannel</code> into a <code>MutableCollection</code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4520">#4520</a>).</li> <li>Added a <code>StateFlow<T>.onSubscription</code> overload returning a <code>StateFlow<T></code>, similar to <code>SharedFlow<T>.onSubscription</code> returning <code>SharedFlow<T></code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4275">#4275</a>). Thanks, <a href="https://github.com/xit0c"><code>@xit0c</code></a>!</li> <li>Added terminal <code>Flow</code> operators for collecting a <code>Flow</code> to a <code>Map</code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/1541">#1541</a>).</li> </ul> <h3>Changelog relative to version 1.11.0</h3> <p>No changes, only the version is increased.</p> <h2>1.11.0-rc02</h2> <p>Restored binary compatibility with 1.10.2 and older versions on Wasm/JS for usages of <code>Promise</code>-related functions (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4661">#4661</a>).</p> <h2>1.11.0-rc01</h2> <h3>Various</h3> <ul> <li>Kotlin was updated to 2.2.20 (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4545">#4545</a>).</li> <li>Improved the published jar files (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/3842">#3842</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4599">#4599</a>).</li> <li>Various documentation improvements, including complete rewrites of structured concurrency and error handling-related KDoc (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4433">#4433</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4596">#4596</a>).</li> </ul> <h3>Breaking changes and deprecations</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md">org.jetbrains.kotlinx:kotlinx-coroutines-test's changelog</a>.</em></p> <blockquote> <h2>Version 1.11.0</h2> <h3>Various</h3> <ul> <li>Kotlin was updated to 2.2.20 (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4545">#4545</a>).</li> <li>Improved the published jar files (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/3842">#3842</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4599">#4599</a>).</li> <li>Various documentation improvements, including complete rewrites of structured concurrency and error handling-related KDoc (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4433">#4433</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4596">#4596</a>).</li> </ul> <h3>Breaking changes and deprecations</h3> <ul> <li>Moved <code>Promise</code>-related functions from JS and Wasm/JS to the new <code>web</code> target. On Wasm/JS, this is a breaking change. Before the change, <code>Promise</code> on Wasm/JS could work with arbitrary Kotlin types, but now, only <code>JsAny</code> subtypes are accepted (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4563">#4563</a>).</li> <li>Changed handling of coroutine exceptions that can't be propagated on JS and Wasm/JS. Before, exceptions were logged, but now, they are reported to the JS runtime (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4451">#4451</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4631">#4631</a>).</li> <li>Deprecated using <code>CoroutineDispatcher</code> as the coroutine context key; now, <code>ContinuationInterceptor</code> has to be used instead (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4333">#4333</a>).</li> <li>Advanced the deprecation levels on <code>kotlinx-coroutines-test</code> APIs (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4604">#4604</a>).</li> <li>Added lint functions that mark passing a <code>Job</code> to coroutine builders as deprecated (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4435">#4435</a>).</li> </ul> <h3>Bug fixes and improvements</h3> <ul> <li>Added a <code>callsInPlace(EXACTLY_ONCE)</code> contract to <code>runBlocking</code> in code shared between JVM and Native (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4368">#4368</a>).</li> <li>Added a <code>callsInPlace(EXACTLY_ONCE)</code> contract to <code>suspendCancellableCoroutine</code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4574">#4574</a>).</li> <li>Fixed <code>flowOn</code> incorrectly handling <code>ThreadContextElement</code> updates (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4403">#4403</a>).</li> <li>Fixed exceptions in user-supplied <code>Thread.UncaughtExceptionHandler</code> instances causing the internal coroutines machinery to fail (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4516">#4516</a>).</li> <li>Fixed <code>CoroutineDispatcher.asScheduler</code> in the RxJava integration not cancelling outstanding work when a <code>Worker</code> gets cancelled, which led to memory leaks in some scenarios (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4615">#4615</a>).</li> <li>Fixed <code>SharedFlow</code> entering an invalid state when a subscriber and an emitter are cancelled simultaneously (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4583">#4583</a>).</li> <li>Fixed an R8 optimization leading to <code>shareIn</code>/<code>stateIn</code> coroutines getting garbage-collected (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4646">#4646</a>). Thanks, <a href="https://github.com/solevic"><code>@solevic</code></a>!</li> </ul> <h3>Small additions</h3> <ul> <li>Added <code>CompletableDeferred.asDeferred</code> for obtaining a read-only <code>Deferred</code> view (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4408">#4408</a>).</li> <li>Added <code>SharedFlow.asFlow</code> for obtaining a <code>Flow</code> view with hidden hot flow semantics (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4530">#4530</a>). Thanks, <a href="https://github.com/g000sha256"><code>@g000sha256</code></a>!</li> <li>Added a <code>StateFlow.collectLatest</code> overload returning <code>Nothing</code> to assist with finding unreachable code (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4454">#4454</a>).</li> <li>Added <code>ReceiveChannel.consumeTo</code> for consuming a <code>ReceiveChannel</code> into a <code>MutableCollection</code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4520">#4520</a>).</li> <li>Added a <code>StateFlow<T>.onSubscription</code> overload returning a <code>StateFlow<T></code>, similar to <code>SharedFlow<T>.onSubscription</code> returning <code>SharedFlow<T></code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4275">#4275</a>). Thanks, <a href="https://github.com/xit0c"><code>@xit0c</code></a>!</li> <li>Added terminal <code>Flow</code> operators for collecting a <code>Flow</code> to a <code>Map</code> (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/1541">#1541</a>).</li> </ul> <h3>Changelog relative to version 1.11.0</h3> <p>No changes, only the version is increased.</p> <h2>Version 1.11.0-rc02</h2> <p>Restored binary compatibility with 1.10.2 and older versions on Wasm/JS for usages of <code>Promise</code>-related functions (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4661">#4661</a>).</p> <h2>Version 1.11.0-rc01</h2> <h3>Various</h3> <ul> <li>Kotlin was updated to 2.2.20 (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4545">#4545</a>).</li> <li>Improved the published jar files (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/3842">#3842</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4599">#4599</a>).</li> <li>Various documentation improvements, including complete rewrites of structured concurrency and error handling-related KDoc (<a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4433">#4433</a>, <a href="https://redirect.github.com/Kotlin/kotlinx.coroutines/issues/4596">#4596</a>).</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
| .. | ||
| gradle | ||
| src | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
Weather STDIO Server
A minimal MCP server that exposes weather forecast and alert tools using the National Weather Service API over STDIO transport.
Overview
This sample shows how to build a STDIO-based MCP server in Kotlin. It registers two tools that query the weather.gov API — one for weather forecasts by latitude/longitude and one for active alerts by US state. Because it uses STDIO, the server is launched as a subprocess by an MCP client or a desktop application like Claude Desktop.
Prerequisites
- JDK 17+
- Internet access (the server calls the weather.gov API at runtime)
Build & Run
Run the server (it communicates via stdin/stdout):
./gradlew run
MCP Inspector
Build the fat JAR first, then connect with the MCP Inspector:
./gradlew build
npx @modelcontextprotocol/inspector -- java -jar samples/weather-stdio-server/build/libs/weather-stdio-server-0.1.0-all.jar
Claude Desktop integration
Add the following to your Claude Desktop configuration:
{
"mcpServers": {
"weather": {
"command": "java",
"args": [
"-jar",
"/absolute/path/to/samples/weather-stdio-server/build/libs/weather-stdio-server-0.1.0-all.jar"
]
}
}
}
MCP Capabilities
Tools
| Name | Description |
|---|---|
get_alerts |
Returns active weather alerts for a two-letter US state code (e.g. CA, NY). |
get_forecast |
Returns weather forecast for a given latitude / longitude using the weather.gov API. |