@@ -5,23 +5,17 @@ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/
55import { expect } from 'vitest' ;
66
77import { HelperTools } from '../src/const.js' ;
8- import type { ToolCategory } from '../src/types.js' ;
9-
10- export interface McpClientOptions {
11- actors ?: string [ ] ;
12- enableAddingActors ?: boolean ;
13- tools ?: ToolCategory [ ] ; // Tool categories to include
14- }
8+ import type { McpOptions } from '../src/input.js' ;
159
1610export async function createMcpSseClient (
1711 serverUrl : string ,
18- options ?: McpClientOptions ,
12+ options ?: Partial < McpOptions > ,
1913) : Promise < Client > {
2014 if ( ! process . env . APIFY_TOKEN ) {
2115 throw new Error ( 'APIFY_TOKEN environment variable is not set.' ) ;
2216 }
2317 const url = new URL ( serverUrl ) ;
24- const { actors, enableAddingActors, tools } = options || { } ;
18+ const { actors, enableAddingActors, tools, fullActorSchema } = options || { } ;
2519 if ( actors ) {
2620 url . searchParams . append ( 'actors' , actors . join ( ',' ) ) ;
2721 }
@@ -31,6 +25,9 @@ export async function createMcpSseClient(
3125 if ( tools && tools . length > 0 ) {
3226 url . searchParams . append ( 'tools' , tools . join ( ',' ) ) ;
3327 }
28+ if ( fullActorSchema !== undefined ) {
29+ url . searchParams . append ( 'fullActorSchema' , fullActorSchema . toString ( ) ) ;
30+ }
3431
3532 const transport = new SSEClientTransport (
3633 url ,
@@ -54,13 +51,13 @@ export async function createMcpSseClient(
5451
5552export async function createMcpStreamableClient (
5653 serverUrl : string ,
57- options ?: McpClientOptions ,
54+ options ?: Partial < McpOptions > ,
5855) : Promise < Client > {
5956 if ( ! process . env . APIFY_TOKEN ) {
6057 throw new Error ( 'APIFY_TOKEN environment variable is not set.' ) ;
6158 }
6259 const url = new URL ( serverUrl ) ;
63- const { actors, enableAddingActors, tools } = options || { } ;
60+ const { actors, enableAddingActors, tools, fullActorSchema } = options || { } ;
6461 if ( actors ) {
6562 url . searchParams . append ( 'actors' , actors . join ( ',' ) ) ;
6663 }
@@ -70,6 +67,9 @@ export async function createMcpStreamableClient(
7067 if ( tools && tools . length > 0 ) {
7168 url . searchParams . append ( 'tools' , tools . join ( ',' ) ) ;
7269 }
70+ if ( fullActorSchema !== undefined ) {
71+ url . searchParams . append ( 'fullActorSchema' , fullActorSchema . toString ( ) ) ;
72+ }
7373
7474 const transport = new StreamableHTTPClientTransport (
7575 url ,
0 commit comments