-
Notifications
You must be signed in to change notification settings - Fork 176
MCP Schema #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
MCP Schema #378
Conversation
kpavlov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you
| name: String, | ||
| description: String, | ||
| inputSchema: Tool.Input = Tool.Input(), | ||
| inputSchema: ToolSchema = ToolSchema(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
| get() = _responseHandlers.value | ||
|
|
||
| private val _progressHandlers: AtomicRef<PersistentMap<RequestId, ProgressCallback>> = | ||
| private val _progressHandlers: AtomicRef<PersistentMap<ProgressToken, ProgressCallback>> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
|
|
||
| setRequestHandler<PingRequest>(Method.Defined.Ping) { _, _ -> | ||
| EmptyRequestResult() | ||
| EmptyResult() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could be constant
6b2f4ad to
55214b8
Compare
55214b8 to
4f0decc
Compare
There was a problem hiding this 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 refactors the Kotlin SDK's type system by moving MCP protocol types from the io.modelcontextprotocol.kotlin.sdk package to a new io.modelcontextprotocol.kotlin.sdk.types package. This is a large-scale package reorganization that affects both the core SDK and test code.
Key changes:
- Moved all protocol types (requests, responses, notifications, etc.) to a dedicated
typespackage - Updated all import statements across test files to reference the new package location
- Renamed several classes to improve clarity (e.g.,
Tool.Input→ToolSchema,EmptyRequestResult→EmptyResult) - Restructured test files to align with the new package structure, creating dedicated test files for each type category
Reviewed Changes
Copilot reviewed 93 out of 95 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Multiple test files in kotlin-sdk-test/src/jvmTest/ |
Updated imports from io.modelcontextprotocol.kotlin.sdk.* to io.modelcontextprotocol.kotlin.sdk.types.* |
Multiple test files in kotlin-sdk-core/src/commonTest/ |
Created new comprehensive test files organized by type category (ToolsTest, SamplingTest, etc.) and updated existing tests |
| Server implementation files | Updated imports and references to use new type package location |
| Transport and shared infrastructure | Updated to reference types from new package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implement the last version of the mcp schema and complete restructuring of the mcp schema implementation from a monolithic
types.ktfile into separate files.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
Checklist
Additional context
to adopt the new structure:
Before:
After: