Commit graph kotlin-sdk/samples
Author SHA1 Message Date
Konstantin Pavlov
d2f0893b2c
Add example Kotlin Notebook demonstrating MCP client (#397)
Add `McpClient.ipynb` example notebook demonstrating MCP client

## Motivation and Context
Provide more examples

## How Has This Been Tested?
Run Kotlin Notebook locally

## Breaking Changes
No

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [x] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-14 16:43:55 +02:00
Konstantin Pavlov
8bdbd36c32
Add backwards compatibility constructors and tests (#395)
- Updated integration tests to include assertions for `meta` being
`null` in the `listTools`, `listResources`, `readResource`, and
`callTool` results.
- Renamed test cases in `SseServerIntegrationTest` for clarity.
- Added (deprecated) synthetic constructors for various request
parameter classes.
- Enhanced naming conventions and structure in integration test cases.
- Replaced `throw Error(...)` with `error(...)` for cleaner error
handling.

## Motivation and Context
To verify backwards-compatibility after schema change

## How Has This Been Tested?
CI, integration tests, regression tests (samples)

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Test update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [ ] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-12 20:18:57 +02:00
Pavel Gorgulov
2996ce45ea
Increase deprecation levels (#393) 2025-11-12 07:15:34 +02:00
Pavel Gorgulov
21393e7ce3
New MCP Schema types (#386)
Implement the last version of the mcp schema and complete restructuring
of the mcp schema implementation from a monolithic `types.kt` file into
separate files.

- #158 
- #185 
- #353 
- #298 
- #248 

## Motivation and Context
The previous implementation of the mcp schema was outdated and contained
several issues. In addition, it stored all mcp types in a single large
file, which made maintenance and further development more difficult

## How Has This Been Tested?
All tests passed

## Breaking Changes
Yes. The new types are now located in a separate package. Additionally,
many types have new parameters and modified constructors

## Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed

## Additional context
to adopt the new structure:
**Before:**
```kotlin
  import io.modelcontextprotocol.kotlin.sdk.InitializeRequest
  import io.modelcontextprotocol.kotlin.sdk.Resource
```

**After:**
```kotlin
  import io.modelcontextprotocol.kotlin.sdk.types.InitializeRequest
  import io.modelcontextprotocol.kotlin.sdk.types.Resource
```
2025-11-11 12:25:23 +01:00
Konstantin Pavlov
91d45b0f8d
Bump version to 0.8.0-SNAPSHOT and update mcp-kotlin dependency in samples (#385)
Bump version to 0.8.0-SNAPSHOT and update `mcp-kotlin` dependency to
0.7.7 in samples

## How Has This Been Tested?
Regression

## Breaking Changes
No

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-11 10:56:45 +02:00
Konstantin Pavlov
33b5fc33df
Bump version to 0.8.0-SNAPSHOT, 0.7.6 in samples (#380)
## Motivation and Context
Prepare for the subsequent development iteration

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Dependency update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-07 18:09:27 +02:00
Konstantin Pavlov
23ce450279
Update Gradle to version 9.2.0 across all projects (#377)
Upgrade Gradle

## Motivation and Context
KTLO (🪔 To keep the lights on) 

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Build tools update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-07 17:07:20 +02:00
Konstantin Pavlov
4b88c7cb82
Bump version to 0.7.6-SNAPSHOT and update version to 0.7.5 in samples (#374) 2025-11-06 21:58:19 +02:00
Konstantin Pavlov
dc4386f0f1
Update Kotlin-MCP-Server with STDIO support, logging & CORS (#371)
Update Kotlin-MCP-Server with STDIO support, logging & CORS

### Summary
- Added support for STDIO transport mode (default behavior).
- Configured CORS and migrated SSE server to Ktor's Netty engine.
- Redirected logs to `./build/stdout.log` and updated log levels.
- New `TestEnvironment` setup for integration testing.
- Enhanced documentation with examples for server execution and MCP
Inspector usage.
- Introduced shadow JAR plugin for building runnable artifacts.

### Motivation and Context
Improves server versatility and developer experience by enabling STDIO
and refining setup.

## How Has This Been Tested?
Unit tests, tested locally (see README.md in sample)
**NB! sse plain configuration is not working at the moment**

## Breaking Changes
No

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] My code follows the repository's style guidelines
- [ ] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-06 18:18:04 +02:00
Maria Tigina
f462019c43
Add tests to server samples (#369)
Add test for sse server
TODO: Add tests for the other protocols

<!-- Provide a brief summary of your changes -->

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Tests

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-04 15:07:19 +02:00
Konstantin Pavlov
935a1eddbc
Add Ktor BOM for dependency management across all modules, run Kotlin-MCP-Server Sample (#367)
## Motivation and Context
- 📦 Unifies Ktor library versioning by introducing the Ktor BOM
dependency.
- ✅  Re-enable build of MCP Server Sample

## How Has This Been Tested?
Regression tests

## Breaking Changes
No

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Build configuration update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-04 11:44:39 +02:00
Pavel Gorgulov
458a49a5fb
Fix kotlin-mcp-server example and update samples (#345)
- updated the sdk version in all examples
- fixed `kotlin-mcp-server` example (#331)

## Motivation and Context
Removed the WASM example, as it duplicates the JVM example and only adds
unnecessary complexity

## How Has This Been Tested?
Locally

## Breaking Changes
No

## Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [x] I have added or updated documentation as needed
2025-10-31 12:21:46 +01:00
Konstantin Pavlov
2da14b0f2e
#302 Update samples build workflow (#330)
# #302 Update samples build workflow

- Introduce workflow to build samples independently from the main
project
- Keep building samples against the current snapshot version of the SDK.
Update composite build configuration.
- Temporarily disable "samples/kotlin-mcp-server": the multiplatform
project is broken. **It doesn't compile for me even on the main
branch**. Not working with [MCP
Instepcor](https://modelcontextprotocol.io/docs/tools/inspector),
because CORS is not configured. Deserves a separate PR to fix.

## Motivation and Context

Samples should be independently buildable

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Build improvement
- [x] Tests

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [ ] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-10-23 13:02:22 +03:00
Jonathan Leitschuh
dcb4f21e9a
Change sample server host from 0.0.0.0 to 127.0.0.1 (#307)
Don't bind the sample server to `0.0.0.0` by default as that exposes the
server to anyone else on the local network.

If anyone were to use these samples as staring points to build larger
services, those servers would thus expose developers to attack
immediately upon launch.

I'd prefer if we avoided that 😆

## Motivation and Context

🔒  Security

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->
I haven't checked out the code locally to verify it works. All the
editing to the code was done on GitHub.com

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

No.

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] My code follows the repository's style guidelines
- [ ] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-10-08 11:59:04 +03:00
Maria Tigina
d86813636e
Introduce server sessions (#198)
Introduce a `ServerSession` to manage multiple connections to the mcp
server. `Protocall` logic of the `Server` was moved to `ServerSession`,
while MCP resources logic remained in `Server`

## Motivation and Context
1. Fix the multiple connection issues reported for SSE transport
2. Avoid server duplications during configurations: currently every connection
creates a session, but the server stays single

## How Has This Been Tested?

Added `SseIntegrationTest` and `WebSocketIntegrationTest` integration
tests to check connection with single and multiple clients

## Breaking Changes

This change caused several depreciations:
1. The `Server` -> `Protocol` inheritance (which caused single
connection issue) should be removed in future releases, now, all the
methods inherited from `Protocall` marked as `Deprecated` with a
`Warning`
2. Websocket Ktor server initialization changes in order not to create
server instance per connection

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->

---------

Co-authored-by: devcrocod <devcrocod@gmail.com>
2025-09-29 10:10:07 +03:00
Konstantin Pavlov
cdda68577c
#196 Update build configuration and workflows for enhanced local publ… (#275)
#196 Update build configuration and workflows for enhanced local
publishing and sample builds

- Add `mavenLocal()` to repository configuration in sample projects.
- Update dependencies to distinguish between `mcp.kotlin.client` and
`mcp.kotlin.server`.
- Include `JAVA_OPTS` for optimized memory usage in GitHub workflow.
- Enhance build workflow to include local publishing and build steps for
sample projects.
- Add package-lock.json for Kotlin JS/WASM Store
- Switch to SNAPSHOT versions by default

## Motivation and Context

#196 Samples MUST be validated as part of the build

## How Has This Been Tested?

```sh
./gradlew :kotlin-sdk-core:publishToMavenLocal
./gradlew :kotlin-sdk-client:publishToMavenLocal
./gradlew :kotlin-sdk-server:publishToMavenLocal
( cd ./samples/kotlin-mcp-client && ./../../gradlew clean build )
( cd ./samples/kotlin-mcp-server && ./../../gradlew clean build )
( cd ./samples/weather-stdio-server && ./../../gradlew clean build )
```

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-09-16 21:43:50 +03:00
dependabot[bot]
1d6cb24204
Bump com.anthropic:anthropic-java from 0.8.0 to 2.6.0 (#246)
Bumps
[com.anthropic:anthropic-java](https://github.com/anthropics/anthropic-sdk-java)
from 0.8.0 to 2.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-java/releases">com.anthropic:anthropic-java's
releases</a>.</em></p>
<blockquote>
<h2>v2.6.0</h2>
<h2>2.6.0 (2025-09-02)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.5.1...v2.6.0">v2.5.1...v2.6.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>client:</strong> adds support for code-execution-2025-08-26
tool (<a
href="da4c57b12d">da4c57b</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>client:</strong> ensure correct binary content type (<a
href="197fdd5433">197fdd5</a>)</li>
<li>fix casing issue (<a
href="c2c50097e4">c2c5009</a>)</li>
<li>update singularization rules (<a
href="afec494c85">afec494</a>)</li>
</ul>
<h3>Performance Improvements</h3>
<ul>
<li><strong>internal:</strong> make formatting faster (<a
href="7c36322f9f">7c36322</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>api:</strong> remove unsupported endpoints (<a
href="d9b7be334b">d9b7be3</a>)</li>
<li><strong>ci:</strong> add build job (<a
href="061df8e702">061df8e</a>)</li>
<li><strong>ci:</strong> reduce log noise (<a
href="b91d7779f1">b91d777</a>)</li>
<li><strong>client:</strong> refactor closing / shutdown (<a
href="f0c796d723">f0c796d</a>)</li>
<li><strong>client:</strong> rename parameter (<a
href="197fdd5433">197fdd5</a>)</li>
<li><strong>internal:</strong> dynamically determine included projects
(<a
href="93db169c6c">93db169</a>)</li>
<li><strong>internal:</strong> run formatter (<a
href="06cd69ff9d">06cd69f</a>)</li>
<li><strong>internal:</strong> support passing arguments to test script
(<a
href="8528c63f15">8528c63</a>)</li>
<li><strong>internal:</strong> support running formatters directly (<a
href="e0de72e934">e0de72e</a>)</li>
<li>remove memory upper bound from publishing step (<a
href="cb2ac3b70f">cb2ac3b</a>)</li>
<li><strong>tests:</strong> setup cache creation in MessageAccumulator
test (<a
href="d5de4438df">d5de443</a>)</li>
</ul>
<h2>v2.5.1</h2>
<h2>2.5.1 (2025-08-13)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.5.0...v2.5.1">v2.5.0...v2.5.1</a></p>
<h3>Chores</h3>
<ul>
<li>deprecate older claude-3-5 sonnet models (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-java/issues/591">#591</a>)
(<a
href="c7c4cc1a08">c7c4cc1</a>)</li>
<li><strong>internal:</strong> format identity methods (<a
href="483576abc4">483576a</a>)</li>
</ul>
<h2>v2.5.0</h2>
<h2>2.5.0 (2025-08-12)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.4.0...v2.5.0">v2.4.0...v2.5.0</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-java/blob/main/CHANGELOG.md">com.anthropic:anthropic-java's
changelog</a>.</em></p>
<blockquote>
<h2>2.6.0 (2025-09-02)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.5.1...v2.6.0">v2.5.1...v2.6.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>client:</strong> adds support for code-execution-2025-08-26
tool (<a
href="da4c57b12d">da4c57b</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>client:</strong> ensure correct binary content type (<a
href="197fdd5433">197fdd5</a>)</li>
<li>fix casing issue (<a
href="c2c50097e4">c2c5009</a>)</li>
<li>update singularization rules (<a
href="afec494c85">afec494</a>)</li>
</ul>
<h3>Performance Improvements</h3>
<ul>
<li><strong>internal:</strong> make formatting faster (<a
href="7c36322f9f">7c36322</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>api:</strong> remove unsupported endpoints (<a
href="d9b7be334b">d9b7be3</a>)</li>
<li><strong>ci:</strong> add build job (<a
href="061df8e702">061df8e</a>)</li>
<li><strong>ci:</strong> reduce log noise (<a
href="b91d7779f1">b91d777</a>)</li>
<li><strong>client:</strong> refactor closing / shutdown (<a
href="f0c796d723">f0c796d</a>)</li>
<li><strong>client:</strong> rename parameter (<a
href="197fdd5433">197fdd5</a>)</li>
<li><strong>internal:</strong> dynamically determine included projects
(<a
href="93db169c6c">93db169</a>)</li>
<li><strong>internal:</strong> run formatter (<a
href="06cd69ff9d">06cd69f</a>)</li>
<li><strong>internal:</strong> support passing arguments to test script
(<a
href="8528c63f15">8528c63</a>)</li>
<li><strong>internal:</strong> support running formatters directly (<a
href="e0de72e934">e0de72e</a>)</li>
<li>remove memory upper bound from publishing step (<a
href="cb2ac3b70f">cb2ac3b</a>)</li>
<li><strong>tests:</strong> setup cache creation in MessageAccumulator
test (<a
href="d5de4438df">d5de443</a>)</li>
</ul>
<h2>2.5.1 (2025-08-13)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.5.0...v2.5.1">v2.5.0...v2.5.1</a></p>
<h3>Chores</h3>
<ul>
<li>deprecate older claude-3-5 sonnet models (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-java/issues/591">#591</a>)
(<a
href="c7c4cc1a08">c7c4cc1</a>)</li>
<li><strong>internal:</strong> format identity methods (<a
href="483576abc4">483576a</a>)</li>
</ul>
<h2>2.5.0 (2025-08-12)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.4.0...v2.5.0">v2.4.0...v2.5.0</a></p>
<h3>Features</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="42fce65f72"><code>42fce65</code></a>
release: 2.6.0</li>
<li><a
href="2b10838cc9"><code>2b10838</code></a>
feat(client): adds support for code-execution-2025-08-26 tool</li>
<li><a
href="ab1254a8ab"><code>ab1254a</code></a>
chore(internal): run formatter</li>
<li><a
href="5611d37f31"><code>5611d37</code></a>
chore(tests): setup cache creation in MessageAccumulator test</li>
<li><a
href="95918dc6c0"><code>95918dc</code></a>
codegen metadata</li>
<li><a
href="d4fffce28f"><code>d4fffce</code></a>
codegen metadata</li>
<li><a
href="f02db72ed9"><code>f02db72</code></a>
codegen metadata</li>
<li><a
href="2e258deed3"><code>2e258de</code></a>
codegen metadata</li>
<li><a
href="31c46ff041"><code>31c46ff</code></a>
fix: fix casing issue</li>
<li><a
href="6fdc91169f"><code>6fdc911</code></a>
fix: update singularization rules</li>
<li>Additional commits viewable in <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v0.8.0...v2.6.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.anthropic:anthropic-java&package-manager=gradle&previous-version=0.8.0&new-version=2.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
2025-09-12 13:20:40 +02:00
Konstantin Pavlov
7bdd6b93f6
Refactor integration tests (#256)
## Motivation and Context

Flaky integration tests

## How Has This Been Tested?

`./gradlew check`

## Changes

- Use random port for Ktor in tests
- Remove unused `TestUtils` utility class.
- Replace `runTest` with `runBlocking` in test cases.
- Adjust imports and formatting for consistency.
- Add `Awaitility` dependency for dynamic server setup.
- Update `Duration` usage from milliseconds to seconds.
- Minor configuration and code formatting updates.

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Test update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] My code follows the repository's style guidelines
- [ ] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-09-11 19:38:09 +03:00
木葉 Scarlet
b1ba0cd371
Remove dependency on CIO engine (#223)
<!-- Provide a brief summary of your changes -->
Replace the CIO dependency with only server/client core dependency.

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
In order to minimize the size of package. There are probably other
existing engines like Netty/Tomcat(server) or Java/OkHttp/Apache(client)
in the classpath. So we can reuse existing infrastructure.

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->
I have run:
- kotlin-sdk-client: jvmTest, jsTest
- kotlin-sdk-test: jvmTest, jsTest
- kotlin-sdk-server: allTests
- All `build` of samples

I have an issue about `samples/kotlin-mcp-server`.
`io.modelcontextprotocol` is not found in `commonMain`.

## Breaking Changes
<!-- Will users need to update their code or configurations? -->
Yes. They need to `implementation` CIO engine manually if they use it in
their app.

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->

closes https://github.com/modelcontextprotocol/kotlin-sdk/issues/111

---------

Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
2025-09-11 14:30:36 +03:00
Pavel Gorgulov
8698b96dd2
modularize sdk (#208)
* Modularize SDK: migrated client and server implementations to separate modules. Removed old configuration files and reorganized the source code structure

* add support native targets and update js/wasm configurations

* Refactor sample projects: add samples as composite builds, replace hardcoded dependencies with version catalog, remove obsolete gradle wrapper files

* Update .gitignore: exclude SWE agent directories (.claude/ and .junie/)

* Refine CodeQL workflow: update Kotlin build steps to target individual modules separately instead of building all at once
2025-08-04 11:53:38 +02:00
Pavel Gorgulov
41410033a8
Release 0.6.0 (#149) 2025-07-16 05:37:08 +00:00
Pavel Gorgulov
0cff2ca718
add ios and wasm targets (#81)
* add wasm and ios targets

* add yarn.lock file to gitignore

* clean up code

* fix typo in method name

* add wasm server example

* update jrelease publishing for klibs

* update gradle-publish workflow to use macos runner

* update README to reflect multiplatform support and clarify server setup for JVM and WASM

* remove the old main file from the kotlin-mcp-server example

* update api dump

* Refactor `build.gradle.kts`

* clean up imports and remove unnecessary charset specification in tests

* add JS target configuration and update API dump
2025-05-29 05:01:50 +00:00
Leonid Stashevsky
f42fcecebe
Release 0.5.0 (#90) 2025-04-30 07:49:34 +00:00
Marcos Souza
c3efd65379
fix: Add build jar configuration (#86)
Add jar config to build aplication with correct Main-Class into MANIFEST.MF
2025-04-29 12:13:19 +00:00
Pavel Gorgulov
a4d765cf94
Refactor for simplify JSON object construction for input schemas using buildJsonObject (#65) 2025-04-02 09:23:26 +00:00
Pavel Gorgulov
1c5e54936d
Refactor onCloseCallback to onClose and update related usages across the codebase (#62) 2025-03-26 14:04:28 +00:00
Leonid Stashevsky
0f3adfdd14
Release 0.4.0 (#61) 2025-03-26 11:36:43 +00:00
Pavel Gorgulov
68faa51235
Remove CompletableDeferred (#57)
Co-authored-by: Leonid Stashevsky <e5l@users.noreply.github.com>
2025-03-26 11:31:22 +00:00
Pavel Gorgulov
58f2bbab0c
add client sample (#55)
* add mcp Client example

* Add sample links for weather-stdio-server and kotlin-mcp-client to main readme
2025-03-18 17:49:04 +00:00
Pavel Gorgulov
0a6490c7f3
Add Kotlin Weather STDIO server sample (#50)
* Add Kotlin Weather STDIO server sample

* Update gradle build command in Readme to exclude tests
2025-03-11 08:16:28 +00:00
Sebastian Aigner
c57c56e18f
Change sample tool name to conform to Claude's naming conventions, do not emit any text on stdout when running in stdio mode (#48) 2025-03-07 14:28:26 +00:00
Jose Flores
164d276336
Update sample project to use library version 0.3.0 (#47)
Co-authored-by: Leonid Stashevsky <e5l@users.noreply.github.com>
2025-02-25 08:20:17 +00:00
Sergey Ignatov
d8a8f89465
0.2.0 (#27) 2024-12-22 11:58:23 +01:00
leonid.stashevsky
c9b90290df Update sample to 0.1.0 2024-12-17 20:19:11 +01:00
Leonid Stashevsky
215effb7d6
Update package name across the project (#2)
* Change package name

* Update publication

* Update docs

* Update settings.gradle.kts, README and CONTRIBUTING

* Cleanup leftovers
2024-12-17 07:28:51 +01:00
Alexander Sysoev
5d1854723b
Added Space Packages Publication (#9) 2024-12-16 14:38:53 +01:00
Leonid Stashevsky
42f560e665
Add server sample (#8)
* Change required dependencies from implementation to api

* Add kotlin mcp server sample

Fixes #6

* Add explicit nop logger to clean CLI

* Update readme with reference
2024-12-16 13:27:00 +01:00
leonid.stashevsky
7b32c3e3da Initial commit 2024-12-15 20:17:55 +01:00