Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -61,6 +65,21 @@ class MyServerConformanceTest {
}
```

Kotlin tests use the same JUnit 5 extension:

```kotlin
@McpServerTest(command = ["java", "-jar", "build/libs/my-mcp-server.jar"])
class MyServerConformanceTest {
@Test
fun `server conforms to the protocol`(client: McpTestClient) {
McpAssertions.assertThat(client)
.initializesSuccessfully()
.hasTools()
.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
Expand Down