Integration recipe

Vercel AI SDK + RegEvidenceHub MCP

Use Vercel AI SDK 7 and @ai-sdk/mcp to connect to RegEvidenceHub over Streamable HTTP. This recipe starts with the payment-free AI-safe MCP surface so you can verify discovery and tool selection without triggering a paid regulatory decision.

Choose an endpoint

Use the AI-safe endpoint for connector/discovery flows. Use the commercial endpoint only when your application is prepared to handle the product's published commercial boundary.

ProductAI-safe MCPCommercial MCP
Taxi / PHVhttps://taxi.regevidencehub.com/ai/mcphttps://taxi.regevidencehub.com/mcp
CQChttps://cqc.regevidencehub.com/ai/mcphttps://cqc.regevidencehub.com/mcp
Premises licensinghttps://premises.regevidencehub.com/ai/mcphttps://premises.regevidencehub.com/mcp
England Works Watchhttps://works.regevidencehub.com/ai/mcphttps://works.regevidencehub.com/mcp

Quick start

Vercel's current MCP integration uses Node.js 22+, AI SDK 7, and @ai-sdk/mcp. Install the packages:

npm i ai @ai-sdk/mcp

Set the remote MCP endpoint. This example uses the Taxi AI-safe connector:

MCP_SERVER_URL=https://taxi.regevidencehub.com/ai/mcp
AI_GATEWAY_API_KEY=your_api_key_here

Create index.mts:

import { createMCPClient } from '@ai-sdk/mcp';
import { generateText, isStepCount } from 'ai';

const url = process.env.MCP_SERVER_URL;
if (!url) throw new Error('Set MCP_SERVER_URL.');

const client = await createMCPClient({
  transport: {
    type: 'http',
    url,
  },
});

try {
  const tools = await client.tools();

  const result = await generateText({
    model: 'anthropic/claude-opus-5',
    tools,
    prompt:
      'Use the RegEvidenceHub Taxi connector to list the supported authorities. Do not make a paid regulatory decision.',
    stopWhen: isStepCount(5),
  });

  console.log(result.text);
} finally {
  await client.close();
}

Run it with:

npx tsx --env-file=.env index.mts
Why start with the AI-safe endpoint? It is the lowest-risk way to test MCP connectivity, tool discovery, and selection behavior without exposing a payment flow.

Commercial tools and x402

The commercial MCP endpoints can expose usage-based decision tools. RegEvidenceHub publishes the current payment metadata and pricing at the product boundary. The basic @ai-sdk/mcp connection above does not itself constitute buyer-side x402 settlement.

Safe integration sequence

Discover tools first, inspect product/status metadata, collect the required structured facts, and invoke a paid decision only when your buyer flow is explicitly prepared for the product's payment challenge.

Fail-closed regulatory boundary

Paid or free access does not override evidence safety. When required official evidence is changed, unavailable, conflicting, or insufficient, affected conclusions can be withheld or routed to review rather than guessed.

Vercel reference

See Vercel's official AI SDK with MCP documentation → for the current createMCPClient API, transport options, authentication headers, and runtime requirements.