kotlin-sdk/samples/kotlin-mcp-client
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dependabot[bot] 2f91865f3d
chore(deps): bump com.anthropic:anthropic-java from 2.59.0 to 2.60.0 in /samples/kotlin-mcp-client in the other-dependencies group across 1 directory (#980)
Bumps the other-dependencies group with 1 update in the
/samples/kotlin-mcp-client directory:
[com.anthropic:anthropic-java](https://github.com/anthropics/anthropic-sdk-java).

Updates `com.anthropic:anthropic-java` from 2.59.0 to 2.60.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.60.0</h2>
<h2>2.60.0 (2026-09-01)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.59.0...v2.60.0">v2.59.0...v2.60.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add external_user_onboarded_at to user
profiles (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>api:</strong> add support for claude-fable-5-1 and
claude-mythos-5-1 (<a
href="f41a324564">f41a324</a>)</li>
<li><strong>api:</strong> add support for organization compliance
settings in the Admin API (<a
href="4b64a841b6">4b64a84</a>)</li>
<li><strong>api:</strong> support pagination on organization rate limit
list endpoints (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>user_profiles:</strong> sort the user profile list by name
with order_by=name (<a
href="931543ef60">931543e</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>api:</strong> mark the beta header required on Admin API
Tunnel operations (<a
href="898dabf8ac">898dabf</a>)</li>
<li><strong>api:</strong> remove unsupported allowed_callers from the
toolset entries (<a
href="53bd597bcd">53bd597</a>)</li>
<li><strong>client:</strong> include non-JSON error response bodies in
API errors (<a
href="04045b50ac">04045b5</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>api:</strong> remove unreleased thinking
prefix_mismatched_behavior param (<a
href="e01193ad4e">e01193a</a>)</li>
<li><strong>api:</strong> remove user profile relationship in favor of
access_type (<a
href="e01193ad4e">e01193a</a>)</li>
<li><strong>ci:</strong> keep the Maven artifact upload steps under stlc
(<a
href="7437d73702">7437d73</a>)</li>
<li><strong>docs:</strong> clarify disallowed characters in memory paths
(<a
href="20582c1f6e">20582c1</a>)</li>
<li><strong>internal:</strong> add browser-stubbed internal/node module
and lint rule for Node built-in imports (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>internal:</strong> pin JAVA_HOME for detekt-rules tests and
relax UnusedPrivateProperty for tests/examples (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>internal:</strong> read the request id shown in Terraform
error diagnostics from the response header (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>internal:</strong> remove discriminator support from
PropertyInfo (<a
href="4b64a841b6">4b64a84</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>api:</strong> backtick identifiers in managed-agents API
descriptions (<a
href="db40558f3b">db40558</a>)</li>
<li><strong>api:</strong> describe external_key_id and compartment_id
behavior on Claude Platform on AWS (<a
href="5eefbe1b52">5eefbe1</a>)</li>
<li><strong>changelog:</strong> detail the beta files/skills GA-shape
change (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-java/issues/398">#398</a>)
(<a
href="010593670e">0105936</a>)</li>
</ul>
</blockquote>
</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.60.0 (2026-09-01)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.59.0...v2.60.0">v2.59.0...v2.60.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add external_user_onboarded_at to user
profiles (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>api:</strong> add support for claude-fable-5-1 and
claude-mythos-5-1 (<a
href="f41a324564">f41a324</a>)</li>
<li><strong>api:</strong> add support for organization compliance
settings in the Admin API (<a
href="4b64a841b6">4b64a84</a>)</li>
<li><strong>api:</strong> support pagination on organization rate limit
list endpoints (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>user_profiles:</strong> sort the user profile list by name
with order_by=name (<a
href="931543ef60">931543e</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>api:</strong> mark the beta header required on Admin API
Tunnel operations (<a
href="898dabf8ac">898dabf</a>)</li>
<li><strong>api:</strong> remove unsupported allowed_callers from the
toolset entries (<a
href="53bd597bcd">53bd597</a>)</li>
<li><strong>client:</strong> include non-JSON error response bodies in
API errors (<a
href="04045b50ac">04045b5</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>api:</strong> remove unreleased thinking
prefix_mismatched_behavior param (<a
href="e01193ad4e">e01193a</a>)</li>
<li><strong>api:</strong> remove user profile relationship in favor of
access_type (<a
href="e01193ad4e">e01193a</a>)</li>
<li><strong>ci:</strong> keep the Maven artifact upload steps under stlc
(<a
href="7437d73702">7437d73</a>)</li>
<li><strong>docs:</strong> clarify disallowed characters in memory paths
(<a
href="20582c1f6e">20582c1</a>)</li>
<li><strong>internal:</strong> add browser-stubbed internal/node module
and lint rule for Node built-in imports (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>internal:</strong> pin JAVA_HOME for detekt-rules tests and
relax UnusedPrivateProperty for tests/examples (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>internal:</strong> read the request id shown in Terraform
error diagnostics from the response header (<a
href="2aa81c05e5">2aa81c0</a>)</li>
<li><strong>internal:</strong> remove discriminator support from
PropertyInfo (<a
href="4b64a841b6">4b64a84</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>api:</strong> backtick identifiers in managed-agents API
descriptions (<a
href="db40558f3b">db40558</a>)</li>
<li><strong>api:</strong> describe external_key_id and compartment_id
behavior on Claude Platform on AWS (<a
href="5eefbe1b52">5eefbe1</a>)</li>
<li><strong>changelog:</strong> detail the beta files/skills GA-shape
change (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-java/issues/398">#398</a>)
(<a
href="010593670e">0105936</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1dfef96487"><code>1dfef96</code></a>
Merge pull request <a
href="https://redirect.github.com/anthropics/anthropic-sdk-java/issues/397">#397</a>
from anthropics/release-please--branches--main--chang...</li>
<li><a
href="110af9e0eb"><code>110af9e</code></a>
release: 2.60.0</li>
<li><a
href="f41a324564"><code>f41a324</code></a>
feat(api): add support for claude-fable-5-1 and claude-mythos-5-1</li>
<li><a
href="04045b50ac"><code>04045b5</code></a>
fix(client): include non-JSON error response bodies in API errors</li>
<li><a
href="5eefbe1b52"><code>5eefbe1</code></a>
docs(api): describe external_key_id and compartment_id behavior on
Claude Pla...</li>
<li><a
href="841463e335"><code>841463e</code></a>
Merge branch 'main' into next</li>
<li><a
href="010593670e"><code>0105936</code></a>
docs(changelog): detail the beta files/skills GA-shape change (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-java/issues/398">#398</a>)</li>
<li><a
href="53bd597bcd"><code>53bd597</code></a>
fix(api): remove unsupported allowed_callers from the toolset
entries</li>
<li><a
href="20582c1f6e"><code>20582c1</code></a>
chore(docs): clarify disallowed characters in memory paths</li>
<li><a
href="db40558f3b"><code>db40558</code></a>
docs(api): backtick identifiers in managed-agents API descriptions</li>
<li>Additional commits viewable in <a
href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.59.0...v2.60.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=2.59.0&new-version=2.60.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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 13:57:00 +02:00
..
gradle chore(deps): bump com.anthropic:anthropic-java from 2.59.0 to 2.60.0 in /samples/kotlin-mcp-client in the other-dependencies group across 1 directory (#980) 2026-09-08 13:57:00 +02:00
src/main docs: update client and server samples (#598) 2026-03-13 10:23:51 +01:00
build.gradle.kts Add Ktor BOM for dependency management across all modules, run Kotlin-MCP-Server Sample (#367) 2025-11-04 11:44:39 +02:00
gradle.properties #302 Update samples build workflow (#330) 2025-10-23 13:02:22 +03:00
gradlew chore(deps): bump the other-dependencies group across 5 directories with 3 updates (#854) 2026-06-24 15:31:46 +02:00
gradlew.bat chore(deps): bump the other-dependencies group across 5 directories with 3 updates (#854) 2026-06-24 15:31:46 +02:00
README.md docs: streamable server sample (#595) 2026-03-10 12:45:21 +01:00
settings.gradle.kts #302 Update samples build workflow (#330) 2025-10-23 13:02:22 +03:00

Kotlin MCP Client

An interactive CLI client that connects to any MCP server over STDIO and pipes queries through Anthropic's Claude API.

Overview

This sample demonstrates a complete MCP client workflow: launching an MCP server as a subprocess, discovering its tools, converting them to Anthropic's tool format, and running an interactive chat loop where Claude can call server tools on behalf of the user.

Prerequisites

  • JDK 17+
  • An ANTHROPIC_API_KEY environment variable set with a valid Anthropic API key
  • An MCP server script to connect to (.js, .py, or .jar)

Build & Run

Run the client, passing the path to an MCP server:

# Connect to a JVM server
./gradlew run --args="path/to/server.jar"

# Connect to a Python server
./gradlew run --args="path/to/server.py"

# Connect to a Node.js server
./gradlew run --args="path/to/build/index.js"

Note

The client uses STDIO transport, so it launches the MCP server as a subprocess. Ensure the server script is executable and is a valid .js, .py, or .jar file.

MCP Capabilities

From the client perspective, this sample demonstrates:

  • Tool discovery — lists tools from the connected server and converts them to Anthropic's tool format.
  • Tool invocation — when Claude's response requests a tool call, the client invokes the corresponding MCP tool and feeds the result back into the conversation.

Additional Resources