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.
| Product | AI-safe MCP | Commercial MCP |
|---|---|---|
| Taxi / PHV | https://taxi.regevidencehub.com/ai/mcp | https://taxi.regevidencehub.com/mcp |
| CQC | https://cqc.regevidencehub.com/ai/mcp | https://cqc.regevidencehub.com/mcp |
| Premises licensing | https://premises.regevidencehub.com/ai/mcp | https://premises.regevidencehub.com/mcp |
| England Works Watch | https://works.regevidencehub.com/ai/mcp | https://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/mcpSet 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.mtsCommercial 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.