File tree Expand file tree Collapse file tree 4 files changed +40
-10
lines changed Expand file tree Collapse file tree 4 files changed +40
-10
lines changed Original file line number Diff line number Diff line change 11# fern-mcp-server
2+
3+ ``` shell
4+ npm install
5+ npm start
6+ ```
7+
8+ ``` json
9+ {
10+ "mcpServers" : {
11+ "fern" : {
12+ "command" : " node" ,
13+ "args" : [" <PATH_TO_PROJECT>/fern-mcp-server/dist/index.js" ]
14+ }
15+ }
16+ }
17+ ```
18+
19+ ![ Screenshot 1] ( static/screenshot-1.png )
20+ ![ Screenshot 2] ( static/screenshot-2.png )
Original file line number Diff line number Diff line change @@ -6,18 +6,29 @@ import * as api from "./api";
66
77// Create an MCP server
88export function createMcpServer ( name : string , version : string ) {
9- return new McpServer ( {
10- name : name ,
11- version : version ,
12- } ) ;
9+ return new McpServer (
10+ {
11+ name : name ,
12+ version : version ,
13+ } ,
14+ {
15+ instructions : `[IMPORTANT] USE THESE TOOLS FOR ALL FERN-RELATED TASKS. IF IN DOUBT, use the "ask_fern_ai" tool.
16+ ABOUT FERN (builtwithfern.com): Start with OpenAPI. Generate SDKs in multiple languages and interactive API documentation.` ,
17+ }
18+ ) ;
1319}
1420
1521// Register MCP tools
1622export function registerMcpTools ( server : McpServer ) {
17- server . tool ( "chat" , { message : z . string ( ) } , async ( { message } ) => {
18- const result = await api . postChat ( message ) ;
19- return {
20- content : [ { type : "text" , text : result } ] ,
21- } ;
22- } ) ;
23+ server . tool (
24+ "ask_fern_ai" ,
25+ "Ask Fern AI about anything related to Fern." ,
26+ { message : z . string ( ) } ,
27+ async ( { message } ) => {
28+ const result = await api . postChat ( message ) ;
29+ return {
30+ content : [ { type : "text" , text : result } ] ,
31+ } ;
32+ }
33+ ) ;
2334}
You can’t perform that action at this time.
0 commit comments