Commit d4911e0
feat: remote MCP server on Render with smart rate limiting (#379)
* docs: add remote MCP server design spec
Public GoSQLX MCP server on Fly.io with smart 3-layer rate limiting
(tiered IP limits, adaptive load scaling, tool-aware cost weighting).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(mcp): add Handler() and Cfg() methods to expose HTTP handler chain
Allows main.go to wrap the MCP handler with additional middleware
(rate limiting) before starting the HTTP server.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(mcp): smart rate limiter with tiered, adaptive, tool-aware limiting
Three-layer rate limiting for public MCP server deployment:
- Per-IP burst limiting (10 req/sec) via token bucket
- Tool-aware cost weighting (analyze_sql=5x, security_scan=2x, etc.)
- Adaptive load scaling (120/60/30 weighted-req/min based on concurrency)
Uses sharded map (16 shards with FNV hashing) for lock contention
minimization. Returns JSON-RPC errors (not HTTP 429) per MCP protocol.
Background cleanup removes stale entries every 5 minutes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(mcp): wire rate limiter and health endpoint in main
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add Dockerfile for gosqlx-mcp server
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add fly.toml and CI workflow for Fly.io MCP server deployment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add remote MCP server connection instructions and badge
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add USER directive to Dockerfile for Trivy DS002 compliance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(mcp): cleanup race condition + use gosqlx.Version in health endpoint
- Collect stale IPs first, then delete — avoids holding bucket mutex
while modifying the shard map
- Health endpoint now uses gosqlx.Version instead of hardcoded "1.11.1"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(lsp): increase timing margin in ResetTiming test for Windows
Windows has ~15ms timer resolution so a 50ms sleep margin before the
rate-limit window boundary was too tight and caused flaky failures on
windows-latest runners (go 1.23).
Increase pre-boundary sleep margin from 50ms→200ms and post-window
buffer from 20ms→50ms so the test is robust across all platforms.
* feat: switch deployment from Fly.io to Render (free tier)
Fly.io no longer has a free tier (2-hour trial only). Render offers
750 hrs/month free with no credit card required.
- Replace fly.toml with render.yaml blueprint
- Update CI workflow to use Render deploy hooks
- Update all docs/README URLs to onrender.com
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: correct Render URL to gosqlx.onrender.com
The Render service was named "GoSQLX" so the URL is
gosqlx.onrender.com, not gosqlx-mcp.onrender.com.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: replace all Fly.io references with Render in spec and plan
Fly.io was never used — deployment went directly to Render free tier.
Updated all URLs, config references, and platform-specific details.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini-2655.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent b294d21 commit d4911e0
File tree
13 files changed
+1582
-5
lines changed- .github/workflows
- cmd/gosqlx-mcp
- docs
- superpowers
- plans
- specs
- pkg
- lsp
- mcp
13 files changed
+1582
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
39 | 42 | | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
60 | 93 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
43 | 114 | | |
44 | 115 | | |
45 | 116 | | |
| |||
0 commit comments