vcluster-yaml-mcp-server 1.0.4 → 1.0.6
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 +5 -1
package/package.json
CHANGED
package/src/http-server.js
CHANGED
|
@@ -30,6 +30,9 @@ const mcpRequestDuration = new promClient.Histogram({
|
|
|
30
30
|
|
|
31
31
|
const app = express();
|
|
32
32
|
|
|
33
|
+
// Trust proxy (Cloudflare Tunnel)
|
|
34
|
+
app.set('trust proxy', true);
|
|
35
|
+
|
|
33
36
|
// Security headers
|
|
34
37
|
app.use((req, res, next) => {
|
|
35
38
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
@@ -96,7 +99,8 @@ app.get('/', (_req, res) => {
|
|
|
96
99
|
// MCP endpoint with Streamable HTTP transport
|
|
97
100
|
const mcpHandler = async (req, res) => {
|
|
98
101
|
const start = Date.now();
|
|
99
|
-
|
|
102
|
+
const clientIp = req.ip || req.headers['x-forwarded-for'] || req.socket.remoteAddress;
|
|
103
|
+
console.log(`MCP ${req.method} request from ${clientIp}`);
|
|
100
104
|
|
|
101
105
|
try {
|
|
102
106
|
// Create new transport per request to prevent ID collisions
|