Hi Vercel community 👋🏼,
I'm currently trying to connect a Vercel-deployed MCP endpoint to Retell AI. Everything works perfectly when testing the endpoint via Postman, but I consistently get a 400 Bad Request when calling it from Retell’s MCP setup.
I’ve configured the MCP in Retell with the following:
- URL:
https://vickymcpsimple.vercel.app/api/vicky - Timeout:
10000 - Headers:
Authorization: Bearer <OpenAI key>Content-Type: application/json
Note: Retell set up not allow setting a body for MCP node set up — it just sends a basic POST.
✅ Expected behavior:
When calling the endpoint from Retell, I expect it to behave the same way as in Postman — responding with a 200 status and a message from OpenAI's API.
❌ Current behavior:
I'm getting a 400 Bad Request in the Vercel logs every time the MCP is triggered by Retell.
🧠 Working setup (Postman):
POST https://vickymcpsimple.vercel.app/api/vicky
Headers:
json
CopiarEditar
{ "Authorization": "Bearer <OpenAI key>", "Content-Type": "application/json"}Body:
json
CopiarEditar
{ "input": "¿Qué ticket tengo que subir para facturar?"}Response:
json
CopiarEditar
{ "result": "Debes subir el **ticket de bomba** de la estación donde cargaste gasolina..."}🔥 Vercel route handler (route.js):
js
CopiarEditar
export async function POST(req) { const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
let input; try { const body = await req.json(); input = body.input; } catch { return new Response(JSON.stringify({ error: "No input provided" }), { status: 400 }); }
if (!input) { return new Response(JSON.stringify({ error: "No input provided" }), { status: 400 }); }
// OpenAI API logic...}The route fails whenever req.json() returns nothing (which happens in the Retell case due to missing body).
ℹ️ Project Information:
- Project URL:
https://vickymcpsimple.vercel.app/ - Framework: Next.js 13+ using App Router
- Endpoint Path:
app/api/vicky/route.js - Deployment platform: Vercel (Production ready)
- MCP Consumer: Retell AI, custom MCP integration
- Expected consumers: POST calls from Retell MCP nodes that do not include a body
Any suggestions for how I could make this endpoint gracefully handle empty body POSTs (while still working with Postman) would be hugely appreciated 🙏🏼
Thanks in advance! —Gabriel