File tree Expand file tree Collapse file tree 7 files changed +11
-7
lines changed
Expand file tree Collapse file tree 7 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-
358358
359359` ` ` bash
360360export APIFY_TOKEN=your-apify-token
361- npx @modelcontextprotocol/inspector node ./dist/index .js
361+ npx @modelcontextprotocol/inspector node ./dist/stdio .js
362362` ` `
363363
364364Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-
358358
359359` ` ` bash
360360export APIFY_TOKEN=your-apify-token
361- npx @modelcontextprotocol/inspector node ./dist/index .js
361+ npx @modelcontextprotocol/inspector node ./dist/stdio .js
362362` ` `
363363
364364Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Original file line number Diff line number Diff line change 6262 "lint:fix" : " eslint . --fix" ,
6363 "build" : " tsc" ,
6464 "watch" : " tsc --watch" ,
65- "inspector" : " npx @modelcontextprotocol/inspector dist/index .js" ,
65+ "inspector" : " npx @modelcontextprotocol/inspector dist/stdio .js" ,
6666 "test" : " vitest run"
6767 },
6868 "author" : " Apify" ,
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const filename = fileURLToPath(import.meta.url);
2222const dirname = path . dirname ( filename ) ;
2323
2424dotenv . config ( { path : path . resolve ( dirname , '../../.env' ) } ) ;
25- const SERVER_PATH = path . resolve ( dirname , '../../dist/index .js' ) ;
25+ const SERVER_PATH = path . resolve ( dirname , '../../dist/stdio .js' ) ;
2626const NODE_PATH = execSync ( process . platform === 'win32' ? 'where node' : 'which node' ) . toString ( ) . trim ( ) ;
2727
2828const TOOLS = 'apify/rag-web-browser,lukaskrivka/google-maps-with-contact-details' ;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ const MAX_TOKENS = 2048; // Maximum tokens for Claude response
4141// const CLAUDE_MODEL = 'claude-3-5-haiku-20241022'; // a fastest model
4242const CLAUDE_MODEL = 'claude-3-haiku-20240307' ; // a fastest and most compact model for near-instant responsiveness
4343const DEBUG = true ;
44- const DEBUG_SERVER_PATH = path . resolve ( dirname , '../../dist/index .js' ) ;
44+ const DEBUG_SERVER_PATH = path . resolve ( dirname , '../../dist/stdio .js' ) ;
4545
4646const NODE_PATH = execSync ( 'which node' ) . toString ( ) . trim ( ) ;
4747
Original file line number Diff line number Diff line change @@ -173,7 +173,11 @@ export class ApifyMcpServer {
173173 * @throws {Error } - Throws an error if the tool is unknown or arguments are invalid.
174174 */
175175 this . server . setRequestHandler ( CallToolRequestSchema , async ( request ) => {
176- const { name, arguments : args , apifyToken } = request . params ;
176+ const { name, arguments : args } = request . params ;
177+ const apifyToken = request . params . apifyToken || process . env . APIFY_TOKEN ;
178+ if ( ! apifyToken ) {
179+ throw new Error ( 'APIFY_TOKEN is required but not set in the environment variables or passed as a parameter.' ) ;
180+ }
177181
178182 const tool = Array . from ( this . tools . values ( ) )
179183 . find ( ( t ) => t . tool . name === name || ( t . type === 'actor' && ( t . tool as ActorTool ) . actorFullName === name ) ) ;
Original file line number Diff line number Diff line change 99 * --actors - A comma-separated list of actor full names to add to the server.
1010 *
1111 * Example:
12- * node index .js --actors=apify/google-search-scraper,apify/instagram-scraper
12+ * node stdio .js --actors=apify/google-search-scraper,apify/instagram-scraper
1313 */
1414
1515import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js' ;
You can’t perform that action at this time.
0 commit comments