File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed
02.tools/01.problem.simple/src
03.resources/05.problem.linked/src
04.prompts/03.problem.completion/src Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,18 @@ import {
66import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
77import { test , expect } from 'vitest'
88
9- async function setupClient ( ) {
10- const client = new Client ( {
11- name : 'EpicMeTester' ,
12- version : '1.0.0' ,
13- } )
9+ async function setupClient ( { capabilities } : ClientOptions = { } ) {
10+ const client = new Client (
11+ {
12+ name : 'EpicMeTester' ,
13+ version : '1.0.0' ,
14+ } ,
15+ { capabilities } ,
16+ )
1417 const transport = new StdioClientTransport ( {
1518 command : 'tsx' ,
1619 args : [ 'src/index.ts' ] ,
20+ stderr : 'ignore' ,
1721 } )
1822 await client . connect ( transport )
1923 return {
Original file line number Diff line number Diff line change @@ -26,19 +26,19 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
2626 const transport = new StdioClientTransport ( {
2727 command : 'tsx' ,
2828 args : [ 'src/index.ts' ] ,
29+ stderr : 'ignore' ,
2930 env : {
3031 ...process . env ,
3132 EPIC_ME_DB_PATH ,
3233 } ,
33- stderr : 'ignore' ,
3434 } )
3535 await client . connect ( transport )
3636 return {
3737 client,
3838 EPIC_ME_DB_PATH ,
3939 async [ Symbol . asyncDispose ] ( ) {
4040 await client . transport ?. close ( )
41- await fs . unlink ( EPIC_ME_DB_PATH )
41+ await fs . unlink ( EPIC_ME_DB_PATH ) . catch ( ( ) => { } )
4242 } ,
4343 }
4444}
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ test('Prompts List', async () => {
162162} )
163163
164164test ( 'Prompt Argument Completion' , async ( ) => {
165- await using setup = await setupClient ( )
165+ await using setup = await setupClient ( { capabilities : { completion : true } } )
166166 const { client } = setup
167167 // First create some entries to have data for completion
168168 await client . callTool ( {
@@ -200,9 +200,9 @@ test('Prompt Argument Completion', async () => {
200200 invariant ( firstArg , '🚨 First prompt argument should exist' )
201201
202202 // Test completion functionality using the proper MCP SDK method
203- const completionResult = await ( client as any ) . completePrompt ( {
203+ const completionResult = await client . complete ( {
204204 ref : {
205- type : 'prompt' ,
205+ type : 'ref/ prompt' ,
206206 name : firstPrompt . name ,
207207 } ,
208208 argument : {
You can’t perform that action at this time.
0 commit comments