File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ const stdioCommand = new Command("stdio")
3333 store = new FilesystemStore ( ) ;
3434 indexNames = await store . list ( ) ;
3535 if ( indexNames . length === 0 ) {
36- console . error ( "No indexes found. Create an index first with 'context-connectors index'" ) ;
36+ console . error ( "Error: No indexes found." ) ;
37+ console . error ( "The MCP server requires at least one index to operate." ) ;
38+ console . error ( "Run 'ctxc index --help' to see how to create an index." ) ;
3739 process . exit ( 1 ) ;
3840 }
3941 }
@@ -82,6 +84,13 @@ const httpCommand = new Command("http")
8284 } else {
8385 // No --index: use default store, serve all
8486 store = new FilesystemStore ( ) ;
87+ const availableIndexes = await store . list ( ) ;
88+ if ( availableIndexes . length === 0 ) {
89+ console . error ( "Error: No indexes found." ) ;
90+ console . error ( "The MCP server requires at least one index to operate." ) ;
91+ console . error ( "Run 'ctxc index --help' to see how to create an index." ) ;
92+ process . exit ( 1 ) ;
93+ }
8594 indexNames = undefined ;
8695 }
8796
You can’t perform that action at this time.
0 commit comments