Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ayakut16
Copy link
Contributor

@ayakut16 ayakut16 commented Apr 5, 2025

Description

MCP protocol requires sending initialize message and initialized notification to the client. This PR implements this functionality.

Note: The implementation sends initialize before each command call. For single use commands (mcp tool, mcp resources etc.) this is not a problem. However that is unnecessary for mcp shell, a better way would be to save stdin and stdout streams in the Client and run server command upon client initialization, then send initialize request and notification only once in the client.

Fixes #23

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • make build;./bin/mcp tools npx @jbangdev/jbang jdbc@mcp-java
  • make build;./bin/mcp tools npx -y @modelcontextprotocol/server-filesystem ~
  • make build;./bin/mcp shell npx -y @modelcontextprotocol/server-filesystem ~

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@f f merged commit 5d86d52 into f:master Apr 6, 2025
2 checks passed
@ayakut16 ayakut16 deleted the fix/initialize branch April 11, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp tools doesn't seem to follow protocol?

2 participants