modelcontextprotocol / modelcontextprotocol/java-sdk

Optimization - avoid unnecessary payload copy when deserializing

Open
#156 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement P2 ready for work
Dominant language
Java
Stars
3.7k
Forks
1.1k
Avg merge
1d 15h
Merged PRs (30d)
9

Description

This issue suggests creating a JSON deserialization variant that consumes an InputStream without the need for a String copy of the HTTP request payload, reducing the GC pressure and improving overall performance.

Expected Behavior

Efficient correct HTTP
bad user data should return 400

Current Behavior

Bad data returns 5xx
Extrac copies of JSON messages are created in memory

Context

More memory pressure,
harder to debug


(edit by @chemicL)
The PR addressing this is #157

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #157, which the issue identifies as addressing this work, and trace the HTTP deserialization entry point it changes. Done means supporting InputStream-based deserialization without unnecessary String copies and returning 400 for bad user data instead of 5xx; verify the relevant behavior with the PR's tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.