@@ -17,6 +17,7 @@ export type McpOptions = {
1717 includeDynamicTools ?: boolean | undefined ;
1818 includeAllTools ?: boolean | undefined ;
1919 includeCodeTools ?: boolean | undefined ;
20+ includeDocsTools ?: boolean | undefined ;
2021 filters ?: Filter [ ] | undefined ;
2122 capabilities ?: Partial < ClientCapabilities > | undefined ;
2223} ;
@@ -55,13 +56,13 @@ export function parseCLIOptions(): CLIOptions {
5556 . option ( 'tools' , {
5657 type : 'string' ,
5758 array : true ,
58- choices : [ 'dynamic' , 'all' , 'code' ] ,
59+ choices : [ 'dynamic' , 'all' , 'code' , 'docs' ] ,
5960 description : 'Use dynamic tools or all tools' ,
6061 } )
6162 . option ( 'no-tools' , {
6263 type : 'string' ,
6364 array : true ,
64- choices : [ 'dynamic' , 'all' , 'code' ] ,
65+ choices : [ 'dynamic' , 'all' , 'code' , 'docs' ] ,
6566 description : 'Do not use any dynamic or all tools' ,
6667 } )
6768 . option ( 'tool' , {
@@ -245,13 +246,14 @@ export function parseCLIOptions(): CLIOptions {
245246 }
246247 }
247248
248- const shouldIncludeToolType = ( toolType : 'dynamic' | 'all' | 'code' ) =>
249+ const shouldIncludeToolType = ( toolType : 'dynamic' | 'all' | 'code' | 'docs' ) =>
249250 explicitTools ? argv . tools ?. includes ( toolType ) && ! argv . noTools ?. includes ( toolType ) : undefined ;
250251
251252 const explicitTools = Boolean ( argv . tools || argv . noTools ) ;
252253 const includeDynamicTools = shouldIncludeToolType ( 'dynamic' ) ;
253254 const includeAllTools = shouldIncludeToolType ( 'all' ) ;
254255 const includeCodeTools = shouldIncludeToolType ( 'code' ) ;
256+ const includeDocsTools = shouldIncludeToolType ( 'docs' ) ;
255257
256258 const transport = argv . transport as 'stdio' | 'http' ;
257259
@@ -261,6 +263,7 @@ export function parseCLIOptions(): CLIOptions {
261263 includeDynamicTools,
262264 includeAllTools,
263265 includeCodeTools,
266+ includeDocsTools,
264267 filters,
265268 capabilities : clientCapabilities ,
266269 list : argv . list || false ,
@@ -280,8 +283,8 @@ const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
280283 ) ;
281284
282285const QueryOptions = z . object ( {
283- tools : coerceArray ( z . enum ( [ 'dynamic' , 'all' ] ) ) . describe ( 'Use dynamic tools or all tools' ) ,
284- no_tools : coerceArray ( z . enum ( [ 'dynamic' , 'all' ] ) ) . describe ( 'Do not use dynamic tools or all tools' ) ,
286+ tools : coerceArray ( z . enum ( [ 'dynamic' , 'all' , 'docs' ] ) ) . describe ( 'Use dynamic tools or all tools' ) ,
287+ no_tools : coerceArray ( z . enum ( [ 'dynamic' , 'all' , 'docs' ] ) ) . describe ( 'Do not use dynamic tools or all tools' ) ,
285288 tool : coerceArray ( z . string ( ) ) . describe ( 'Include tools matching the specified names' ) ,
286289 resource : coerceArray ( z . string ( ) ) . describe ( 'Include tools matching the specified resources' ) ,
287290 operation : coerceArray ( z . enum ( [ 'read' , 'write' ] ) ) . describe (
@@ -376,11 +379,17 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
376379 : queryOptions . tools ?. includes ( 'all' ) ? true
377380 : defaultOptions . includeAllTools ;
378381
382+ let docsTools : boolean | undefined =
383+ queryOptions . no_tools && queryOptions . no_tools ?. includes ( 'docs' ) ? false
384+ : queryOptions . tools ?. includes ( 'docs' ) ? true
385+ : defaultOptions . includeDocsTools ;
386+
379387 return {
380388 client : queryOptions . client ?? defaultOptions . client ,
381389 includeDynamicTools : dynamicTools ,
382390 includeAllTools : allTools ,
383391 includeCodeTools : undefined ,
392+ includeDocsTools : docsTools ,
384393 filters,
385394 capabilities : clientCapabilities ,
386395 } ;
0 commit comments