From 5802ad99aa30375f2b4b2259c38d025d3f95e388 Mon Sep 17 00:00:00 2001 From: Jiri Spilka Date: Fri, 7 Feb 2025 09:32:53 +0100 Subject: [PATCH 1/2] fix: Examples stdio and sse --- src/examples/clientSse.ts | 4 ++-- src/examples/clientStdio.ts | 2 +- src/main.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/examples/clientSse.ts b/src/examples/clientSse.ts index 53ab4ee0..78f27210 100644 --- a/src/examples/clientSse.ts +++ b/src/examples/clientSse.ts @@ -22,8 +22,8 @@ const dirname = path.dirname(filename); dotenv.config({ path: path.resolve(dirname, '../../.env') }); const SERVER_URL = 'https://actors-mcp-server.apify.actor/sse'; -// We need to change forward slash / to underscore _ in the tool name as Anthropic does not allow forward slashes in the tool name -const SELECTED_TOOL = 'apify_rag-web-browser'; +// We need to change forward slash / to underscore -- in the tool name as Anthropic does not allow forward slashes in the tool name +const SELECTED_TOOL = 'apify--rag-web-browser'; const QUERY = 'web browser for Anthropic'; if (!process.env.APIFY_TOKEN) { diff --git a/src/examples/clientStdio.ts b/src/examples/clientStdio.ts index e9c9c336..830c4075 100644 --- a/src/examples/clientStdio.ts +++ b/src/examples/clientStdio.ts @@ -24,7 +24,7 @@ const SERVER_PATH = path.resolve(dirname, '../../dist/index.js'); const NODE_PATH = execSync(process.platform === 'win32' ? 'where node' : 'which node').toString().trim(); const TOOLS = 'apify/rag-web-browser,lukaskrivka/google-maps-with-contact-details'; -const SELECTED_TOOL = 'apify_rag-web-browser'; // We need to change / to _ in the tool name +const SELECTED_TOOL = 'apify--rag-web-browser'; // We need to change / to _ in the tool name if (!process.env.APIFY_TOKEN) { console.error('APIFY_TOKEN is required but not set in the environment variables.'); diff --git a/src/main.ts b/src/main.ts index 00797f9c..81efa5c7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -61,7 +61,7 @@ app.route(Routes.ROOT) return; } try { - log.info(`Received GET message at: ${req.url}`); + log.info(`Received GET message at: ${Routes.ROOT}`); await processParamsAndUpdateTools(req.url); res.status(200).json({ message: `Actor is using Model Context Protocol. ${HELP_MESSAGE}` }).end(); } catch (error) { @@ -76,7 +76,7 @@ app.route(Routes.ROOT) app.route(Routes.SSE) .get(async (req: Request, res: Response) => { try { - log.info(`Received GET message at: ${req.url}`); + log.info(`Received GET message at: ${Routes.SSE}`); await processParamsAndUpdateTools(req.url); transport = new SSEServerTransport(Routes.MESSAGE, res); await mcpServer.connect(transport); From 305b6ae267ed506db855ff1cca15af6945dfe4ec Mon Sep 17 00:00:00 2001 From: Jiri Spilka Date: Fri, 7 Feb 2025 09:33:51 +0100 Subject: [PATCH 2/2] fix: log message --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 81efa5c7..194aaa82 100644 --- a/src/main.ts +++ b/src/main.ts @@ -89,7 +89,7 @@ app.route(Routes.SSE) app.route(Routes.MESSAGE) .post(async (req: Request, res: Response) => { try { - log.info(`Received POST message at: ${req.url}`); + log.info(`Received POST message at: ${Routes.MESSAGE}`); if (transport) { await transport.handlePostMessage(req, res); } else {