Skip to content

Commit 7609240

Browse files
ramsribquantstruct-bot
authored andcommitted
minor tweak
1 parent 05208c4 commit 7609240

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

fern/sdk/mcp-server.mdx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,19 @@ async function main() {
163163
});
164164

165165
// Create SSE transport for connection to remote Vapi MCP server
166-
const transport = new SSEClientTransport({
167-
url: 'https://mcp.vapi.ai/sse',
168-
headers: {
169-
'Authorization': `Bearer ${process.env.VAPI_TOKEN}`
170-
}
171-
});
166+
const serverUrl = 'https://mcp.vapi.ai/sse';
167+
const headers = {
168+
Authorization: `Bearer ${process.env.VAPI_TOKEN}`,
169+
};
170+
const options = {
171+
eventSourceInit: {
172+
fetch: (url, init) => fetch(url, { ...init, headers }),
173+
},
174+
requestInit: {
175+
headers,
176+
},
177+
};
178+
const transport = new SSEClientTransport(new URL(serverUrl), options);
172179

173180
console.log('Connecting to Vapi MCP server via SSE...');
174181
await mcpClient.connect(transport);

0 commit comments

Comments
 (0)