fix(mcp): resolve all MCP spec compliance issues#98
Open
giveen wants to merge 2 commits into
Open
Conversation
- Replace manual stdio transport with SDK CommandTransport for proper SIGTERM → wait → SIGKILL process lifecycle - Reuse single SDK client instance across all server sessions - Wire ToolListChangedHandler to re-discover tools on dynamic changes - Handle all MCP content types (AudioContent, ResourceLink, EmbeddedResource) plus default warning for unknown types - Add SSE and Streamable HTTP transport support for remote servers - Capture stderr from stdio subprocesses on connection failure - Log warning on config file write failure instead of silent discard - Suppress unnecessary 'roots' capability advertisement
Owner
|
Great one thanks! I evaluated the code a bit and noticed two things that might cause issues, please take a look at them:
Also a minor thing but would be good to have a tiny time.Sleep before checking the buffer, since an instant failure might read it before the bg routine even writes the error. Will try this out a little more afterwards and if nothing new pops up it will get merged, thanks! |
- Add sync.RWMutex to Client and guard c.tools/c.sessions access in Connect, handleToolListChanged, GetTools, GetTool, and Close. - Wrap ConnectFromConfig's stderr capture buffer in a mutex so the background copy goroutine and the failure path no longer race. - Sleep briefly before reading stderr on failure so the goroutine has time to write the error.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Contributor License Agreement (CLA)
To accept your code, we legally need you to agree to our CLA so we can maintain the project's Business Source License (BSL) and future open-source transitions.
xbetween the brackets like this:[x])