Model Context Protocol (MCP) Client for Apify's Actors
Implementation of a model context protocol (MCP) client that connects to an MCP server using Server-Sent Events (SSE) and displays the conversation in a chat-like UI. It is a standalone Actor server designed for testing MCP servers over SSE. It uses Pay-per-event pricing model.
For more information, see the Model Context Protocol website or blogpost What is MCP and why does it matter?.
Once you run the Actor, check the output or logs for a link to the chat UI interface to interact with the MCP server. The URL will look like this and will vary each run:
Navigate to https://...apify.net to interact with chat-ui interface.
When connected to Actors-MCP-Server the Tester MCP Client provides an interactive chat interface where you can:
The Apify MCP Client connects to a running MCP server over Server-Sent Events (SSE) and it does the following:
/sse
.POST /message
.GET /sse
) that may include LLM output, and tool usage blocksYou can run the Tester MCP Client on Apify and connect it to any MCP server that supports SSE. Configuration can be done via the Apify UI or API by specifying parameters such as the MCP server URL, system prompt, and API key.
Once you run Actor, check the logs for a link to the Tester MCP Client UI, where you can interact with the MCP server: The URL will look like this and will be different from run to run:
INFO Navigate to https://......runs.apify.net in your browser to interact with an MCP server.
In progress 🚧
The Apify MCP Client is free to use. You only pay for LLM provider usage and resources consumed on the Apify platform.
This Actor uses a modern and flexible approach for AI Agents monetization and pricing called Pay-per-event.
Events charged:
When you use your own LLM provider API key, running the MCP Client for 1 hour with 128 MB memory costs approximately $0.06. With the Apify Free tier (no credit card required 💳), you can run the MCP Client for 80 hours per month. Definitely enough to test your MCP server!
Browser ← (SSE) → Tester MCP Client ← (SSE) → MCP Server
We create this chain to keep any custom bridging logic inside the Tester MCP Client, while leaving the main MCP Server unchanged. The browser uses SSE to communicate with the Tester MCP Client, and the Tester MCP Client relies on SSE to talk to the MCP Server. This separates extra client-side logic from the core server, making it easier to maintain and debug.
https://tester-mcp-client.apify.actor?token=YOUR-API-TOKEN
(or http://localhost:3000 if you are running it locally).index.html
and client.js
are served from the public/
directory.GET /sse
.POST /message
.sseEmit(role, content)
The Tester MCP Client Actor is open source and available on GitHub, allowing you to modify and develop it as needed.
Download the source code:
git clone https://github.com/apify/tester-mcp-client.git
cd tester-mcp-client
Install the dependencies:
npm install
Create a .env
file with the following content (refer to the .env.example
file for guidance):
APIFY_TOKEN=YOUR_APIFY_TOKEN
LLM_PROVIDER_API_KEY=YOUR_API_KEY
Default values for settings such as mcpSseUrl
, systemPrompt
, and others are defined in the const.ts
file. You can adjust these as needed for your development.
Run the client locally
npm start
Navigate to http://localhost:3000 in your browser to interact with the MCP server.
Happy chatting with Apify Actors!
The client does not support all MCP features, such as Prompts and Resource. Also, it does not store the conversation, so refreshing the page will clear the chat history.