vcluster-yaml-mcp-server 1.0.4 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/http-server.js +6 -1
package/package.json
CHANGED
package/src/http-server.js
CHANGED
|
@@ -30,6 +30,10 @@ const mcpRequestDuration = new promClient.Histogram({
|
|
|
30
30
|
|
|
31
31
|
const app = express();
|
|
32
32
|
|
|
33
|
+
// Trust proxy (Cloudflare Tunnel)
|
|
34
|
+
// Trust exactly 1 proxy hop (cloudflared)
|
|
35
|
+
app.set('trust proxy', 1);
|
|
36
|
+
|
|
33
37
|
// Security headers
|
|
34
38
|
app.use((req, res, next) => {
|
|
35
39
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
@@ -96,7 +100,8 @@ app.get('/', (_req, res) => {
|
|
|
96
100
|
// MCP endpoint with Streamable HTTP transport
|
|
97
101
|
const mcpHandler = async (req, res) => {
|
|
98
102
|
const start = Date.now();
|
|
99
|
-
|
|
103
|
+
const clientIp = req.ip || req.headers['x-forwarded-for'] || req.socket.remoteAddress;
|
|
104
|
+
console.log(`MCP ${req.method} request from ${clientIp}`);
|
|
100
105
|
|
|
101
106
|
try {
|
|
102
107
|
// Create new transport per request to prevent ID collisions
|