Featured image of post MCP Client|Apify Beta

MCP Client|Apify Beta

The Apify beta MCP client connects the AI ​​agent to the Apify ecosystem, and supports connecting to the MCP server through SSE to achieve interaction with the Apify executor.

Core content:

  • Connect to the MCP server through the SSE protocol to achieve interaction with the Apify executor.
  • Provide a class chat interface to display tool calls and results.
  • The client is completely free, and only needs to pay for the LLM service provider usage fee and the Apify platform resource consumption.

This client connects AI agents to 5,000+ web crawlers and automated actuators (Actors) in the Apify ecosystem, supporting data extraction from websites, social media, search engines and maps.

πŸš€ Core functions

  • πŸ”Œ Connect to the MCP server via Server Push Event (SSE)
  • πŸ’¬ Provides class chat interface display tool calls and results
  • πŸ‡¦ Connect Apify MCP Server to call multiple Apify executors
  • πŸ’₯ Dynamically select tools based on context (server support is required)
  • πŸ”“ Use authorization headers to ensure secure connections with API keys
  • πŸͺŸ Open source project, can review code or submit improvements

🎯 Functional Scene

After connecting to [Executor-MCP-Server] (https://apify.com/apify/actors-mcp-server), you can use the interactive chat interface:

  • Query “The Most Popular Social Media Crawler Actuator”
  • Get “The Best Instagram Crawlers”
  • Consult “Which executor should be used to extract LinkedIn data”
  • Learn about “How to Crawl Google Search Results”

Client interface screenshot

πŸ“– How it works

The client connects to the MCP server through the SSE protocol and implements the following functions:

  • Establish an SSE connection through the /sse endpoint
  • Send user query via POST /message
  • Receive streaming responses in real time (via GET /sse), which may contain:
    • Large language model output
    • **Tool calls **Module
  • Call and display the dialogue flow according to the response coordination tool

βš™οΈHow to use

Standard Mode (Apify Platform)

Run the client on the Apify platform and connect to any SSE-enabled MCP server. Configure the following parameters via the UI or API:

  • MCP Server URL
  • System prompt words
  • API Key

After running, the log will generate a dynamic access link (different for each run):

1
INFO Please visit https://.........runs.apify.net to interact with the MCP server

Standby mode (Apify platform)

In development 🚧

πŸ’° Billing Plan

The client is completely free, only pay:

  • LLM service provider usage fee
  • Apify platform resource consumption

Adopt the [Bill by Event] (https://docs.apify.com/sdk/js/docs/guides/pay-per-event) mode:

  • Actuator startup fee (billed at 128MB memory unit)
  • Runtime fee (billed per 5 minutes/128MB unit)
  • Query response fee (billed according to the model, and the built-in API key can be exempted)

When using your own LLM key, 128MB of memory runs for about $0.06 for 1 hour. Apify free version (no credit card required) can run for 80 hours per month - fully meet testing needs!

πŸ“– Technical Architecture

1
Browser ← (SSE) β†’ Test Client ← (SSE) β†’ MCP Server

This link encapsulates customized bridge logic within the client, keeping the MCP server pure.

  1. Visit https://tester-mcp-client.apify.actor?token=API key (using http://localhost:3000 for local development)
  2. Load index.html and client.js from the public/ directory
  3. The browser creates SSE stream through GET /sse
  4. User query is submitted through POST /message
  5. Query processing flow:
    • Calling large language model
    • Call the tool on demand
  6. Return chunking results through sseEmit(role, content)

Local Development

The client has been open sourced to GitHub, and can be modified as needed:

1
2
3
git clone https://github.com/apify/tester-mcp-client.git
cd tester-mcp-client
npm install

Create a configuration file with reference to .env.example:

1
2
APIFY_TOKEN=Your token
LLM_PROVIDER_API_KEY=Your key

Run the development server:

1
npm start

Visit http://localhost:3000 to start the test.

**I wish you a happy conversation with the Apify actuator! **

β“˜ Notes

The current version does not support:

  • Advanced MCP features such as Prompts and Resource
  • Dialogue History Storage (refreshing the page will clear the record)

Reference Resources

Built with Hugo
Theme Stack designed by Jimmy