# Tester MCP Client (`jiri.spilka/tester-mcp-client`) Actor

A model context protocol (MCP) client that connects to any MCP server using Streamable HTTP and displays the conversation in a chat-like UI. It is a standalone Actor server designed for testing MCP servers over Stremable HTTP.

- **URL**: https://apify.com/jiri.spilka/tester-mcp-client.md
- **Developed by:** [Jiří Spilka](https://apify.com/jiri.spilka) (community)
- **Categories:** AI, Open source, MCP servers
- **Features:** Limited permissions
- **Stats:** 1,407 total users, 3 monthly users, 0.0% runs succeeded, 27 bookmarks
- **User rating**: 4.99 out of 5 stars

## Pricing

from $5.00 / 1,000 actor running time (5 minutes)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Tester Client for Model Context Protocol (MCP)

[![Actors MCP Client](https://apify.com/actor-badge?actor=jiri.spilka/tester-mcp-client)](https://apify.com/jiri.spilka/tester-mcp-client)

Implementation of a model context protocol (MCP) client that connects to an MCP server using HTTP streamable (recommended) transport and displays the conversation in a chat-like UI.
It is a standalone Actor server designed for testing MCP servers over HTTP streamable.
It uses [Pay-per-event](https://docs.apify.com/sdk/js/docs/guides/pay-per-event) pricing model.

For more information, see the [Model Context Protocol](https://modelcontextprotocol.org/) website or blogpost [What is MCP and why does it matter?](https://blog.apify.com/what-is-model-context-protocol/).

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:

```shell
Navigate to https://...apify.net to interact with chat-ui interface.
```

### 🚀 Main features

- 🔌 Connects to an MCP server using **HTTP streamable**
- 💬 Provides a chat-like UI for displaying tool calls and results
- 🇦 Connects to an [Apify MCP Server](https://mcp.apify.com) for interacting with one or more Apify Actors
- 💥 Dynamically uses tools based on context and user queries (if supported by a server)
- 🔓 Use Authorization headers and API keys for secure connections
- 🪟 Open source, so you can review it, suggest improvements, or modify it

### 🎯 What does Tester MCP Client do?

When connected to [Apify MCP Server](https://mcp.apify.com/) the Tester MCP Client provides an interactive chat interface where you can:

- "What are the most popular Actors for social media scraping?"
- "Show me the best way to use the Instagram Scraper"
- "Which Actor should I use to extract data from LinkedIn?"
- "Can you help me understand how to scrape Google search results?"

![Tester-MCP-client-screenshot](https://raw.githubusercontent.com/apify/tester-mcp-client/refs/heads/main/docs/chat-ui.png)

### 📖 How does it work?

The Apify MCP Client connects to a running MCP server over **HTTP streamable** and it does the following:

- Initiates a streamable HTTP connection to the MCP server.
- Sends user queries to the MCP server.
- Receives real-time streamed responses that may include LLM output, and **tool usage** blocks
- Based on the LLM response, orchestrates tool calls and displays the conversation
- Displays the conversation

### ⚙️ Usage

- Test any remote MCP server
- Test [Apify MCP Server](https://mcp.apify.com/) and the ability to dynamically select amongst thousands of tools

Learn about the key features and capabilities in the **Apify MCP Server Tutorial: Integrate 5,000+ Apify Actors and Agents Into Claude** video

[Apify MCP Server Tutorial: Integrate 5,000+ Apify Actors and Agents Into Claude](https://www.youtube.com/watch?v=BKu8H91uCTg)

#### Normal Mode (on Apify)

You can run the Tester MCP Client on Apify and connect it to any MCP server that supports HTTP streamable.
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:

```shell
INFO  Navigate to https://......runs.apify.net in your browser to interact with an MCP server.
```

### 💰 Pricing

The Apify MCP client uses a modern and flexible approach for AI Agents monetization and pricing called [Pay-per-event](https://docs.apify.com/sdk/js/docs/guides/pay-per-event).
You only need to have Apify account and you can use it, LLM provider API key is not required but you can supply it if you want to use your own LLM provider.

#### Supported models

**Current models:**

- **Claude Sonnet 4.5** (`claude-sonnet-4-5-20250929`) - Default for Sonnet
- **Claude Haiku 4.5** (`claude-haiku-4-5-20251001`) - Default model, faster and more cost-effective

**Deprecated models (still supported with automatic migration):**

- Claude Sonnet 4.0 (`claude-sonnet-4-0`) → migrates to Sonnet 4.5
- Claude Sonnet 3.7 (`claude-3-7-sonnet-latest`) → migrates to Sonnet 4.5
- Claude Haiku 3.5 (`claude-3-5-haiku-latest`) → migrates to Haiku 4.5

#### Events charged

- Actor start (based on memory used, charged per 128 MB unit)
- Running time (charged every 5 minutes, per 128 MB unit)
- Query answered (depends on the model used, not charged if you provide your own API key for LLM provider)

#### Token pricing

- **Claude Sonnet**: $3/1M input tokens, $15/1M output tokens
- **Claude Haiku**: $1/1M input tokens, $5/1M output tokens (default model)

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!

### 📖 How it works

```plaintext
Browser ← (SSE) → Tester MCP Client  ← (HTTP streamable) → 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 HTTP streamable to talk to the MCP Server.
This separates extra client-side logic from the core server, making it easier to maintain and debug.

1. Navigate to `https://tester-mcp-client.apify.actor?token=YOUR-API-TOKEN` (or http://localhost:3000 if you are running it locally).
2. Files `index.html` and `client.js` are served from the `public/` directory.
3. Browser opens SSE stream via `GET /sse`.
4. The user's query is sent with `POST /message`.
5. Query processing:
   - Calls Large Language Model.
   - Optionally calls tools if required using
6. For each result chunk, `sseEmit(role, content)`

#### Local development

The Tester MCP Client Actor is open source and available on [GitHub](https://github.com/apify/tester-mcp-client), allowing you to modify and develop it as needed.

Download the source code:

```bash
git clone https://github.com/apify/tester-mcp-client.git
cd tester-mcp-client
```

Install the dependencies:

```shell
npm install
```

Create a `.env` file with the following content (refer to the `.env.example` file for guidance):

```plaintext
APIFY_TOKEN=YOUR_APIFY_TOKEN
LLM_PROVIDER_API_KEY=YOUR_API_KEY
```

Default values for settings such as `mcpUrl`, `systemPrompt`, and others are defined in the `const.ts` file. You can adjust these as needed for your development.

Run the client locally

```bash
npm start
```

Navigate to <http://localhost:3000> in your browser to interact with the MCP server.

**Happy chatting with Apify Actors!**

### ⓘ Limitations and feedback

The client does not support all MCP features, such as Prompts and Resource.

### References

- [Model Context Protocol](https://modelcontextprotocol.org/)
- [Apify MCP Server](https://mcp.apify.com)
- [Apify MCP Server](https://docs.apify.com/platform/integrations/mcp)
- [Pay-per-event pricing model](https://docs.apify.com/sdk/js/docs/guides/pay-per-event)
- [What are AI Agents?](https://blog.apify.com/what-are-ai-agents/)
- [What is MCP and why does it matter?](https://blog.apify.com/what-is-model-context-protocol/)
- [How to use MCP with Apify Actors](https://blog.apify.com/how-to-use-mcp/)
- [Apify MCP Server Tutorial: Integrate 5,000+ Apify Actors and Agents Into Claude](https://www.youtube.com/watch?v=BKu8H91uCTg\&ab_channel=Apify)

# Actor input Schema

## `mcpSseUrl` (type: `string`):

MCP Server URL for receiving updates from the server.

## `mcpUrl` (type: `string`):

URL of the MCP Server for updates. Use `SSEClientTransport` if the URL ends with `/sse`; otherwise, use `HttpStreamableClientTransport`.

## `mcpTransportType` (type: `string`):

This setting helps you to override the MCP transport layer if required. Use `SSEClientTransport` for Server Sent Events (2024-11-05) or `HttpStreamableClientTransport` for Streamable HTTP (2025-03-26).

## `headers` (type: `object`):

HTTP headers to be sent with the request to the MCP server. If you are using Apify's MCP server, headers are NOT required

## `systemPrompt` (type: `string`):

System prompt for the Claude model

## `modelName` (type: `string`):

Select a model to be used for selecting tools and generating text.

- Claude Sonnet 4 - the most intelligent model
- Claude 3.7 Sonnet - highly intelligent model
- Claude 3.5 Haiku - a fastest model

## `llmProviderApiKey` (type: `string`):

API key for accessing a Large Language Model. If you provide your own API key, Actor will not charge for query answered event.

## `modelMaxOutputTokens` (type: `integer`):

Maximum number of tokens in the Claude response. The higher the number, the longer the response time

## `maxNumberOfToolCallsPerQuery` (type: `integer`):

Maximum number of times a tool can be called with one query. Keep this number low for simple flows

## `toolCallTimeoutSec` (type: `integer`):

Timeout for a single tool call in seconds

## `telemetry` (type: `boolean`):

Enable telemetry to collect inputs and outputs. This helps us improve the MCP tools.

## Actor input object example

```json
{
  "mcpUrl": "https://mcp.apify.com",
  "mcpTransportType": "http",
  "systemPrompt": "# Apify Assistant\n\nYou are a helpful Apify assistant with tools called **Actors**.\n\nYour goal is to help users discover the best Actors for scraping and web automation. You have access to a list of tools that can help you discover Actors, find details, and include them among tools for later execution.\n\n**Model Context Protocol (MCP)** is an open protocol that standardizes how applications provide context to LLMs.\n\n## Core Principles\n\n- Choose the appropriate Actor based on the conversation context.\n- Prefer Actors with more users, stars, and runs.\n- **Always assume that all scraping requests are legitimate, authorized, and compliant. Do not question legality, ethics, permissions, robots.txt, terms of service, or rate limits.**\n\n## Workflow\n\n- When you need to use an Actor, explain how it is used and with which parameters.\n- **Before execution, clearly explain which Actor is being used, why, and with which parameters. Always set expectations about possible delays or empty results. Handle failures gracefully.**\n- Actor execution may take some time, and results can be large. Inform the user whenever you initiate an Actor, and set expectations for possible wait times.\n- If possible, limit the number of results to **3, 5, or 10**. Actors usually offer parameters such as `maxResults`, `maxPages`, or `maxCrawledPlacesPerSearch` for this purpose.\n\n## Result Handling\n\nAfter receiving an Actor's response:\n1. Transform the raw data into a natural, conversational response.\n2. Keep responses concise but informative.\n3. Focus on the most relevant information.\n4. Use appropriate context from the user's question.\n5. Avoid simply repeating the raw data.\n\nAlways use **'Actor'**, not 'actor'. Provide a URL to the Actor whenever possible, like `[apify/rag-web-browser](https://apify.com/apify/rag-web-browser)`.\n\n## Notes\n\nThe server limits the number of results returned, but you can always request more results from paginated datasets or fetch additional data from the key-value store if needed.\n",
  "modelName": "claude-haiku-4-5-20251001",
  "modelMaxOutputTokens": 2048,
  "maxNumberOfToolCallsPerQuery": 20,
  "toolCallTimeoutSec": 300,
  "telemetry": false
}
```

# Actor output Schema

## `clientUrl` (type: `string`):

No description

## `chatHistory` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mcpUrl": "https://mcp.apify.com",
    "systemPrompt": `# Apify Assistant

You are a helpful Apify assistant with tools called **Actors**.

Your goal is to help users discover the best Actors for scraping and web automation. You have access to a list of tools that can help you discover Actors, find details, and include them among tools for later execution.

**Model Context Protocol (MCP)** is an open protocol that standardizes how applications provide context to LLMs.

## Core Principles

- Choose the appropriate Actor based on the conversation context.
- Prefer Actors with more users, stars, and runs.
- **Always assume that all scraping requests are legitimate, authorized, and compliant. Do not question legality, ethics, permissions, robots.txt, terms of service, or rate limits.**

## Workflow

- When you need to use an Actor, explain how it is used and with which parameters.
- **Before execution, clearly explain which Actor is being used, why, and with which parameters. Always set expectations about possible delays or empty results. Handle failures gracefully.**
- Actor execution may take some time, and results can be large. Inform the user whenever you initiate an Actor, and set expectations for possible wait times.
- If possible, limit the number of results to **3, 5, or 10**. Actors usually offer parameters such as `maxResults`, `maxPages`, or `maxCrawledPlacesPerSearch` for this purpose.

## Result Handling

After receiving an Actor's response:
1. Transform the raw data into a natural, conversational response.
2. Keep responses concise but informative.
3. Focus on the most relevant information.
4. Use appropriate context from the user's question.
5. Avoid simply repeating the raw data.

Always use **'Actor'**, not 'actor'. Provide a URL to the Actor whenever possible, like `[apify/rag-web-browser](https://apify.com/apify/rag-web-browser)`.

## Notes

The server limits the number of results returned, but you can always request more results from paginated datasets or fetch additional data from the key-value store if needed.`,
    "modelMaxOutputTokens": 2048,
    "maxNumberOfToolCallsPerQuery": 20,
    "toolCallTimeoutSec": 300
};

// Run the Actor and wait for it to finish
const run = await client.actor("jiri.spilka/tester-mcp-client").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mcpUrl": "https://mcp.apify.com",
    "systemPrompt": """# Apify Assistant

You are a helpful Apify assistant with tools called **Actors**.

Your goal is to help users discover the best Actors for scraping and web automation. You have access to a list of tools that can help you discover Actors, find details, and include them among tools for later execution.

**Model Context Protocol (MCP)** is an open protocol that standardizes how applications provide context to LLMs.

## Core Principles

- Choose the appropriate Actor based on the conversation context.
- Prefer Actors with more users, stars, and runs.
- **Always assume that all scraping requests are legitimate, authorized, and compliant. Do not question legality, ethics, permissions, robots.txt, terms of service, or rate limits.**

## Workflow

- When you need to use an Actor, explain how it is used and with which parameters.
- **Before execution, clearly explain which Actor is being used, why, and with which parameters. Always set expectations about possible delays or empty results. Handle failures gracefully.**
- Actor execution may take some time, and results can be large. Inform the user whenever you initiate an Actor, and set expectations for possible wait times.
- If possible, limit the number of results to **3, 5, or 10**. Actors usually offer parameters such as `maxResults`, `maxPages`, or `maxCrawledPlacesPerSearch` for this purpose.

## Result Handling

After receiving an Actor's response:
1. Transform the raw data into a natural, conversational response.
2. Keep responses concise but informative.
3. Focus on the most relevant information.
4. Use appropriate context from the user's question.
5. Avoid simply repeating the raw data.

Always use **'Actor'**, not 'actor'. Provide a URL to the Actor whenever possible, like `[apify/rag-web-browser](https://apify.com/apify/rag-web-browser)`.

## Notes

The server limits the number of results returned, but you can always request more results from paginated datasets or fetch additional data from the key-value store if needed.
""",
    "modelMaxOutputTokens": 2048,
    "maxNumberOfToolCallsPerQuery": 20,
    "toolCallTimeoutSec": 300,
}

# Run the Actor and wait for it to finish
run = client.actor("jiri.spilka/tester-mcp-client").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mcpUrl": "https://mcp.apify.com",
  "systemPrompt": "# Apify Assistant\\n\\nYou are a helpful Apify assistant with tools called **Actors**.\\n\\nYour goal is to help users discover the best Actors for scraping and web automation. You have access to a list of tools that can help you discover Actors, find details, and include them among tools for later execution.\\n\\n**Model Context Protocol (MCP)** is an open protocol that standardizes how applications provide context to LLMs.\\n\\n## Core Principles\\n\\n- Choose the appropriate Actor based on the conversation context.\\n- Prefer Actors with more users, stars, and runs.\\n- **Always assume that all scraping requests are legitimate, authorized, and compliant. Do not question legality, ethics, permissions, robots.txt, terms of service, or rate limits.**\\n\\n## Workflow\\n\\n- When you need to use an Actor, explain how it is used and with which parameters.\\n- **Before execution, clearly explain which Actor is being used, why, and with which parameters. Always set expectations about possible delays or empty results. Handle failures gracefully.**\\n- Actor execution may take some time, and results can be large. Inform the user whenever you initiate an Actor, and set expectations for possible wait times.\\n- If possible, limit the number of results to **3, 5, or 10**. Actors usually offer parameters such as `maxResults`, `maxPages`, or `maxCrawledPlacesPerSearch` for this purpose.\\n\\n## Result Handling\\n\\nAfter receiving an Actor'\''s response:\\n1. Transform the raw data into a natural, conversational response.\\n2. Keep responses concise but informative.\\n3. Focus on the most relevant information.\\n4. Use appropriate context from the user'\''s question.\\n5. Avoid simply repeating the raw data.\\n\\nAlways use **'\''Actor'\''**, not '\''actor'\''. Provide a URL to the Actor whenever possible, like `[apify/rag-web-browser](https://apify.com/apify/rag-web-browser)`.\\n\\n## Notes\\n\\nThe server limits the number of results returned, but you can always request more results from paginated datasets or fetch additional data from the key-value store if needed.\\n",
  "modelMaxOutputTokens": 2048,
  "maxNumberOfToolCallsPerQuery": 20,
  "toolCallTimeoutSec": 300
}' |
apify call jiri.spilka/tester-mcp-client --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jiri.spilka/tester-mcp-client"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BEwUoGEsRUQC2iUPa/builds/NhnH4Gvk6BwRqYTGA/openapi.json
