Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified docs/claude-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/examples/clientSse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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.');
Expand Down Expand Up @@ -81,10 +82,11 @@ async function main(): Promise<void> {
}

// 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) {
Expand Down
Loading