modelcontextprotocol / modelcontextprotocol/kotlin-sdk
Reusable server "specs" - don't re-create the server from scratch for each transport
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 1.5k
- Forks
- 248
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 23
Description
Is your feature request related to a problem? Please describe.
With how each MCP server instance is limited to a single transport, you need to re-create the server instance (and any components, i.e. tools) for each different transport (and maybe session?). This can get decently expensive, especially if you're creating a bunch of JSON schemas.
Describe the solution you'd like
It would be great to be able to create a "spec" like object, quite like what Server is today, and then create an "instance" for each transport. That way you don't need to re-create all the tools and everything else.
Describe alternatives you've considered
Re-creating the server and any tools for each transport is currently the only alternative.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the current Server implementation and its transport handling, since the issue does not identify specific files or tests. Define what a reusable server spec contains and how transport-specific instances are created, then verify that tools and JSON schemas are not recreated for each instance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100