Skip to content

Conversation

@kpavlov
Copy link
Contributor

@kpavlov kpavlov commented Nov 11, 2025

Implement the last version of the mcp schema and complete restructuring of the mcp schema implementation from a monolithic types.kt file into separate files.

Note: This is an improvement of #386 to improve source-compatibility with 0.7.7

Motivation and Context

The previous implementation of the mcp schema was outdated and contained several issues. In addition, it stored all mcp types in a single large file, which made maintenance and further development more difficult

How Has This Been Tested?

All tests passed

Breaking Changes

Yes. The new types are now located in a separate package. Additionally, many types have new parameters and modified constructors

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

Additional context

to adopt the new structure:
Before:

  import io.modelcontextprotocol.kotlin.sdk.InitializeRequest
  import io.modelcontextprotocol.kotlin.sdk.Resource

After:

  import io.modelcontextprotocol.kotlin.sdk.types.InitializeRequest
  import io.modelcontextprotocol.kotlin.sdk.types.Resource

@kpavlov kpavlov requested a review from devcrocod November 11, 2025 09:31
@kpavlov kpavlov changed the title New MCP Schema types (#386) New MCP Schema types-2 (#386) Nov 11, 2025
Comment on lines 31 to 36
val weatherForecastResult = client.callTool(
CallToolRequest(
name = "get_forecast",
arguments = buildJsonObject {
put("latitude", JsonPrimitive(38.5816))
put("longitude", JsonPrimitive(-121.4944))
},
name = "get_forecast",
arguments = mapOf(
"latitude" to 38.5816,
"longitude" to -121.4944,
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's preferable to use DSL in user's code and avoid exposing transport classes to users

@kpavlov kpavlov marked this pull request as ready for review November 11, 2025 09:42
@kpavlov kpavlov added enhancement New feature or request breaking Breaking changes 👧🏠🔥 labels Nov 11, 2025
@kpavlov kpavlov requested a review from tiginamaria November 11, 2025 10:00
@kpavlov kpavlov closed this Nov 11, 2025
@kpavlov kpavlov deleted the kpavlov/new-mcp-schema-patch branch November 11, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking changes 👧🏠🔥 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants