Skip to content

feat: Show initialize request/response in History panel (#269)#270

Merged
cliffhall merged 1 commit into
modelcontextprotocol:mainfrom
leoshimo:leo/269-show-initialize-request-in-history
Apr 15, 2025
Merged

feat: Show initialize request/response in History panel (#269)#270
cliffhall merged 1 commit into
modelcontextprotocol:mainfrom
leoshimo:leo/269-show-initialize-request-in-history

Conversation

@leoshimo
Copy link
Copy Markdown
Contributor

@leoshimo leoshimo commented Apr 5, 2025

This is a candidate PR for issue #269.

Fixes #269

This PR adds a representation of initialize request and response to the History panel.

Screenshot 2025-04-04 at 6 20 03 PM

Motivation and Context

The information in server's initialize response is very helpful - notably instructions and serverCapabilities. It would be great to see it in the inspector.

How Has This Been Tested?

Tested connecting with variety of servers - server-everything, linear-mcp-server

Breaking Changes

No

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

I am using the existing pushHistory method to push the request / response for initialize RPC messages.

There's a rub: the actual RPC request is abstracted in Client.connect (including notification/initialized).
This means that the payload pushed to history can potentially diverge from the one in the API client. I took the conservative approach, by representing the request with method only - I think the key information is the server response.

@leoshimo leoshimo force-pushed the leo/269-show-initialize-request-in-history branch from 1599a7b to f43b68d Compare April 5, 2025 01:30
Copy link
Copy Markdown
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

Love this, just one little change...

Comment thread client/src/lib/hooks/useConnection.ts
@cliffhall cliffhall added enhancement New feature request waiting on submitter Waiting for the submitter to provide more info labels Apr 11, 2025
@leoshimo leoshimo force-pushed the leo/269-show-initialize-request-in-history branch from f43b68d to 58f2e0d Compare April 12, 2025 17:29
@leoshimo leoshimo requested a review from cliffhall April 13, 2025 01:06
cliffhall
cliffhall previously approved these changes Apr 14, 2025
Copy link
Copy Markdown
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

Code, build, test, lint all good. Tested locally, LGTM! 👍

Screenshot 2025-04-14 at 6 00 15 PM

@leoshimo
Copy link
Copy Markdown
Contributor Author

Thank you @cliffhall!

@cliffhall
Copy link
Copy Markdown
Member

cliffhall commented Apr 14, 2025

@leoshimo I tested your branch locally and tests run just fine. But on here, the useConnection tests are failing. Can you merge main into your branch and see if you can determine why?

@leoshimo
Copy link
Copy Markdown
Contributor Author

leoshimo commented Apr 14, 2025

@leoshimo I tested your branch locally and tests run just fine. But on here, the useConnection tests are failing. Can you merge main into your branch and see if you can determine why?

I'll take a look this evening 👍

@leoshimo leoshimo force-pushed the leo/269-show-initialize-request-in-history branch 2 times, most recently from 58f2e0d to bbca441 Compare April 15, 2025 00:25
…protocol#269)

- Add logging for initialize request and response in useConnection.connect
- Include server capabilities, version, and instructions in history
@leoshimo leoshimo force-pushed the leo/269-show-initialize-request-in-history branch from bbca441 to 22eb813 Compare April 15, 2025 00:34
@leoshimo
Copy link
Copy Markdown
Contributor Author

Updated! cc @cliffhall

@leoshimo leoshimo requested a review from cliffhall April 15, 2025 00:35
Copy link
Copy Markdown
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@cliffhall cliffhall merged commit 5fa76a7 into modelcontextprotocol:main Apr 15, 2025
2 checks passed
IgnacioC44 referenced this pull request in MCPJam/inspector Jun 21, 2025
…-in-history

feat: Show initialize request/response in History panel (#269)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature request waiting on submitter Waiting for the submitter to provide more info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Show initialize request / response in History

3 participants