File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export const server = new McpServer(
28
28
name : 'isaacus_api' ,
29
29
version : '0.11.0' ,
30
30
} ,
31
- { capabilities : { tools : { } } } ,
31
+ { capabilities : { tools : { } , logging : { } } } ,
32
32
) ;
33
33
34
34
/**
@@ -61,7 +61,24 @@ export function init(params: {
61
61
62
62
const endpointMap = Object . fromEntries ( providedEndpoints . map ( ( endpoint ) => [ endpoint . tool . name , endpoint ] ) ) ;
63
63
64
- const client = params . client || new Isaacus ( { defaultHeaders : { 'X-Stainless-MCP' : 'true' } } ) ;
64
+ const logAtLevel =
65
+ ( level : 'debug' | 'info' | 'warning' | 'error' ) =>
66
+ ( message : string , ...rest : unknown [ ] ) => {
67
+ console . error ( message , ...rest ) ;
68
+ void server . sendLoggingMessage ( {
69
+ level,
70
+ data : { message, rest } ,
71
+ } ) ;
72
+ } ;
73
+ const logger = {
74
+ debug : logAtLevel ( 'debug' ) ,
75
+ info : logAtLevel ( 'info' ) ,
76
+ warn : logAtLevel ( 'warning' ) ,
77
+ error : logAtLevel ( 'error' ) ,
78
+ } ;
79
+
80
+ const client =
81
+ params . client || new Isaacus ( { defaultHeaders : { 'X-Stainless-MCP' : 'true' } , logger : logger } ) ;
65
82
66
83
server . setRequestHandler ( ListToolsRequestSchema , async ( ) => {
67
84
return {
You can’t perform that action at this time.
0 commit comments