Three fixes from Copilot review on the upstream PR:
- Drop the local express.json() in setupMcpEndpoint. The router already
has express.json({limit: bodyParserLimit}) installed globally by
setupBasicRoutes (lib/app/server-config.ts), so the local one was
shadowing the configured upload limit with the default 100KB.
- Pass the real express.Request through createMcpServer into the
shortlink tool instead of {} cast as any. StorageS3.storeItem reads
req.get('X-Forwarded-For') and req.ip to record the creator IP, so the
empty-object hack would have thrown at runtime against a real S3
storage backend.
- Add test/mcp/mcp-tests.ts covering: GET/DELETE /mcp returning 405,
POST handling structured JSON-RPC errors, the initialize handshake,
and direct tests of the shortlink tool that confirm the real req is
threaded through to storeItem (with both req.get and req.ip available)
and that the get_shortlink_info tool round-trips the storage config.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>