Open
Conversation
Member
Author
Review Fixes AppliedAddressed the feedback from the code review: Changes Made
Not Addressed (by design)
Testing
|
Member
Author
Local Testing Results ✓Tested the MCP HTTP server locally with Endpoints Verified
Test Commands# Start server
cargo run --release -- mcp-http --auth my-secret-token
# Test health
curl http://localhost:9699/health
# Test with auth
curl -X POST http://localhost:9699/mcp \
-H "Authorization: Bearer my-secret-token" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"mcp_status","arguments":{}}}'All endpoints working as expected. |
Add mcp-http CLI command that starts LeanKG MCP server with Streamable HTTP transport per MCP spec. Features: - POST /mcp endpoint for JSON-RPC requests - GET /mcp/stream endpoint for SSE streaming - GET /health endpoint for health checks - Bearer token authentication (--auth flag) - CORS headers for browser-based clients - Default port 9699 (configurable via --port or MCP_HTTP_PORT env var) - Watch mode support (--watch flag) This enables LeanKG to serve multiple concurrent MCP clients remotely, complementing the existing stdio transport for local use.
- Add DatabaseConfig struct to project.rs with backend, path, pool_size, ssl_enabled - Add #[serde(default)] to ProjectConfig to handle missing database field - Add init_db_with_config function to schema.rs (SQLite-only, PG returns error) - Update HLD changelog to note PostgreSQL support pending cozo update Note: PostgreSQL support requires cozo to add PG storage backend. Currently only SQLite is supported via cozo 0.2.
- Add comment explaining when tool results use as_str() vs wrap_response() - Mark pool_size and ssl_enabled as reserved for future PostgreSQL support
48b5a6d to
ff1be21
Compare
- Remove unused SseEventType enum from HTTP transport - Use subtle::ConstantTimeEq for bearer token comparison to prevent timing attacks
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.
Summary
mcp-httpCLI command for HTTP-based MCP server (remote clients)Changes
src/mcp/server.rs- Added HTTP transport with SSE streamingsrc/cli/mod.rs- AddedMcpHttpCLI variantsrc/config/project.rs- AddedDatabaseConfigstruct (PostgreSQL support prepared but not yet functional)src/db/schema.rs- Addedinit_db_with_configfunctionTest plan