File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" ;
2+ import { randomUUID } from "crypto" ;
23import { z } from "zod" ;
34
45const BASE_URL = "https://developers.webflow.com/" ;
6+ const X_FERN_HOST = "developers.webflow.com" ;
57
68export function registerAiChatTools ( server : McpServer ) {
79 server . tool (
@@ -22,11 +24,12 @@ async function postChat(message: string) {
2224 method : "POST" ,
2325 headers : {
2426 "content-type" : "application/json" ,
27+ "x-fern-host" : X_FERN_HOST ,
2528 } ,
2629 body : JSON . stringify ( {
27- messages : [ { role : "user" , content : message } ] ,
30+ messages : [ { role : "user" , parts : [ { type : "text" , text : message } ] } ] ,
31+ conversationId : randomUUID ( ) ,
2832 url : BASE_URL ,
29- filters : [ ] ,
3033 source : "mcp" ,
3134 } ) ,
3235 } ) ;
You can’t perform that action at this time.
0 commit comments