Skip to content

feat!: Add fetch-actor-mcp-tool-list - #1686

Merged
jirispilka merged 32 commits into
claude/exciting-volta-kzgq4tfrom
claude/exciting-volta-kzgq4t-1644
Oct 28, 2026
Merged

jirispilka merged 32 commits into
claude/exciting-volta-kzgq4tfrom
claude/exciting-volta-kzgq4t-1644

Conversation

@jirispilka

@jirispilka jirispilka commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1644. Part of #1620. Stacked on #1685.

Listing MCP tools could wake a billed standby run inside the otherwise static fetch-actor-details. Explicit discovery separates those operations and returns usable tool definitions.

Breaking: replace fetch-actor-details with output: {"mcpTools":true} with:

fetch-actor-mcp-tool-list {"actor":"apify/example-mcp-server"}

The new default tool returns remote definitions in structuredContent.tools, plus compact text with each tool's name, description, and input schema. Discovery is uncached, uses the caller's token, follows all pages, and fails without partial results if a page fails, the agreed 100-page limit is exceeded, or all pages together take longer than the 120-second tool-call timeout.

Payment-provider (x402, Skyfire) sessions are not served fetch-actor-mcp-tool-list, as with call-actor-mcp-tool; a call is still rejected.

fetch-actor-details makes no MCP connections. Its old flag and structuredContent.mcpTools are removed. An older request containing only output.mcpTools gets the default details sections.

Hosted migration: internal #871. Existing eval migrations: #1687.

Notes for reviewers (human-written)

This issue looks big, but mostly it contains tests

AI-assisted implementation and review with Claude Code and Codex.

Add fetch-actor-mcp-tool-list(actor): an uncached tools/list on an MCP
server Actor's server through the shared runOnActorMcpServer helper. It
follows nextCursor, fails the listing on a failed page, and returns the
remote tool definitions in structuredContent.tools with one line of text
per tool.

fetch-actor-details no longer connects to an MCP server: the output.mcpTools
flag, its structuredContent field and getMcpToolsMessage are removed. Its
description names fetch-actor-mcp-tool-list when served. Telemetry no longer
strips a ":toolName" suffix from the Actor name.

BREAKING CHANGE: fetch-actor-details drops output.mcpTools; use
fetch-actor-mcp-tool-list.

Part of #1644.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
- idempotentHint false: each call can start or charge a standby run.
- Past the page cap, say the listing stopped instead of suggesting the
  server is unavailable.
- Seed an MCP server Actor in the zero-connection test of
  fetch-actor-details, so a connection attempt would reach the spy.
- Note the selection change and the empty selective output in the README
  migration line; document the page cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f


Also run the fetch-actor-mcp-tool-list listing case as a deployment test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
claude and others added 8 commits October 26, 2026 15:42
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
`Client.listTools` compiles every remote output schema to cache validators, so one schema that does not compile
failed the whole listing. Send `tools/list` with `client.request` instead; the result is still validated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
…ol-list

- Leave fetch-actor-mcp-tool-list out of x402 and Skyfire sessions, like call-actor-mcp-tool; the call-time
  rejection stays and is tested for both tools.
- Reword the description's token and billing sentence like call-actor-mcp-tool.
- Drop the selective-output details case that only existed for mcpTools.
- Simplify the MCP server tests: record only request headers, drop the HelperTool casts, rename a test.
- Rename a stale variable, merge duplicate annotation comments, fix two docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
A rejected "apify/x:add" would otherwise be logged as the Actor name "apify/x:add".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
Each tools/list page had its own 120-second timeout, so a slow server could keep one listing going for up to
100 pages times 120 seconds. Each page now gets what is left of one 120-second budget. The discovery test calls
twice with the same token, so any cache fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
@jirispilka
jirispilka added this pull request to stack #1714 October 26, 2026 22:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
Match the call-actor-mcp-tool billing sentence, and drop the actor-name comment's claim that call-actor rejects
the legacy form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
- The deadline check throws the SDK's RequestTimeout McpError, so a listing that runs out of time is reported
  and logged like the SDK's own timeout instead of at error level. The check before each page is dropped:
  the previous page's check already leaves time.
- One deadline test with a controlled clock replaces two that repeated each other.
- Go back to the base's filter style for payment sessions, align comments with "Server Actor run", restore
  the details spy in afterEach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
send-server-actor-request is served only when selected by name since #1703; fetch-actor-mcp-tool-list stays a
default actors tool. The #1703 description test now expects the default line without mcpTools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f
@apify-service-account apify-service-account linked an issue Oct 27, 2026 that may be closed by this pull request
1 of 6 tasks
@jirispilka jirispilka added the beta Create beta prereleases label Oct 27, 2026 — with Claude
@pkg-pr-new

pkg-pr-new Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@apify/actors-mcp-server@1686

commit: affa937

@jirispilka
jirispilka marked this pull request as ready for review October 27, 2026 21:58

@MQ37 MQ37 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The error text and the cancel on timeout from #1685 apply to this tool too, since it uses the same helper and wrapper.

Tested at b722258 in podman: type-check, lint, unit suite (3467 passed) and the tool over MCP stdio against a mock API and a mock Actor MCP server.

Brings in 903a242: the 128-character tool name cap, the availability hint only for
unavailable servers, and the cancel on timeout, which fetch-actor-mcp-tool-list shares
through the same wrapper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6pji1VghkyFysbxkxpp3f

# Conflicts:
#	tests/unit/tools.actor_mcp_server.test.ts

@RobertCrupa RobertCrupa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jirispilka
jirispilka merged commit 691acaa into master Oct 28, 2026
19 checks passed
@jirispilka
jirispilka deleted the claude/exciting-volta-kzgq4t-1644 branch October 28, 2026 22:04
lukas-bekr added a commit that referenced this pull request Oct 28, 2026
Refs #1322. This drops the setup video dependency and points the README
to [mcp.apify.com](https://mcp.apify.com) and the [MCP
docs](https://docs.apify.com/mcp), as the issue proposes.

## What changed

The README is reorganized around someone who wants to connect an agent.
Setup comes first and contributor material last. The file goes from 608
to 480 lines, and long reference material (input-schema rules, backward
compatibility, per-client setup) sits in collapsed sections.

- **Top of the page:** a new full-width header image, a "Get config"
button for the configurator, and three badge rows (package, CI/license,
stars/Discord). Below them are a text H1, a one-sentence definition, the
approved "MCP and agent directories" company boilerplate, and one
paragraph on how the agent uses the server.
- **Setup:** a hosted quickstart, then per-client setup in collapsible
blocks. The order is Claude Code, ChatGPT, Cursor, VS Code and GitHub
Copilot, Claude, generic JSON, and local stdio. The syntax comes from
the configurator, the plugin docs, and `apify mcp install`. The ChatGPT
steps follow the new Plugins flow from the internal mcp.apify.com
update.
- **Remote (hosted) or local MCP server:** a comparison table, plus
`mcp-remote` for stdio-only clients.
- **How an agent uses Actors:** search, details, `call-actor`, and
`get-dataset-items`. It states that `call-actor` returns the run status
and storage IDs, not the items.
- **Tools, resources, and prompts:** keeps the helper tools list, the
✅/⚡/✅¹ legend, and the full tool table with the Category column. It
includes the MCP server Actor tools (`fetch-actor-mcp-tool-list`,
`call-actor-mcp-tool`) and `send-server-actor-request` from #1685 and
#1686. Tool annotations and prompts/resources are short subsections.
Tool selection and UI mode configuration follow, with the
backward-compatibility notes in a collapsible block.
- **Example prompts:** a use-case table (web research, search and fetch,
SERP, Google Maps leads, LinkedIn, reviews, Instagram, TikTok, Amazon,
RAG crawling), each row with the Actor the agent typically picks.
- **New sections:**
  - Pricing and limits, with agentic payments as a short callout.
- A FAQ, including "What is an MCP server?" and a Playwright MCP
comparison.
- **Kept:** Telemetry (with Sentry, the `_useCase` field, and the
opt-out flags), troubleshooting with the input-schema processing rules,
development, contributing, privacy, license, and learn more (which now
also holds the links to Apify docs for agents).
- **Removed:** the SSE migration notice and text that repeated other
sections.

Headings and FAQ wording follow keyword research on what people search
around MCP servers. Examples are "mcp server", "what is an mcp server",
"claude mcp", "claude connectors", "remote mcp server", and "playwright
mcp".

## Corrections to the current README

- **CI badge:** points at `on_master.yaml`, because `check.yaml` is
disabled. The Smithery badge is removed (it returns 500).
- **Docs links:** `/platform/integrations/...` links that redirect now
use their current URLs.
- **UI mode:** documents `auto` as the default, resolved from client
capabilities, and that UI mode adds separate `*-widget` tools next to
the base tools.
- **Limits:** the hosted rate limit is 20 requests per second. Spending
caps depend on the pricing model (`maxTotalChargeUsd` for pay-per-event,
`maxItems` for pay-per-result). Full-permission Actors need a one-time
approval rather than being excluded. Search returns only free and
pay-per-event Actors.
- **Input schemas:** only prefill and default values are copied into
descriptions, not enums.
- **Agentic payments:** only AGI is advertised. It accepts x402, MPP,
and Skyfire. The direct `payment=x402` and `payment=skyfire` routes are
being deprecated, so the README no longer documents them. The dead
Skyfire SSE URL and the `mcpc x402` walkthrough are gone. The docs stay
the source of truth for payment terms.
- **Rental Actors:** the old text said the hosted server offers them,
but `search-actors` excludes them on hosted and local alike.
- **Local dev server:** `pnpm run dev` with the token in a header
replaces `apify run -p`.
- **Proxied MCP tools:** names follow the code
(`username--actor-name--tool-name`), and `call-actor` addresses them as
`actorName:toolName`.

## Default Actors

The tool table lists the defaults from `src/const.ts` on master: RAG Web
Browser and Web Fetch. Web Search is presented as Web Fetch's pair in
the examples and the diagram, since it is set to become the default.
When it does, the intro sentence of the tools section and two table rows
need updating.

## Example prompt Actors

Most rows use Actors maintained by Apify (`apify/`, `compass/`,
`clockworks/`, `junglee/`). Two use cases deliberately point to popular
community Actors, because they have no Apify-maintained option: X
(`apidojo/tweet-scraper`) and LinkedIn (`harvestapi/*`). Every example
Actor is free or pay-per-event, so `search-actors` can find it. Flag
them if you'd rather keep the README to Apify-maintained Actors.

## Images

- `docs/apify-mcp-server-header.png` is a new full-width header in the
Apify event design style. It replaces the old light/dark logo pair.
- `docs/apify-mcp-server-diagram.png` is a new architecture diagram in
the Apify design system. It replaces `docs/apify-mcp-server.png`.
- `docs/mcp-configurator.png` is a current screenshot of the
mcp.apify.com client setup. It replaces `docs/mcp-clients.png`, which
listed clients the configurator no longer offers.
- The old image files stay in the repo in case anything outside the
README hotlinks them.
- A setup video placeholder is left as an HTML comment until a new video
exists.

## Overlap with #1329

#1329, from an external contributor, makes five changes. Here is how
each lands in this PR:

| #1329 change | In this PR |
| :--- | :--- |
| Smithery badge removed | Same |
| Docs link to docs.apify.com/mcp | Same |
| CI badge pointing at `check.yaml` | `on_master.yaml` instead, since
`check.yaml` is disabled |
| Proxied tool names `<actor-tool>__<tool-name>` | Corrected to the
format in `src/mcp/proxy.ts` |
| Invalid input returns the schema | Kept, scoped to `call-actor`
(direct Actor tools don't echo the schema) |

Thanks to the #1329 author for the first three fixes.

## Not shipped, so not claimed

MCP Tasks (#1119) and elicitations (#184). The Server Actor and MCP tool
changes from #1685 and #1686 are documented because they are on master,
although they are not in an npm release yet. The `tasks` category is
described as saved Actor tasks.

## AI disclosure

Drafted with Claude Code. Factual claims were checked against `master`,
the published npm package, docs.apify.com, agi.apify.com, and the live
configurator. Links were checked.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta Create beta prereleases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Server Actor tools for the server interface and MCP tools feat: Add fetch-actor-mcp-tool-list

4 participants