#62
[WIP] Fix `Redis error [Error: Socket closed unexpectedly]`
🚧 This PR is Part of a Series
- https://github.com/vercel-labs/mcp-for-next.js/pull/17
- https://github.com/vercel/mcp-adapter/pull/62
👋 TL;DR
Fix Error: redisUrl is required
🔎 Details
resolves https://github.com/vercel/mcp-adapter/issues/61
- (coming soon)
- (coming soon)
- (coming soon)
✅ How to Test
- checkout my forked fix branch at https://github.com/vercel-labs/mcp-for-next.js/pull/17 (https://github.com/servant-io/mcp-for-next.js/tree/fix/redisUrl)
- run:
#/usr/bin/env bash nvm install nvm use pnpm install -D # https://github.com/redis/node-redis/blob/9ea260f/packages/client/lib/client/index.ts#L33 # replace `redis[s]://[[username][:password]@][host][:port][/db-number]` with your actual `REDIS_URL` echo "REDIS_URL=\"redis[s]://[[username][:password]@][host][:port][/db-number]\"" > .env.local pnpm build pnpm dev - in another terminal, run:
#/usr/bin/env bash nvm install nvm use # no need to globally install mcp sdk because I # rolled it into the dev dependencies # npm i -g @modelcontextprotocol/sdk@latest pnpm test:client http://localhost:3000 - 🔴 see that the output no longer reads:
> next.js-mcp-server@0.1.0 dev /Users/patrick/src/servant-io/mcp-for-next.js > next dev ▲ Next.js 15.2.4 - Local: http://localhost:3000 - Network: http://192.168.1.52:3000 - Environments: .env.local ✓ Starting... ✓ Ready in 1650ms ○ Compiling /[transport] ... ✓ Compiled /[transport] in 1458ms (999 modules) Redis error [Error: Socket closed unexpectedly] Redis error [Error: Socket closed unexpectedly] Redis error [Error: Socket closed unexpectedly] - 🟢 instead, see that the output now reads:
> next.js-mcp-server@0.1.0 dev /Users/patrick/src/servant-io/mcp-for-next.js > next dev ▲ Next.js 15.2.4 - Local: http://localhost:3000 - Network: http://192.168.1.52:3000 - Environments: .env.local ✓ Starting... ✓ Ready in 1650ms ○ Compiling /[transport] ... ✓ Compiled /[transport] in 1458ms (999 modules) # (coming soon - what is the expected result?)
🥜 GIF
Activity
8This pull request is a draft
Merging is unavailable until it is marked ready for review.
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
Security
View full report