modelcontextprotocol / modelcontextprotocol/java-sdk

Add an ability to trace requests

Open
#561 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

User can specify a file to dump information about all requests being sent between MCP server and the client

Current Behavior

I don't think there is a way to do it currently.

Context

We created a LoggingServletTransportProvider which does that, but with the new changes that no longer compiles since there is no public constructor. Using the builder and then composing is also not possible because the methods are protected.

We could upstream the LoggingServletTransportProvider or something along these lines if it makes sense.

This is very useful for debugging potential issues with MCP servers especially when users turn on automatic accept.

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 comparing the linked Scala LoggingServletTransportProvider with the Java SDK's current builder and protected transport methods. Determine how request tracing can expose a user-selected output file without relying on inaccessible constructors or methods. Done means users can configure a file and see information for requests exchanged between the MCP server and client.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.