Skip to content

Commit 89cdffd

Browse files
committed
docs: update CLAUDE.md with HTTP server documentation
1 parent 19a0ab1 commit 89cdffd

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

CLAUDE.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,54 @@ cargo build --release -p codegraph-mcp --bin codegraph --features "ai-enhanced,f
109109
./target/release/codegraph config agent-status
110110
```
111111

112-
**Note on HTTP Transport:**
113-
- HTTP transport is **not yet implemented** with the official rmcp SDK
114-
- STDIO transport is the recommended and fully-supported mode
115-
- Use `codegraph start stdio` for Claude Desktop and other MCP clients
116-
- HTTP implementation is planned but currently incomplete
112+
**HTTP Transport (Experimental):**
113+
- HTTP transport with SSE streaming is now available
114+
- Requires `server-http` feature flag
115+
- Build: `cargo build --release --features "ai-enhanced,autoagents-experimental,faiss,ollama,server-http"`
116+
- Start: `./target/release/codegraph-official serve --transport http --port 3000`
117+
- Endpoints:
118+
- `POST /mcp` - Send MCP requests (returns SSE stream)
119+
- `GET /sse` - Reconnect to existing session
120+
- `GET /health` - Health check
121+
- **Production Status**: Experimental - use STDIO for production
122+
- **Best For**: Web integrations, multi-client scenarios, debugging
123+
124+
### HTTP Server Mode
125+
126+
```bash
127+
# Build with HTTP support
128+
cargo build --release -p codegraph-mcp --features "ai-enhanced,autoagents-experimental,faiss,ollama,server-http"
129+
130+
# Start HTTP server (default: http://127.0.0.1:3000)
131+
./target/release/codegraph-official serve --transport http
132+
133+
# Custom host and port
134+
./target/release/codegraph-official serve --transport http --host 0.0.0.0 --port 8080
135+
136+
# Test with curl
137+
curl http://127.0.0.1:3000/health # Should return "OK"
138+
139+
# Send MCP initialize request
140+
curl -X POST http://127.0.0.1:3000/mcp \
141+
-H "Content-Type: application/json" \
142+
-d '{
143+
"jsonrpc": "2.0",
144+
"id": 1,
145+
"method": "initialize",
146+
"params": {
147+
"protocolVersion": "2025-06-18",
148+
"capabilities": {},
149+
"clientInfo": {"name": "curl", "version": "1.0"}
150+
}
151+
}'
152+
```
153+
154+
**Environment Variables:**
155+
```bash
156+
CODEGRAPH_HTTP_HOST=127.0.0.1 # Bind address
157+
CODEGRAPH_HTTP_PORT=3000 # Listen port
158+
CODEGRAPH_HTTP_KEEP_ALIVE=15 # SSE keep-alive seconds
159+
```
117160

118161
### NAPI (Node.js Bindings)
119162

0 commit comments

Comments
 (0)