8000 Feat: Add Command (STDIO) Mode and Refactor Core Logic (Fixes #8) by timthesinner · Pull Request #9 · timthesinner/smart-mcp-proxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feat: Add Command (STDIO) Mode and Refactor Core Logic (Fixes #8) #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Apr 19, 2025

Conversation

timthesinner
Copy link
Owner

This PR implements GitHub issue #8, adding support for running the smart-mcp-proxy in a command (STDIO) mode using JSON-RPC 2.0, in addition to the existing HTTP mode.

Key changes:

  • Added --mode flag and MCP_PROXY_MODE env var to select mode.
  • Implemented command mode handling in cmd/proxy/command_mode.go adhering to JSON-RPC 2.0 spec.
  • Refactored core request handling logic into ProxyServer methods in cmd/proxy/proxy.go.
  • Updated HTTP mode (cmd/proxy/http_mode.go) to use the refactored core logic.
  • Aligned error handling and response structures (e.g., CallToolResult) between modes.
  • Updated docker/Dockerfile to default to command mode, allowing override.
  • Added VS Code launch configuration for STDIO mode.
  • Enhanced HTTP tests (cmd/proxy/main_test.go) for parity with command mode tests.
  • Updated documentation (README.md, docs/usage.md, docs/configuration.md).

Fixes #8

- Added ProxyServer.CallTool method for core tool execution.
- Updated command mode to use CallTool and correct JSON-RPC formats.
- Updated HTTP mode to use CallTool for POST /tool/:toolName endpoint.
- Adjusted tests for command and HTTP modes.
@timthesinner timthesinner merged commit 005536f into main Apr 19, 2025
1 check passed
@timthesinner timthesinner deleted the feature/command-stdio-mode branch April 19, 2025 23:25
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.

Add Command (STDIO) Mode to MCP Proxy with Docker and Launch Config Support
1 participant
0