| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps the other-dependencies group with 2 updates in the /samples/kotlin-mcp-client directory: [com.anthropic:anthropic-java](https://github.com/anthropics/anthropic-sdk-java) and org.slf4j:slf4j-simple. Bumps the other-dependencies group with 1 update in the /samples/kotlin-mcp-server directory: org.slf4j:slf4j-simple. Bumps the other-dependencies group with 1 update in the /samples/simple-streamable-server directory: org.slf4j:slf4j-simple. Bumps the other-dependencies group with 1 update in the /samples/weather-stdio-server directory: org.slf4j:slf4j-simple. Updates `com.anthropic:anthropic-java` from 2.60.0 to 2.62.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.62.0</h2> <h2>2.62.0 (2026-09-10)</h2> <p>Full Changelog: <a href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.61.0...v2.62.0">v2.61.0...v2.62.0</a></p> <h3>Features</h3> <ul> <li><strong>api:</strong> add auto mode tool permissions for Managed Agents (<a href=" |
||
| .. | ||
| gradle | ||
| src/main | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
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_KEYenvironment 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.jarfile.
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.