How to Use the Refiner MCP in Vercel AI SDK
Stream Refiner survey responses and user segments to your Vercel AI SDK app using this MCP Server.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Refiner MCP to Vercel AI SDK
Create your Vinkius account to connect Refiner to Vercel AI SDK and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Key Capabilities
Vercel AI SDK Real-time Survey Streaming
Stop making your users stare at loading spinners while fetching customer feedback. This MCP Server lets your Vercel AI SDK app pull live NPS data and feature requests directly from the API. By feeding `list_refiner_responses` into `streamText`, the data renders on the screen block-by-block as it arrives. You configure the client using `createMCPClient` and pass the tools directly to your generative UI components. When the live stream finishes, call `mcpClient.close()` to clean up the connection and keep your Edge Functions light.
Update User Segments on the Edge
Edge middleware needs to be fast, and so does your user targeting. When a user takes a critical action, your AI client can immediately trigger `track_refiner_event` or run `identify_refiner_user` to change their bucket. This happens right inside your Next.js edge route without adding boot latency. Your application gets the updated segments instantly via `list_refiner_segments`. Because this MCP Server integrates natively, you don't have to write custom API wrappers to sync Refiner with your local database state.
Instant Contact Lookup in Chat Interfaces
Build a support dashboard where your team chats with an agent to inspect user accounts. The agent calls `get_refiner_contact` to grab a customer's profile details and displays their exact NPS history right inside the chat bubble. You can use `list_refiner_contacts` to search across your entire customer base. The Vercel AI SDK pipes these contact structures straight into React components, giving your customer success reps a live-updating view of user sentiment.
Set up Refiner MCP in Vercel AI SDK
Prerequisites
- Node.js 18+ and a TypeScript project
-
ai+@modelcontextprotocol/sdkpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
npm install ai @modelcontextprotocol/sdkplus your preferred model provider (e.g.@ai-sdk/openai). - 2
Create the Streamable HTTP transport
Use
StreamableHTTPClientTransportwith your Vinkius endpoint URL. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Discover and use tools
Call
mcpClient.tools()to auto-discover all Refiner tools. Pass them directly togenerateText()orstreamText()— no manual schema definitions needed. - 4
Works with any model provider
Swap
openai("gpt-4o")for any AI SDK provider — Anthropic, Google, Mistral. The MCP tools work identically across all supported models.
import { experimental_createMCPClient as createMCPClient } from "ai";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
const transport = new StreamableHTTPClientTransport(
new URL("https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp")
);
const mcpClient = await createMCPClient({ transport });
const tools = await mcpClient.tools();
const { text } = await generateText({
model: openai("gpt-4o"),
tools,
prompt: "List recent Refiner transactions",
});
console.log(text);
await mcpClient.close(); Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Refiner. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Refiner MCP in Vercel AI SDK
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Refiner MCP today
We host it, we monitor it, we maintain it. You just paste one token.