Skip to main content
Vercel excels at hosting frontends and serverless functions. For Hyperterse — a long-running server process — the recommended architecture is to deploy Hyperterse on a container platform and connect your Vercel frontend to it through API handlers.
Hyperterse requires a persistent server process. Deploy it on Railway, AWS, GCP, Azure, DigitalOcean, or bare metal, then configure your Vercel project to communicate with it.

Architecture

Your Vercel frontend communicates with Hyperterse through server-side API handlers. This keeps your Hyperterse endpoint private and lets Vercel handle CORS, authentication, and caching at the edge.
Browser → Vercel Edge → API Handler → Hyperterse Server → Database

Configure the proxy

1

Set the Hyperterse URL as an environment variable

In the Vercel dashboard, go to Settings > Environment Variables and add:
HYPERTERSE_URL=https://your-hyperterse-deployment.example.com
2

Create an API handler

Forward MCP requests from your frontend to the Hyperterse server:
// pages/api/mcp.ts (Next.js Pages Router)
import type { NextApiRequest, NextApiResponse } from "next";

export default async function handler(
  req: NextApiRequest,
  res: NextApiResponse
) {
  const response = await fetch(`${process.env.HYPERTERSE_URL}/mcp`, {
    method: req.method,
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(req.body),
  });

  const data = await response.json();
  res.status(response.status).json(data);
}
3

Deploy

Push to your connected Git repository, or deploy manually:
vercel --prod

Rewrites

As an alternative to an API handler, use Vercel rewrites to proxy requests directly:
{
  "rewrites": [
    {
      "source": "/mcp",
      "destination": "https://your-hyperterse-deployment.example.com/mcp"
    }
  ]
}
Add this to your vercel.json. Vercel forwards matching requests to your Hyperterse server without exposing its URL to the client.

Considerations

  • Latency: Place your Hyperterse server in the same region as your primary user base to minimize round-trip time.
  • Authentication: Add authentication in your API handler or Vercel middleware before forwarding requests to Hyperterse.
  • Timeouts: Vercel serverless functions have execution time limits. For long-running tool calls, ensure your Hyperterse queries complete within the Vercel timeout window, or use streaming responses.