Skip to content

Conversation

@devcrocod
Copy link
Contributor

#162

Motivation and Context

  • update readme
  • add more snippets
  • add knit

How Has This Been Tested?

knit

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR significantly enhances the Kotlin MCP SDK documentation by expanding the README with comprehensive usage examples, adding detailed module documentation, and integrating the Knit tool for validating code snippets. The update transforms minimal documentation into a complete developer guide with quickstart examples, core concepts, and feature demonstrations.

  • Expanded README from basic overview to comprehensive guide with installation instructions, quickstart examples, and detailed feature documentation
  • Added extensive module documentation (Module.md) for core, client, and server packages with code examples
  • Integrated Knit build tool for automated code snippet validation

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
settings.gradle.kts Added :docs module to the build
gradle/libs.versions.toml Added knit plugin version 0.5.0 and fixed junit formatting
docs/build.gradle.kts Created build configuration for docs module with knit plugin setup
docs/.gitignore Added gitignore to exclude knit-generated sources
knit.properties Created knit configuration for code snippet extraction
README.md Completely rewrote with table of contents, comprehensive examples, core concepts, transports, and API documentation
kotlin-sdk-core/Module.md Expanded from minimal overview to detailed module documentation with usage examples
kotlin-sdk-client/Module.md Expanded with comprehensive client setup examples and feature descriptions
kotlin-sdk-server/Module.md Expanded with server setup examples, feature registration details, and lifecycle information
docs/moduledoc.md Streamlined and updated module overview with clearer structure and updated code examples
.github/workflows/build.yml Added knit validation step to the CI build workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


<!--- KNIT example-server-util-pagination-01.kt -->

Include `nextCursor` only when more items remain an absent cursor ends pagination.
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a missing punctuation mark between "remain" and "an". The sentence should either use a period, semicolon, or conjunction. Consider: "Include nextCursor only when more items remain. An absent cursor ends pagination." or "Include nextCursor only when more items remain; an absent cursor ends pagination."

Suggested change
Include `nextCursor` only when more items remain an absent cursor ends pagination.
Include `nextCursor` only when more items remain. An absent cursor ends pagination.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @devcrocod

I’ve noticed that Knit isn’t being applied to MD files, even though it’s been added. Let’s consider enabling it in the next PRs.

Also, would it be a good idea to move the examples from _Module.md_s to the main README.md? That way, it’ll be easier for people and AI agents to find them. What do you think?

A minimal client:
Minimal WebSocket client:

```kotlin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's enable knit for this example

// Build and return a CallToolResult from request.arguments
// (see CallToolResult and related types in kotlin-sdk-core)
/* ... */
fun Application.module() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's enable knit for this example


### Minimal STDIO client

```kotlin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add knit for the example too


### Minimal STDIO server

```kotlin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add knit


### Hosting with Ktor (SSE)

```kotlin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kint

@devcrocod
Copy link
Contributor Author

@kpavlov

I’ve noticed that Knit isn’t being applied to MD files, even though it’s been added. Let’s consider enabling it in the next PRs.

In this PR, I added knit only for the Readme.md file for now.

I haven’t set it up for the module.md files yet. We can add that later. For now, I only updated those files because they were outdated

Also, would it be a good idea to move the examples from _Module.md_s to the main README.md? That way, it’ll be easier for people and AI agents to find them. What do you think?

For now, I prefer not to do this
it would overload the README and complicate it. These files are used by dokka, and since they are in the repository, they are also easily accessible to AI agents. I’m currently exploring ways to integrate dokka into writerside, so they may eventually become part of the user documentation

@kpavlov
Copy link
Contributor

kpavlov commented Dec 12, 2025

I don't agree, that Readme would get too crowded. It’s pretty standard these days to have a one-page manual, and that’s what I’m getting at.

You could use the

tag in HTML to hide the examples, which would make it look nicer for people, but still give AI/crawlers all the info they need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants