Skip to content
Closed
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
25 changes: 25 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,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
Expand Down