diff --git a/README.md b/README.md index 6fb52c44..99a21397 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,7 @@ To configure Claude Desktop to work with the MCP server, follow these steps. For - Look for the 🔌 icon to confirm that the Exa server is connected. 6. Open the Claude Desktop chat and ask "What Apify Actors I can use?" + ![Claude-desktop-with-Actors-MCP-server](https://raw.githubusercontent.com/apify/actors-mcp-server/refs/heads/master/docs/claude-desktop.png) 7. Examples diff --git a/docs/claude-desktop.png b/docs/claude-desktop.png index 5ba2c314..86b73619 100644 Binary files a/docs/claude-desktop.png and b/docs/claude-desktop.png differ diff --git a/src/examples/clientSse.ts b/src/examples/clientSse.ts index 8eb3bdc1..1e35a77f 100644 --- a/src/examples/clientSse.ts +++ b/src/examples/clientSse.ts @@ -3,7 +3,6 @@ * Connect to the MCP server using SSE transport and call a tool. * The Actors MCP Server will load default Actors. * - * !!! NOT WORKING - This example needs to be fixed as it does not work !!! */ import path from 'path'; @@ -15,15 +14,17 @@ import { CallToolResultSchema } from '@modelcontextprotocol/sdk/types.js'; import dotenv from 'dotenv'; import { EventSource } from 'eventsource'; +const REQUEST_TIMEOUT = 120_000; // 2 minutes // Resolve dirname equivalent in ES module const filename = fileURLToPath(import.meta.url); const dirname = path.dirname(filename); dotenv.config({ path: path.resolve(dirname, '../../.env') }); -const SERVER_URL = 'https://actors-mcp-server/sse'; +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'; +const QUERY = 'web browser for Anthropic'; if (!process.env.APIFY_TOKEN) { console.error('APIFY_TOKEN is required but not set in the environment variables.'); @@ -81,10 +82,11 @@ async function main(): Promise { } // Call a tool - console.log('Calling actor ...'); + console.log(`Calling actor ... ${SELECTED_TOOL}`); const result = await client.callTool( - { name: SELECTED_TOOL, arguments: { query: 'web browser for Anthropic' } }, + { name: SELECTED_TOOL, arguments: { query: QUERY } }, CallToolResultSchema, + { timeout: REQUEST_TIMEOUT }, ); console.log('Tool result:', JSON.stringify(result, null, 2)); } catch (error: unknown) {