From bd37e76b614dcc8fe5679781c89b75b61d572214 Mon Sep 17 00:00:00 2001 From: Aditya Datta Date: Tue, 25 Aug 2026 11:42:52 +0530 Subject: [PATCH] docs: add Gradle Kotlin quick start Signed-off-by: Aditya Datta --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index f40e42a..02ca215 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ Most MCP test tooling runs *against* your server from the outside — the offici testImplementation 'io.github.senor14:mcp-java-testkit:0.5.1' ``` +```kotlin +testImplementation("io.github.senor14:mcp-java-testkit:0.5.1") +``` + > Pre-1.0: minor releases may still evolve the API. ## Quick start @@ -61,6 +65,27 @@ class MyServerConformanceTest { } ``` +Kotlin projects use the same JUnit 5 extension and injected client: + +```kotlin +import io.github.senor14.mcptestkit.McpAssertions +import io.github.senor14.mcptestkit.McpServerTest +import io.github.senor14.mcptestkit.McpTestClient +import org.junit.jupiter.api.Test + +@McpServerTest(command = ["java", "-jar", "target/my-mcp-server.jar"]) +class MyServerConformanceTest { + @Test + fun `conforms to spec`(client: McpTestClient) { + McpAssertions.assertThat(client) + .initializesSuccessfully() + .hasTools() + .toolsHaveDescriptions() + .toolSchemasAreValid() + } +} +``` + Works with any MCP server reachable over **stdio or Streamable HTTP** — including servers written in other languages. A Spring Boot MCP server gets first-class support via the `spring:` URL scheme, which discovers the random test port from the Spring context automatically: ```java