{
  "canonical_name": "apify/apify-mcp-server",
  "compilation_id": "pack_0de0b06bc3044e738a154e3e62fc163d",
  "created_at": "2026-05-22T10:54:21.455904+00:00",
  "created_by": "project-pack-compiler",
  "feedback": {
    "carrier_selection_notes": [
      "viable_asset_types=mcp_config, recipe, host_instruction, eval, preflight",
      "recommended_asset_types=mcp_config, recipe, host_instruction, eval, preflight"
    ],
    "evidence_delta": {
      "confirmed_claims": [
        "identity_anchor_present",
        "capability_and_host_targets_present",
        "install_path_declared_or_better"
      ],
      "missing_required_fields": [],
      "must_verify_forwarded": [
        "Run or inspect `npx @apify/actors-mcp-server` in an isolated environment.",
        "Confirm the project exposes the claimed capability to at least one target host."
      ],
      "quickstart_execution_scope": "allowlisted_sandbox_smoke",
      "sandbox_command": "npx @apify/actors-mcp-server",
      "sandbox_container_image": "node:22-slim",
      "sandbox_execution_backend": "docker",
      "sandbox_planner_decision": "deterministic_isolated_install",
      "sandbox_validation_id": "sbx_3bb21aa07db9465eaa806d957e5cc863"
    },
    "feedback_event_type": "project_pack_compilation_feedback",
    "learning_candidate_reasons": [],
    "template_gaps": []
  },
  "identity": {
    "canonical_id": "project_1b4559d83fe8d98c9f9eea922165b108",
    "canonical_name": "apify/apify-mcp-server",
    "homepage_url": null,
    "license": "unknown",
    "repo_url": "https://github.com/apify/apify-mcp-server",
    "slug": "apify-mcp-server",
    "source_packet_id": "phit_5304e61c3cfa454cb3b54c0cde53dddf",
    "source_validation_id": "dval_3c0090282d844cdcb2eaae0b56d117e6"
  },
  "merchandising": {
    "best_for": "需要工具连接与集成能力，并使用 mcp_host的用户",
    "github_forks": 166,
    "github_stars": 1226,
    "one_liner_en": "The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.",
    "one_liner_zh": "The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.",
    "primary_category": {
      "category_id": "tool-integrations",
      "name_zh": "工具连接与集成",
      "name_en": "Tool Integrations",
      "confidence": "high",
      "reason": "semantic truth gate fallback rework"
    },
    "target_user": "使用 mcp_host 等宿主 AI 的用户",
    "title_en": "apify-mcp-server",
    "title_zh": "apify-mcp-server 能力包",
    "visible_tags": [
      {
        "type": "product_domain",
        "label_zh": "工具连接与集成",
        "label_en": "Tool Integrations",
        "tag_id": "product_domain-tool-integrations",
        "source": "semantic_truth_gate_rework"
      },
      {
        "type": "user_job",
        "label_zh": "Model Context Protocol",
        "label_en": "Model Context Protocol",
        "tag_id": "user_job-model-context-protocol",
        "source": "semantic_truth_gate_rework"
      },
      {
        "type": "core_capability",
        "label_zh": "MCP Server/Client",
        "label_en": "MCP Server/Client",
        "tag_id": "core_capability-mcp-server-client",
        "source": "semantic_truth_gate_rework"
      },
      {
        "type": "workflow_pattern",
        "label_zh": "宿主配置",
        "label_en": "Host Configuration",
        "tag_id": "workflow_pattern-host-configuration",
        "source": "semantic_truth_gate_rework"
      },
      {
        "type": "selection_signal",
        "label_zh": "权限边界",
        "label_en": "Permission Boundary",
        "tag_id": "selection_signal-permission-boundary",
        "source": "semantic_truth_gate_rework"
      }
    ]
  },
  "packet_id": "phit_5304e61c3cfa454cb3b54c0cde53dddf",
  "page_model": {
    "artifacts": {
      "artifact_slug": "apify-mcp-server",
      "files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json",
        "REPO_INSPECTION.md",
        "CAPABILITY_CONTRACT.json",
        "EVIDENCE_INDEX.json",
        "CLAIM_GRAPH.json"
      ],
      "required_files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json"
      ]
    },
    "detail": {
      "capability_source": "Project Hit Packet + DownstreamValidationResult",
      "commands": [
        {
          "command": "npx @apify/actors-mcp-server",
          "label": "Node.js / npx · 官方安装入口",
          "source": "https://github.com/apify/apify-mcp-server#readme",
          "verified": true
        }
      ],
      "display_tags": [
        "Tool Integrations",
        "Model Context Protocol",
        "MCP Server/Client",
        "Host Configuration",
        "Permission Boundary"
      ],
      "eyebrow": "Tool Integrations",
      "glance": [
        {
          "body": "判断自己是不是目标用户。",
          "label": "最适合谁",
          "value": "需要工具连接与集成能力，并使用 mcp_host的用户"
        },
        {
          "body": "先理解能力边界，再决定是否继续。",
          "label": "核心价值",
          "value": "The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store."
        },
        {
          "body": "未完成验证前保持审慎。",
          "label": "继续前",
          "value": "publish to Doramagic.ai project surfaces"
        }
      ],
      "guardrail_source": "Boundary & Risk Card",
      "guardrails": [
        {
          "body": "Prompt Preview 只展示流程，不证明项目已安装或运行。",
          "label": "Check 1",
          "value": "不要把试用当真实运行"
        },
        {
          "body": "mcp_host",
          "label": "Check 2",
          "value": "确认宿主兼容"
        },
        {
          "body": "publish to Doramagic.ai project surfaces",
          "label": "Check 3",
          "value": "先隔离验证"
        }
      ],
      "mode": "mcp_config, recipe, host_instruction, eval, preflight",
      "pitfall_log": {
        "items": [
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：fix: Allow calling MCP server actors in normal (one-shot) mode",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_be82315ed0f441ba9d942931d846d78c | https://github.com/apify/apify-mcp-server/issues/857 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`",
            "category": "配置坑",
            "evidence": [
              "community_evidence:github | cevd_8ec6ff22f24a4bb18b439177f4a8c270 | https://github.com/apify/apify-mcp-server/issues/892 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`",
            "user_impact": "可能影响升级、迁移或版本选择。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Do not include the rag web browser when ?payment=x402",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_23bafe4901554148896241f0a1e183b0 | https://github.com/apify/apify-mcp-server/issues/875 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：Do not include the rag web browser when ?payment=x402",
            "user_impact": "可能影响授权、密钥配置或安全边界。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Perf: `search-actors` tools returns huuuge `inputFields` object",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_af51cb3cbcb3479fbbdf27cedef734aa | https://github.com/apify/apify-mcp-server/issues/888 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：Perf: `search-actors` tools returns huuuge `inputFields` object",
            "user_impact": "可能影响授权、密钥配置或安全边界。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat(telemetry): track tool result size in bytes",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_9c2ef77c88914458910ae67d9f903931 | https://github.com/apify/apify-mcp-server/issues/838 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：feat(telemetry): track tool result size in bytes",
            "user_impact": "可能影响授权、密钥配置或安全边界。"
          },
          {
            "body": "仓库名 `apify-mcp-server` 与安装入口 `@apify/actors-mcp-server` 不完全一致。",
            "category": "身份坑",
            "evidence": [
              "identity.distribution | github_repo:911256711 | https://github.com/apify/apify-mcp-server | repo=apify-mcp-server; install=@apify/actors-mcp-server"
            ],
            "severity": "medium",
            "suggested_check": "在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。",
            "title": "仓库名和安装名不一致",
            "user_impact": "用户照着仓库名搜索包或照着包名找仓库时容易走错入口。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_9c05c17621e3443dad6175f21db31a34 | https://github.com/apify/apify-mcp-server/issues/894 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: Add structured output to remaining storage tools",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_c9b7c39f3e8f43e88ee52c2c8ae94b01 | https://github.com/apify/apify-mcp-server/issues/884 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：feat: Add structured output to remaining storage tools",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: migrate direct actor tools to canonical RunResponse shape",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_6b304ff2763849fe9b4678cc7bf9f5b2 | https://github.com/apify/apify-mcp-server/issues/852 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：feat: migrate direct actor tools to canonical RunResponse shape",
            "user_impact": "可能阻塞安装或首次运行。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：test: Consolidate duplicated MCP server test fixtures",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_5a7a24d9e8ce42468a7775a54dfa8ca6 | https://github.com/apify/apify-mcp-server/issues/847 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：test: Consolidate duplicated MCP server test fixtures",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个配置相关的待验证问题：feat: Dataset tools correctness and coverage",
            "category": "配置坑",
            "evidence": [
              "community_evidence:github | cevd_3fa86b498f66434a8f247c1b63fb56c9 | https://github.com/apify/apify-mcp-server/issues/784 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：feat: Dataset tools correctness and coverage",
            "user_impact": "可能阻塞安装或首次运行。"
          },
          {
            "body": "README/documentation is current enough for a first validation pass.",
            "category": "能力坑",
            "evidence": [
              "capability.assumptions | github_repo:911256711 | https://github.com/apify/apify-mcp-server | README/documentation is current enough for a first validation pass."
            ],
            "severity": "medium",
            "suggested_check": "将假设转成下游验证清单。",
            "title": "能力判断依赖假设",
            "user_impact": "假设不成立时，用户拿不到承诺的能力。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chore: Add mixpanel analytics for storage tools + error rates",
            "category": "运行坑",
            "evidence": [
              "community_evidence:github | cevd_03dbd8daa0c840d690bddb1d52e189c1 | https://github.com/apify/apify-mcp-server/issues/887 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：chore: Add mixpanel analytics for storage tools + error rates",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "未记录 last_activity_observed。",
            "category": "维护坑",
            "evidence": [
              "evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | last_activity_observed missing"
            ],
            "severity": "medium",
            "suggested_check": "补 GitHub 最近 commit、release、issue/PR 响应信号。",
            "title": "维护活跃度未知",
            "user_impact": "新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。"
          },
          {
            "body": "no_demo",
            "category": "安全/权限坑",
            "evidence": [
              "downstream_validation.risk_items | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium"
            ],
            "severity": "medium",
            "suggested_check": "进入安全/权限治理复核队列。",
            "title": "下游验证发现风险项",
            "user_impact": "下游已经要求复核，不能在页面中弱化。"
          },
          {
            "body": "no_demo",
            "category": "安全/权限坑",
            "evidence": [
              "risks.scoring_risks | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium"
            ],
            "severity": "medium",
            "suggested_check": "把风险写入边界卡，并确认是否需要人工复核。",
            "title": "存在评分风险",
            "user_impact": "风险会影响是否适合普通用户安装。"
          }
        ],
        "source": "ProjectPitfallLog + ProjectHitPacket + validation + community signals",
        "summary": "发现 22 个潜在踩坑项，其中 5 个为 high/blocking；最高优先级：安装坑 - 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode。",
        "title": "踩坑日志"
      },
      "snapshot": {
        "contributors": 30,
        "forks": 166,
        "license": "unknown",
        "note": "站点快照，非实时质量证明；用于开工前背景判断。",
        "stars": 1226
      },
      "source_url": "https://github.com/apify/apify-mcp-server",
      "steps": [
        {
          "body": "不安装项目，先体验能力节奏。",
          "code": "preview",
          "title": "先试 Prompt"
        },
        {
          "body": "理解输入、输出、失败模式和边界。",
          "code": "manual",
          "title": "读说明书"
        },
        {
          "body": "把上下文交给宿主 AI 继续工作。",
          "code": "context",
          "title": "带给 AI"
        },
        {
          "body": "进入主力环境前先完成安装入口与风险边界验证。",
          "code": "verify",
          "title": "沙箱验证"
        }
      ],
      "subtitle": "Model Context Protocol integration pack focused on server/client setup, host configuration, tool permissions, and rollback boundaries.",
      "title": "apify-mcp-server 能力包",
      "trial_prompt": "# apify-mcp-server - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for apify/apify-mcp-server.\n\nProject:\n- Name: apify-mcp-server\n- Repository: https://github.com/apify/apify-mcp-server\n- Summary: The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.\n- Host target: mcp_host\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. overview: Project Overview. Produce one small intermediate artifact and wait for confirmation.\n2. architecture-details: Core Architecture. Produce one small intermediate artifact and wait for confirmation.\n3. tool-system: Tool System. Produce one small intermediate artifact and wait for confirmation.\n4. actor-tools: Actor Tools. Produce one small intermediate artifact and wait for confirmation.\n5. payments-overview: Agentic Payments System. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/apify/apify-mcp-server\n- https://github.com/apify/apify-mcp-server#readme\n- .claude/skills/bug-triage/SKILL.md\n- .claude/skills/dig/SKILL.md\n- README.md\n- package.json\n- src/const.ts\n- src/mcp/server.ts\n- src/mcp/actors.ts\n- src/mcp/client.ts\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "voices": [
        {
          "body": "来源平台：github。github/github_issue: feat(telemetry): track tool result size in bytes（https://github.com/apify/apify-mcp-server/issues/838）；github/github_issue: chore(core): collapse array indices in dataset fields to prevent nextSte（https://github.com/apify/apify-mcp-server/issues/894）；github/github_issue: Remove the flat-fields back-compat shim from `_meta.x402` once all consu（https://github.com/apify/apify-mcp-server/issues/892）；github/github_issue: Do not include the rag web browser when ?payment=x402（https://github.com/apify/apify-mcp-server/issues/875）；github/github_issue: design: Calibrate get-dataset-schema output detail（https://github.com/apify/apify-mcp-server/issues/882）；github/github_issue: refactor: Extract storage tool helpers（https://github.com/apify/apify-mcp-server/issues/890）；github/github_issue: feat: Add structured output to remaining storage tools（https://github.com/apify/apify-mcp-server/issues/884）；github/github_issue: Perf: `search-actors` tools returns huuuge `inputFields` object（https://github.com/apify/apify-mcp-server/issues/888）；github/github_issue: [Bug]: Inconsistent `search-actors` schema and results（https://github.com/apify/apify-mcp-server/issues/889）；github/github_issue: fix: Allow calling MCP server actors in normal (one-shot) mode（https://github.com/apify/apify-mcp-server/issues/857）；github/github_issue: chore: Add mixpanel analytics for storage tools + error rates（https://github.com/apify/apify-mcp-server/issues/887）；github/github_issue: tools/list response contains `type: \"unknown\"` in an input schema — reje（https://github.com/apify/apify-mcp-server/issues/738）。这些是项目级外部声音，不作为单独质量证明。",
          "items": [
            {
              "kind": "github_issue",
              "source": "github",
              "title": "feat(telemetry): track tool result size in bytes",
              "url": "https://github.com/apify/apify-mcp-server/issues/838"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "chore(core): collapse array indices in dataset fields to prevent nextSte",
              "url": "https://github.com/apify/apify-mcp-server/issues/894"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Remove the flat-fields back-compat shim from `_meta.x402` once all consu",
              "url": "https://github.com/apify/apify-mcp-server/issues/892"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Do not include the rag web browser when ?payment=x402",
              "url": "https://github.com/apify/apify-mcp-server/issues/875"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "design: Calibrate get-dataset-schema output detail",
              "url": "https://github.com/apify/apify-mcp-server/issues/882"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "refactor: Extract storage tool helpers",
              "url": "https://github.com/apify/apify-mcp-server/issues/890"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "feat: Add structured output to remaining storage tools",
              "url": "https://github.com/apify/apify-mcp-server/issues/884"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Perf: `search-actors` tools returns huuuge `inputFields` object",
              "url": "https://github.com/apify/apify-mcp-server/issues/888"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "[Bug]: Inconsistent `search-actors` schema and results",
              "url": "https://github.com/apify/apify-mcp-server/issues/889"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "fix: Allow calling MCP server actors in normal (one-shot) mode",
              "url": "https://github.com/apify/apify-mcp-server/issues/857"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "chore: Add mixpanel analytics for storage tools + error rates",
              "url": "https://github.com/apify/apify-mcp-server/issues/887"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "tools/list response contains `type: \"unknown\"` in an input schema — reje",
              "url": "https://github.com/apify/apify-mcp-server/issues/738"
            }
          ],
          "status": "已收录 12 条来源",
          "title": "社区讨论"
        }
      ]
    },
    "homepage_card": {
      "category": "Tool Integrations",
      "desc": "Model Context Protocol integration pack focused on server/client setup, host configuration, tool permissions, and rollback boundaries.",
      "effort": "安装已验证",
      "forks": 166,
      "icon": "link",
      "name": "apify-mcp-server 能力包",
      "risk": "可发布",
      "slug": "apify-mcp-server",
      "stars": 1226,
      "tags": [
        "Tool Integrations",
        "Model Context Protocol",
        "MCP Server/Client",
        "Host Configuration",
        "Permission Boundary"
      ],
      "thumb": "gray",
      "type": "MCP 配置"
    },
    "manual": {
      "markdown": "# https://github.com/apify/apify-mcp-server Project Manual\n\nGenerated on: 2026-05-22 10:52:06 UTC\n\n## Table of Contents\n\n- [Project Overview](#overview)\n- [Core Architecture](#architecture-details)\n- [Transport Layer](#transport-layer)\n- [Tool System](#tool-system)\n- [Actor Tools](#actor-tools)\n- [Storage Access Tools](#storage-tools)\n- [Agentic Payments System](#payments-overview)\n- [Widget System](#widget-system)\n- [UI Components Library](#ui-components)\n- [Development Setup](#development-setup)\n\n<a id='overview'></a>\n\n## Project Overview\n\n### Related Pages\n\nRelated topics: [Core Architecture](#architecture-details), [Tool System](#tool-system)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n- [manifest.json](https://github.com/apify/apify-mcp-server/blob/main/manifest.json)\n- [CONTRIBUTING.md](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n- [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n- [res/algolia.md](https://github.com/apify/apify-mcp-server/blob/main/res/algolia.md)\n- [res/mcp_resources_analysis.md](https://github.com/apify/apify-mcp-server/blob/main/res/mcp_resources_analysis.md)\n- [res/index.md](https://github.com/apify/apify-mcp-server/blob/main/res/index.md)\n</details>\n\n# Project Overview\n\nApify MCP Server is a Model Context Protocol (MCP) server that provides AI assistants with access to Apify's platform capabilities. The server acts as a bridge between AI models and Apify's cloud infrastructure, enabling AI assistants to search and interact with Actors, documentation, and web content.\n\nSource: [README.md:1]()\n\n## What is the Apify MCP Server?\n\nThe Apify MCP Server implements the MCP specification to expose Apify platform features as tools that AI assistants can invoke. This allows AI models to:\n\n- Search and discover Actors on the Apify platform\n- Fetch detailed information about specific Actors\n- Search Apify and Crawlee documentation\n- Execute web scraping and automation tasks through the RAG web browser tool\n\nSource: [README.md:22-30]()\n\n## Architecture Overview\n\nThe project follows a monorepo structure with the following key directories:\n\n| Directory | Purpose |\n|-----------|---------|\n| `src/` | Core MCP server implementation |\n| `src/web/` | React UI widgets for MCP Apps (ChatGPT integration) |\n| `tests/unit/` | Unit tests for individual modules |\n| `tests/integration/` | Integration tests for full server functionality |\n| `res/` | Technical documentation and analysis |\n\nSource: [DEVELOPMENT.md:1-20]()\n\n### Server Components\n\nThe MCP server is built around the `ActorsMcpServer` class in `src/mcp/server.ts`, which wraps the low-level MCP `Server` API. The server exposes tools through request handlers for tool listing and tool calling.\n\n```mermaid\ngraph TD\n    A[AI Assistant] -->|MCP Protocol| B[ActorsMcpServer]\n    B -->|Tool Requests| C[Tool Registry]\n    C -->|Actors Tools| D[Actor Discovery & Execution]\n    C -->|Docs Tools| E[Algolia Search API]\n    C -->|RAG Tools| F[RAG Web Browser]\n    D -->|API Calls| G[Apify API]\n    E -->|Search Queries| H[Algolia]\n    F -->|Browser Actions| I[Crawlee/Puppeteer]\n```\n\nSource: [res/mcp_resources_analysis.md:1-15]()\n\n## Available Tools\n\nThe server provides the following tool categories and individual tools:\n\n### Default Tools\n\nWhen no query parameters are provided, the MCP server loads these tools by default:\n\n| Tool Category | Description |\n|---------------|-------------|\n| `actors` | Search and discover Actors on the Apify platform |\n| `docs` | Search Apify and Crawlee documentation |\n| `apify/rag-web-browser` | RAG-enabled web browsing for AI consumption |\n\nSource: [README.md:48-52]()\n\n### Tool Configuration\n\nTools can be configured via query parameters or command-line flags:\n\n| Configuration Method | Example |\n|----------------------|---------|\n| Hosted server URL | `https://mcp.apify.com?tools=actors,docs,apify/rag-web-browser` |\n| CLI flag | `npx @apify/actors-mcp-server --tools actors,docs` |\n| Minimal (single Actor) | `https://mcp.apify.com?tools=apify/my-actor` |\n\nSource: [README.md:55-75]()\n\n### Unauthenticated Access\n\nThe hosted server allows access without an API token when only specific tools are requested:\n\n| Allowed Tool | Description |\n|--------------|-------------|\n| `search-actors` | Search Actors without authentication |\n| `fetch-actor-details` | Get Actor details without authentication |\n| `search-apify-docs` | Search Apify docs without authentication |\n| `fetch-apify-docs` | Get doc pages without authentication |\n\nSource: [README.md:33-35]()\n\n## Deployment Modes\n\nThe Apify MCP Server supports multiple deployment configurations:\n\n### HTTP Streamable Mode\n\nRuns as an HTTP server compatible with the streamable HTTP transport:\n\n```bash\nexport APIFY_TOKEN=\"your-apify-token\"\nexport APIFY_META_ORIGIN=STANDBY\napify run -p\n```\n\nThe server exposes endpoints at `http://localhost:3001` by default.\n\nSource: [README.md:14-20]()\n\n### Standard Input/Output (stdio) Mode\n\nRuns as a subprocess communicating via stdin/stdout, suitable for local development and debugging:\n\n```bash\nnpx @modelcontextprotocol/inspector node ./dist/stdio.js\n```\n\nSource: [README.md:22-30]()\n\n### Claude Desktop Integration\n\nThe server can be configured as a Claude Desktop MCP tool:\n\n```json\n{\n  \"mcpServers\": {\n    \"apify\": {\n      \"command\": \"node\",\n      \"args\": [\"${__dirname}/dist/stdio.js\", \"--tools\", \"${user_config.tools}\"],\n      \"env\": {\n        \"APIFY_TOKEN\": \"${user_config.apify_token}\"\n      }\n    }\n  }\n}\n```\n\nSource: [manifest.json:35-45]()\n\n## User Configuration\n\nThe server accepts the following user configuration options:\n\n| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n| `apify_token` | string | Yes* | - | Apify API token from console.apify.com |\n| `tools` | string | No | `actors,docs,apify/rag-web-browser` | Comma-separated list of tool categories or specific Actors |\n\n*Required unless using unauthenticated access with specific tools.\n\nSource: [manifest.json:47-65]()\n\n## Documentation Search Architecture\n\nThe docs tool integrates with Algolia to provide search across Apify and Crawlee documentation:\n\n```mermaid\ngraph LR\n    A[Search Query] -->|Algolia API| B[Algolia Index]\n    B -->|Results| C[processAlgoliaResponse]\n    C -->|URLs with fragments| D[LLM Response]\n    \n    E[Fetch Tool] -->|URL Request| F[Documentation Site]\n    F -->|HTML Content| E\n```\n\n### Algolia Response Processing\n\nThe server processes Algolia responses differently based on the documentation source:\n\n| Source | URL Fragments | Content Field |\n|--------|---------------|---------------|\n| Apify docs | Supported | Always populated |\n| Crawlee docs | Not supported | Not available |\n\nSource: [res/algolia.md:1-50]()\n\n### URL Fragment Handling\n\nThe server embeds page anchors directly in returned URLs for section-specific navigation:\n\n```typescript\n// Returns ready-to-use URLs with anchors\n{ url: \"https://docs.apify.com/actors#build-actors\", content: \"...\" }\n```\n\nThis approach simplifies the LLM's ability to navigate to specific sections without complex URL reconstruction logic.\n\nSource: [res/algolia.md:55-70]()\n\n## MCP Resources\n\nThe server exposes MCP resources for specific use cases:\n\n| Resource Type | URI Pattern | Description |\n|---------------|-------------|-------------|\n| Skyfire usage guide | `file://readme.md` | Enabled when `skyfireMode` is true |\n| UI widgets | `ui://widget/*` | React widgets for OpenAI MCP Apps |\n\nSource: [res/mcp_resources_analysis.md:15-30]()\n\n## Development Setup\n\n### Prerequisites\n\n| Requirement | Version |\n|-------------|---------|\n| Node.js | >=20.0.0 |\n| pnpm | 11+ |\n\nSource: [DEVELOPMENT.md:25-30]()\n\n### Installation\n\n```bash\ncorepack enable     # enables pnpm via corepack\npnpm install        # installs root + src/web workspace packages\n```\n\nSource: [DEVELOPMENT.md:30-35]()\n\n### Building\n\n```bash\npnpm run build\n```\n\nBuilds the TypeScript source to JavaScript in the `dist/` directory.\n\nSource: [DEVELOPMENT.md:60-65]()\n\n## Testing\n\nThe project maintains multiple testing layers:\n\n| Test Layer | Command | Coverage |\n|------------|---------|----------|\n| Unit tests | `pnpm run test:unit` | Individual modules in isolation |\n| Integration tests | `pnpm run test:integration` | Full server over all transports |\n| LLM evals | CI only (apply `validated` label) | Multiple AI models via OpenRouter |\n\nSource: [DEVELOPMENT.md:8-20]()\n\n### Test Configuration\n\n| Environment Variable | Purpose |\n|---------------------|---------|\n| `APIFY_TOKEN` | Required for integration tests |\n| `PHOENIX_*` | Phoenix evaluation secrets |\n| `OPENROUTER_*` | OpenRouter API secrets |\n\nSource: [DEVELOPMENT.md:15-20]()\n\n## UI Widgets\n\nFor OpenAI MCP Apps integration, the server supports React-based UI widgets located in `src/web/`. Widgets are rendered based on tool output and require the server to run in UI mode:\n\n```\nhttps://mcp.apify.com?ui=true\n```\n\nOr set the environment variable `UI_MODE=true`.\n\nSource: [DEVELOPMENT.md:50-55]()\n\n### Widget Configuration\n\nWidgets must use the Apify design system tokens:\n\n| Property | Token Pattern | Example |\n|----------|---------------|---------|\n| Text color | `theme.color.{cat}.{prop}` | `theme.color.neutral.text` |\n| Background | `theme.color.{cat}.{prop}` | `theme.color.primary.background` |\n| Spacing | `theme.space.space{N}` | `theme.space.space16` |\n| Border radius | `theme.radius.radius{N}` | `theme.radius.radius8` |\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md:1-20]()\n\n## Contribution Guidelines\n\nThe project follows conventional commits for versioning and changelog generation:\n\n### Branch Naming\n\n```text\nfeat/add-dataset-tool\nfix/connection-timeout\nchore/update-dependencies\n```\n\n### Commit Format\n\n```\n<type>(<scope>): <description>\n\nTypes: feat, fix, refactor, chore, docs, test, etc.\n```\n\nBreaking changes are indicated with `!` after the scope.\n\nSource: [CONTRIBUTING.md:1-30]()\n\n## Compatibility\n\n| Platform | Claude Desktop Version | Node.js |\n|----------|----------------------|---------|\n| macOS (darwin) | >=0.2.16 | >=20.0.0 |\n| Windows (win32) | >=0.2.16 | >=20.0.0 |\n| Linux | >=0.2.16 | >=20.0.0 |\n\nSource: [manifest.json:20-28]()\n\n## Repository Structure\n\nThe codebase is split across two repositories:\n\n| Repository | Purpose |\n|------------|---------|\n| `apify-mcp-server` (this repo) | Core MCP logic and public code |\n| `apify-mcp-server-internal` | Hosted server deployment |\n\nChanges must be synchronized between both repositories. Canary releases are created by adding the `beta` tag to a PR branch.\n\nSource: [README.md:38-42]()\n\n---\n\n<a id='architecture-details'></a>\n\n## Core Architecture\n\n### Related Pages\n\nRelated topics: [Project Overview](#overview), [Transport Layer](#transport-layer)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n- [src/mcp/actors.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/actors.ts)\n- [src/mcp/client.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/client.ts)\n- [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts)\n- [src/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts)\n- [src/mcp/proxy.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/proxy.ts)\n</details>\n\n# Core Architecture\n\nThe Apify MCP Server implements a Model Context Protocol (MCP) server that exposes Apify platform capabilities as tools for Large Language Models (LLMs). The architecture uses the low-level MCP `Server` SDK with a custom tool management system, supporting both stdio and HTTP Streamable transports.\n\n## System Overview\n\nThe server acts as a bridge between LLMs and the Apify platform, enabling AI assistants to:\n\n- Search and discover Actors on the Apify platform\n- Execute Actors programmatically\n- Access Apify documentation\n- Manage Actor runs and retrieve results\n- Proxy external MCP servers through Actorized deployments\n\nSource: [src/mcp/server.ts:1-50](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n```mermaid\ngraph TD\n    subgraph \"Transport Layer\"\n        STDIO[stdio.ts<br/>Standard I/O]\n        HTTP[dev_server.ts<br/>HTTP Streamable]\n    end\n    \n    subgraph \"Core Server\"\n        AMS[ActorsMcpServer]\n        TM[Tool Manager<br/>Map&lt;string, ToolEntry&gt;]\n        TS[TaskStore]\n        AS[ActorStore]\n    end\n    \n    subgraph \"Tool Registry\"\n        HT[Helper Tools]\n        AT[Actor Tools]\n        AMT[Actor-MCP Proxy Tools]\n    end\n    \n    subgraph \"External Services\"\n        APIFY[Apify API]\n        APIClient[ApifyClient]\n    end\n    \n    STDIO --> AMS\n    HTTP --> AMS\n    AMS --> TM\n    AMS --> TS\n    AMS --> AS\n    TM --> HT\n    TM --> AT\n    TM --> AMT\n    AMS --> APIClient\n    APIClient --> APIFY\n```\n\n## High-Level Component Architecture\n\n### ActorsMcpServer (Central Coordinator)\n\nThe `ActorsMcpServer` class is the core component that orchestrates all MCP functionality:\n\n| Property | Type | Purpose |\n|----------|------|---------|\n| `server` | `Server` | Low-level MCP SDK server instance |\n| `tools` | `Map<string, ToolEntry>` | Tool registry for all registered tools |\n| `taskStore` | `TaskStore` | Tracks running and completed tasks |\n| `actorStore` | `ActorStore` | Caches Actor metadata and input schemas |\n| `serverMode` | `ServerMode` | Resolved server mode (default/apps) |\n| `options` | `ActorsMcpServerOptions` | Server configuration options |\n\nSource: [src/mcp/server.ts:280-320](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Tool Entry Types\n\nThe server manages three distinct tool types defined in the discriminated union:\n\n```typescript\ntype ToolEntry = HelperTool | ActorTool | ActorMcpTool;\n```\n\n| Tool Type | Type Discriminator | Purpose | Source |\n|-----------|-------------------|---------|--------|\n| `HelperTool` | `type: 'internal'` | Built-in server tools (search, docs) | [src/types.ts:135-145](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) |\n| `ActorTool` | `type: 'actor'` | Dynamic Actor-based tools | [src/types.ts:147-153](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) |\n| `ActorMcpTool` | `type: 'actor-mcp'` | External MCP server proxy via Actor | [src/types.ts:155-162](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) |\n\nSource: [src/types.ts:130-175](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts)\n\n## Transport Architecture\n\nThe server supports two transport mechanisms, selected based on deployment context:\n\n### Stdio Transport\n\nUsed for local CLI clients and the MCP Inspector. Communication occurs through standard input/output streams.\n\nSource: [src/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index.ts)\n\n### HTTP Streamable Transport\n\nUsed for hosted deployments at `mcp.apify.com`. Enables remote client connections with streaming response support.\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n| Transport | Use Case | Entry Point |\n|-----------|----------|-------------|\n| stdio | Local CLI, MCP Inspector | `stdio.ts` |\n| HTTP Streamable | Hosted server, remote clients | `dev_server.ts` |\n\n## Request Handler Architecture\n\nThe server uses low-level MCP SDK request handlers for all protocol operations:\n\n### Handler Registration Pattern\n\n```typescript\nserver.setRequestHandler(ListToolsRequestSchema, async () => { ... });\nserver.setRequestHandler(CallToolRequestSchema, async (request) => { ... });\nserver.setRequestHandler(ListResourcesRequestSchema, async () => { ... });\nserver.setRequestHandler(ReadResourceRequestSchema, async (request) => { ... });\n```\n\nSource: [src/mcp/server.ts:200-250](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Central Tool Dispatcher\n\nAll tool calls flow through a central dispatcher that routes based on tool type:\n\n```mermaid\ngraph LR\n    A[CallTool Request] --> B{Extract toolName}\n    B --> C{Lookup in tools Map}\n    C -->|HelperTool| D[Execute call function]\n    C -->|ActorTool| E[Call Apify API]\n    C -->|ActorMcpTool| F[Proxy to Actor-MCP]\n    D --> G[Return result]\n    E --> G\n    F --> G\n```\n\nSource: [src/mcp/server.ts:400-500](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Tool Lifecycle Management\n\n### Dynamic Tool Loading\n\nActors are loaded as tools through the `loadActorsAsTools()` method:\n\n1. Fetch Actor list from Apify API or configured Actor IDs\n2. Transform Actor metadata into `ActorTool` entries\n3. Upsert tools into the registry Map\n4. Send `notifications/tools/list_changed` to connected clients\n\nSource: [src/mcp/actors.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/actors.ts)\n\n### Tool Registration Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Server as ActorsMcpServer\n    participant API as Apify API\n    participant Store as tools Map\n    \n    Client->>Server: initialize (capabilities)\n    Server->>Server: resolveServerMode()\n    Server->>API: fetchActors() / getActorDetails()\n    API-->>Server: Actor metadata\n    Server->>Store: upsertTools()\n    Server-->>Client: tools/list response\n    Client->>Server: notifications/tools/list_changed\n```\n\n## Server Mode System\n\nThe server supports automatic mode detection based on client capabilities:\n\n| Mode | Trigger | Behavior |\n|------|---------|----------|\n| `default` | Non-MCP Apps clients | Standard tool responses |\n| `apps` | MCP Apps clients (`uiMode === 'openai'`) | Enhanced responses with widget metadata |\n\nSource: [src/mcp/server.ts:300-340](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Mode Auto-Detection\n\nThe `serverMode` property transitions from `'auto'` to either `'default'` or `'apps'` during the `initialize` request handler:\n\n```typescript\n// Preliminary value at construction\npublic serverMode: ServerMode;\n\n// Finalized inside initialize handler\nprivate serverModeResolved: boolean;\n```\n\nSource: [src/mcp/server.ts:310-325](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Resource System\n\nThe server implements MCP resources for UI widgets and documentation:\n\n### Resource Types\n\n| Resource Type | URI Pattern | Condition | Source |\n|---------------|-------------|-----------|--------|\n| Skyfire Guide | `file://readme.md` | `skyfireMode === true` | [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts) |\n| UI Widgets | `ui://widget/*.html` | `uiMode === 'openai'` | [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts) |\n\n### Resource Handler Implementation\n\n```typescript\nreturn {\n    listResources,\n    readResource,\n    listResourceTemplates: async () => ({ resourceTemplates: [] }),\n};\n```\n\nSource: [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts)\n\n## Actor-MCP Proxy Architecture\n\nExternal MCP servers can be proxied through the Apify platform using the `ActorMcpTool` type:\n\n```mermaid\ngraph LR\n    subgraph \"This Server\"\n        A[ActorMcpTool] --> B[proxy.ts]\n    end\n    \n    subgraph \"Apify Platform\"\n        B -->|callActor| C[Actor Container]\n    end\n    \n    subgraph \"Remote MCP Server\"\n        C -->|HTTP| D[External Server]\n        D -->|MCP Response| C\n    end\n    \n    C -->|Actor Result| B\n```\n\nSource: [src/mcp/proxy.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/proxy.ts)\n\n## Task Management\n\n### TaskStore\n\nThe `TaskStore` class manages long-running task execution:\n\n| Method | Purpose |\n|--------|---------|\n| `createTask()` | Initialize a new task |\n| `updateTask()` | Update task status/progress |\n| `getTask()` | Retrieve task details |\n| `listTasks()` | List all tasks |\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Progress Tracking\n\nLong-running operations support progress notifications via `createProgressTracker`:\n\n```typescript\nconst tracker = createProgressTracker(taskId, totalSteps);\ntracker.report(progress, total, message);\n```\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Client Configuration\n\n### ApifyClient Integration\n\nThe server uses the Apify JavaScript client for API communication:\n\n```typescript\nconst apifyClient = new ApifyClient({\n    token: apifyToken,\n});\n```\n\nSource: [src/mcp/client.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/client.ts)\n\n### Token Propagation\n\n| Location | Mechanism |\n|----------|------------|\n| HTTP Headers | `Authorization: Bearer <token>` |\n| MCP Meta | `_meta.apifyToken` in tool call |\n\nSource: [src/mcp/server.ts:630-650](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Configuration Options\n\nThe `ActorsMcpServerOptions` interface defines server configuration:\n\n| Option | Type | Default | Purpose |\n|--------|------|---------|---------|\n| `apifyToken` | `string` | Required | Apify API authentication |\n| `tools` | `string \\| string[]` | `default` | Tool categories/Actors to load |\n| `serverMode` | `ServerModeOption` | `'auto'` | Server mode override |\n| `skyfireMode` | `boolean` | `false` | Enable Skyfire-specific resources |\n| `uiMode` | `UiMode` | `'default'` | UI response format |\n\nSource: [src/mcp/server.ts:200-280](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Capability Advertisement\n\nThe server advertises the following MCP capabilities during initialization:\n\n```typescript\ncapabilities: {\n    logging: {},\n    prompts: { listChanged: false },\n    resources: options.skyfireMode ? { listChanged: false } : undefined,\n    tools: { listChanged: true },\n}\n```\n\nSource: [src/mcp/server.ts:210-218](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Entry Points\n\n| Entry Point | Transport | File |\n|-------------|-----------|------|\n| `dist/stdio.js` | stdio | `src/stdio.ts` |\n| `dist/index.js` (HTTP) | Streamable HTTP | `src/dev_server.ts` |\n\nSource: [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n---\n\n<a id='transport-layer'></a>\n\n## Transport Layer\n\n### Related Pages\n\nRelated topics: [Core Architecture](#architecture-details), [Development Setup](#development-setup)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts)\n- [src/server_card.ts](https://github.com/apify/apify-mcp-server/blob/main/src/server_card.ts)\n- [src/index_internals.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index_internals.ts)\n- [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n- [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n- [src/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index.ts)\n</details>\n\n# Transport Layer\n\nThe Apify MCP Server implements a dual-transport architecture that supports both local command-line clients and remote HTTP clients. This design allows the same core server logic to operate in different deployment scenarios while maintaining a consistent MCP protocol implementation.\n\n## Overview\n\nThe transport layer handles the communication between MCP clients and the `ActorsMcpServer` core. The server supports two primary transport mechanisms:\n\n| Transport Mode | Entry Point | Use Case | Protocol |\n|---------------|-------------|----------|----------|\n| **Stdio** | `stdio.ts` | Local CLI clients, Claude Code, MCP Inspector | Standard I/O via process stdin/stdout |\n| **HTTP Streamable** | `dev_server.ts` | Remote clients, hosted deployment at mcp.apify.com | Streamable HTTP with Server-Sent Events |\n\nSource: [src/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index.ts) · [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n## Architecture Diagram\n\n```mermaid\ngraph TB\n    subgraph \"Client Layer\"\n        CLI[CLI Client]\n        HTTP_CLIENT[HTTP Client]\n        MCP_INSPECTOR[MCP Inspector]\n    end\n\n    subgraph \"Transport Layer\"\n        STDIO[Stdio Transport<br/>stdio.ts]\n        HTTP[HTTP Transport<br/>dev_server.ts]\n        WEBSOCKET[WebSocket Support<br/>mcp/server.ts]\n    end\n\n    subgraph \"Core Server\"\n        SERVER[ActorsMcpServer<br/>server.ts]\n        TOOLS[Tool Handlers]\n        RESOURCES[Resource Handlers]\n        TASKS[Task Store]\n    end\n\n    CLI --> STDIO\n    HTTP_CLIENT --> HTTP\n    MCP_INSPECTOR -->|stdio mode| STDIO\n    MCP_INSPECTOR -->|http mode| HTTP\n\n    STDIO --> SERVER\n    HTTP --> SERVER\n    WEBSOCKET --> SERVER\n\n    SERVER --> TOOLS\n    SERVER --> RESOURCES\n    SERVER --> TASKS\n```\n\n## Stdio Transport\n\nThe Standard I/O transport is designed for local development and CLI-based clients. It communicates via process stdin and stdout using JSON-RPC messages.\n\n### Entry Point\n\nThe stdio transport is initialized in `src/stdio.ts`:\n\n```typescript\nimport { createStdioServer } from '@modelcontextprotocol/sdk/server/stdio';\n\n// Server initialization with transport\nconst server = new ActorsMcpServer(options);\nconst transport = createStdioServer();\nawait server.connect(transport);\n```\n\nSource: [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts)\n\n### Connection Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Stdio as Stdio Transport\n    participant Server as ActorsMcpServer\n\n    Note over Client,Stdio: Process startup\n    Stdio->>Server: Initialize connection\n    Server->>Stdio: MCP handshake (initialize)\n    Client->>Stdio: Initialize response\n    Stdio->>Server: Handshake complete\n\n    loop Message Loop\n        Client->>Stdio: JSON-RPC Request\n        Stdio->>Server: Forward request\n        Server->>Server: Process tool/resource/task\n        Server->>Stdio: JSON-RPC Response\n        Stdio->>Client: Response output\n    end\n\n    Note over Client,Stdio: Process termination\n    Client->>Stdio: SIGINT\n    Stdio->>Server: Cleanup\n```\n\n### Configuration\n\nThe stdio transport inherits server configuration from environment variables and constructor options:\n\n| Parameter | Source | Description |\n|-----------|--------|-------------|\n| `APIFY_TOKEN` | Environment | Apify API authentication token |\n| `serverMode` | Constructor | `\"default\"`, `\"apps\"`, or `\"auto\"` |\n| `skyfireMode` | Constructor | Enables Skyfire usage guide resource |\n\nSource: [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts) · [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## HTTP Streamable Transport\n\nThe HTTP transport enables remote client connections using the MCP Streamable HTTP specification. This is used for the hosted deployment at `mcp.apify.com`.\n\n### Server Implementation\n\nThe HTTP server is implemented using Express in `src/dev_server.ts`:\n\n```typescript\nimport express from 'express';\nimport { createServer } from 'http';\nimport { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/http';\n\nconst app = express();\nconst server = createServer(app);\n\n// Streamable HTTP transport with session management\nconst transport = new StreamableHTTPServerTransport({\n    sessionIdGenerator: () => crypto.randomUUID(),\n    onSession: initializeSession,\n});\n```\n\nSource: [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n### HTTP Endpoints\n\n| Endpoint | Method | Purpose |\n|----------|--------|---------|\n| `/mcp` | POST | JSON-RPC requests (tools, resources, tasks) |\n| `/mcp` | GET | Server-Sent Events for notifications |\n| `/health` | GET | Health check endpoint |\n\nSource: [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n### Session Management\n\n```mermaid\ngraph LR\n    A[Client] -->|1. POST /mcp| B{Has Session ID?}\n    B -->|No| C[Create New Session]\n    B -->|Yes| D[Find Existing Session]\n    C --> E[Initialize MCP]\n    D --> E\n    E --> F[Store in Map]\n    F --> G[Process Request]\n    G --> H[Return Response]\n```\n\nThe transport uses UUID-based session identifiers to maintain separate server instances per client connection.\n\nSource: [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n## Server Card\n\nThe `ServerCard` component provides metadata and capability information about the MCP server for discovery and documentation purposes.\n\n### ServerCard Structure\n\n```typescript\nexport interface ServerCard {\n    name: string;\n    version: string;\n    description: string;\n    homepageUrl: string;\n    repositoryUrl: string;\n    documentationUrl: string;\n    capabilities: ServerCapabilities;\n    auth?: AuthConfig;\n    configSchema?: Record<string, unknown>;\n}\n```\n\nSource: [src/server_card.ts](https://github.com/apify/apify-mcp-server/blob/main/src/server_card.ts)\n\n### Capability Declaration\n\nThe server advertises its capabilities during the MCP `initialize` handshake:\n\n```typescript\nconst capabilities = {\n    tools: { listChanged: true },\n    tasks: { list: true, cancel: true, requests: { tools: { call: true } } },\n    resources: {},\n    prompts: {},\n    logging: {},\n};\n```\n\nSource: [src/mcp/server.ts:146](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts#L146)\n\n## Internal Exports\n\nThe `index_internals.ts` module exposes internal components for testing and advanced usage scenarios:\n\n| Export | Type | Purpose |\n|--------|------|---------|\n| `ActorsMcpServer` | Class | Core MCP server implementation |\n| `createResourceService` | Function | Resource service factory |\n| `ToolEntry` | Type | Union type for all tool variants |\n| `ServerMode` | Enum | Server operating mode |\n\nSource: [src/index_internals.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index_internals.ts)\n\n## Server Modes\n\nThe transport layer operates differently based on the selected server mode:\n\n| Mode | Description | Transport Impact |\n|------|-------------|------------------|\n| `default` | Standard Apify tools | All tools available |\n| `apps` | OpenAI UI widgets mode | Additional UI widget resources |\n| `auto` | Capability-based detection | Mode resolved during initialize |\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Request Handler Wiring\n\nAll transports delegate to the same core request handlers registered in `ActorsMcpServer`:\n\n```mermaid\ngraph TD\n    T1[Stdio Transport] --> S[ActorsMcpServer]\n    T2[HTTP Transport] --> S\n    T3[WebSocket Transport] --> S\n\n    S --> H1[ListToolsRequestHandler]\n    S --> H2[CallToolRequestHandler]\n    S --> H3[ListResourcesRequestHandler]\n    S --> H4[ReadResourceRequestHandler]\n    S --> H5[ListTasksRequestHandler]\n    S --> H6[GetTaskRequestHandler]\n\n    H1 --> T[Tool Execution]\n    H2 --> T\n```\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts) · [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n## Integration with MCP SDK\n\nThe transport layer uses the official `@modelcontextprotocol/sdk` package for protocol implementation:\n\n| SDK Component | Usage |\n|--------------|-------|\n| `Server` | Low-level MCP protocol server |\n| `StreamableHTTPServerTransport` | HTTP transport implementation |\n| `createStdioServer` | Stdio transport factory |\n| `RequestHandlerExtra` | Request context wrapper |\n\nSource: [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts) · [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n## Testing Transport Layers\n\nThe project includes transport-specific integration tests:\n\n| Test File | Transport | Coverage |\n|-----------|-----------|----------|\n| `tests/integration/suite.ts` | All transports | Main test suite |\n| `stdio.ts` (in integration) | Stdio | Stdin/stdout messaging |\n| `http.ts` (in integration) | HTTP Streamable | REST endpoints |\n| `sse.ts` (in integration) | Server-Sent Events | Notification streaming |\n\nSource: [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md) · [tests/integration/](https://github.com/apify/apify-mcp-server/blob/main/tests/integration/)\n\n## Summary\n\nThe Apify MCP Server implements a transport-agnostic architecture where:\n\n1. **Stdio Transport** handles local CLI clients through stdin/stdout JSON-RPC messaging\n2. **HTTP Transport** enables remote access via Streamable HTTP with session management\n3. **Core Server** (`ActorsMcpServer`) remains independent of transport implementation\n4. **Capability negotiation** occurs during MCP initialize handshake\n5. **All transports** delegate to the same request handlers for tools, resources, and tasks\n\nThis separation allows the server to serve both local development needs and production hosted deployments while maintaining a single, testable codebase.\n\n---\n\n<a id='tool-system'></a>\n\n## Tool System\n\n### Related Pages\n\nRelated topics: [Actor Tools](#actor-tools), [Storage Access Tools](#storage-tools)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts) (primary server implementation)\n- [src/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) (tool type definitions)\n- [src/tools/common/search_apify_docs.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/search_apify_docs.ts) (tool implementation example)\n- [src/mcp/proxy.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/proxy.ts) (Actor-MCP proxy tools)\n- [res/mcp_server_refactor_analysis.md](https://github.com/apify/apify-mcp-server/blob/main/res/mcp_server_refactor_analysis.md) (architecture analysis)\n- [res/mcp_resources_analysis.md](https://github.com/apify/apify-mcp-server/blob/main/res/mcp_resources_analysis.md) (resources and tools overview)\n</details>\n\n# Tool System\n\nThe Tool System is the core component of the Apify MCP Server, enabling AI assistants to interact with Apify's platform capabilities through a standardized Model Context Protocol (MCP) interface. The system provides dynamic tool loading, registration, execution, and removal capabilities for three distinct tool types: internal helper tools, Actor tools, and Actor-MCP proxy tools.\n\n## Architecture Overview\n\nThe Tool System follows a centralized registration model where `ActorsMcpServer` manages all tool lifecycle operations. Tools are stored in a `Map<string, ToolEntry>` and exposed to MCP clients via request handlers. Source: [src/mcp/server.ts]()\n\n```mermaid\ngraph TD\n    subgraph \"MCP Client\"\n        A[Claude / VS Code]\n    end\n    \n    subgraph \"ActorsMcpServer\"\n        B[Server Instance]\n        C[Tool Registry Map]\n        D[setupToolHandlers]\n        E[Central Dispatcher]\n    end\n    \n    subgraph \"Tool Types\"\n        F[HelperTool]\n        G[ActorTool]\n        H[ActorMcpTool]\n    end\n    \n    A -->|tools/call| B\n    B --> D\n    D -->|route by type| E\n    E -->|internal| F\n    E -->|actor| G\n    E -->|actor-mcp| H\n    \n    C -.->|stores| F\n    C -.->|stores| G\n    C -.->|stores| H\n```\n\n## Tool Type Definitions\n\nThe system defines three tool types through discriminated unions in `src/types.ts`. Source: [src/types.ts:135-174]()\n\n| Tool Type | Description | Execution Mode |\n|-----------|-------------|-----------------|\n| `HelperTool` | Internal server tools with direct callback execution | Synchronous |\n| `ActorTool` | Apify Actor-based tools for scalable execution | Asynchronous via Actor API |\n| `ActorMcpTool` | External MCP server tools proxied through Apify | Delegated to origin server |\n\n### HelperTool\n\nInternal tools that execute directly within the server process:\n\n```typescript\ntype HelperTool = ToolBase & {\n    type: 'internal';\n    call: (toolArgs: InternalToolArgs) => Promise<object>;\n};\n```\n\nExamples include `search-actors`, `fetch-actor-details`, `search-apify-docs`, and `fetch-apify-docs`. Source: [README.md]()\n\n### ActorTool\n\nTools that invoke Apify Actors on the platform:\n\n```typescript\ntype ActorTool = ToolBase & {\n    type: 'actor';\n    actorFullName: string;\n    memoryMbytes?: number;\n};\n```\n\nThese tools launch Actors with configurable memory allocation for scalable cloud execution.\n\n### ActorMcpTool\n\nProxied tools from external MCP servers, enabling the Apify platform to bridge between MCP implementations:\n\n```typescript\ntype ActorMcpTool = ToolBase & {\n    type: 'actor-mcp';\n    originToolName: string;\n    actorId: string;\n    serverId: string;\n    serverUrl: string;\n};\n```\n\n## Tool Registration Flow\n\nTools are loaded and registered through a multi-stage process:\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Server as ActorsMcpServer\n    participant Loader as tools_loader.ts\n    participant Registry as Tool Registry\n    \n    Client->>Server: loadActorsAsTools()\n    Server->>Loader: loadToolsByCategory(tools)\n    Loader-->>Server: Tool definitions\n    Server->>Server: upsertTools(toolDefs)\n    Server->>Registry: Map.set(name, entry)\n    Server->>Client: sendToolListChanged()\n```\n\n### Dynamic Loading\n\nThe `loadActorsAsTools()` method handles dynamic tool loading based on configuration. When called, it:\n\n1. Resolves tool categories or specific Actor names from configuration\n2. Loads tool definitions from `src/utils/tools_loader.ts`\n3. Calls `upsertTools()` to register each tool\n4. Broadcasts `tools/list_changed` notification to connected clients Source: [res/mcp_server_refactor_analysis.md]()\n\n### Tool Removal\n\nThe `removeToolsByName()` method removes tools from the registry and notifies clients:\n\n```typescript\nremoveToolsByName(toolNames: string[]): void\n```\n\nThis operation:\n- Deletes tools from the internal `Map`\n- Calls `sendToolListChanged()` to update clients\n- Validates that tools exist before removal\n\n## Central Dispatcher Pattern\n\nThe current implementation uses a central dispatcher in `setupToolHandlers()` to route tool execution based on `tool.type`. Source: [src/mcp/server.ts]()\n\n```mermaid\ngraph LR\n    A[Request] --> B{tool.type}\n    B -->|internal| C[Execute callback]\n    B -->|actor| D[Create Actor client]\n    B -->|actor-mcp| E[Connect to MCP proxy]\n    \n    C --> F[Return result]\n    D --> G[Run Actor]\n    G --> F\n    E --> H[Forward request]\n    H --> F\n```\n\n## Tool Input Validation\n\nTool arguments are validated using JSON Schema with AJV before execution:\n\n```typescript\nconst validate = compileSchema(inputSchema);\nconst valid = validate(toolArgs);\n```\n\nThe `compileSchema` utility from `src/utils/ajv.js` provides schema compilation with custom error messages. Source: [src/tools/common/search_apify_docs.ts:12]()\n\n## Actor-MCP Proxy Integration\n\nThe proxy subsystem in `src/mcp/proxy.ts` enables tools from external MCP servers to be exposed through the Apify MCP interface. Source: [src/mcp/proxy.ts]()\n\nWhen an `ActorMcpTool` is called:\n1. The server connects to the origin MCP server\n2. The request is forwarded with original arguments\n3. Responses are transformed and returned to the client\n4. Progress notifications are propagated\n\n## Default Tools Configuration\n\nThe server loads default tools when no specific configuration is provided:\n\n| Tool | Category | Description |\n|------|----------|-------------|\n| `actors` | Category | Actor discovery and invocation tools |\n| `docs` | Category | Apify and Crawlee documentation search |\n| `apify/rag-web-browser` | Specific | RAG-enabled web browser for data extraction |\n\nSource: [README.md]()\n\n### Unauthenticated Access\n\nCertain tools are explicitly enabled for unauthenticated access:\n- `search-actors`\n- `fetch-actor-details`\n- `search-apify-docs`\n- `fetch-apify-docs`\n\nAccess is granted when the `tools` query parameter includes only these tools. Source: [README.md]()\n\n## Tool Registration Factory (Target Architecture)\n\nAn upcoming refactor will replace the central dispatcher with callback-per-tool registration patterns:\n\n```typescript\n// Internal tools\nregisterInternalTool(tool: InternalToolDefinition): RegisteredTool\n\n// Actor tools  \nregisterActorTool(actorDef: ActorDefinition): RegisteredTool\n\n// Actor-MCP proxy tools\nregisterActorMcpTool(mcpTool: ExternalTool, serverUrl: string, actorId: string): RegisteredTool\n```\n\nEach tool will be self-contained with its own callback, eliminating the need for type-checking in the dispatcher. Source: [res/mcp_server_refactor_analysis.md]()\n\n## CLI Configuration\n\nTools can be configured via command-line flags:\n\n```bash\n# Load default tools\nnpx @apify/actors-mcp-server --tools actors,docs,apify/rag-web-browser\n\n# Minimal single-Actor configuration\nnpx @apify/actors-mcp-server --tools apify/my-actor\n```\n\nSource: [README.md]()\n\n## Testing Strategy\n\nThe tool system is tested at multiple levels:\n\n| Test Level | Coverage |\n|------------|----------|\n| Unit tests | Individual tool execution, schema validation, registration patterns |\n| Integration tests | Full tool lifecycle, dynamic loading/removal, notifications |\n| Manual testing | MCP client verification, protocol compliance |\n\nSource: [DEVELOPMENT.md]()\n\n### Key Integration Tests\n\nIntegration tests in `tests/integration/suite.ts` verify:\n- `tools/list` returns correct tools with proper metadata\n- `tools/call` executes each tool type correctly\n- `tools/call` returns proper validation errors\n- `notifications/tools/list_changed` are sent on changes\n- `notifications/progress` work for long-running operations\n\nSource: [res/integration_test_coverage_audit.md]()\n\n## Future Refactoring\n\nThe Tool System is scheduled for migration from the low-level `Server` API to the high-level `McpServer` API:\n\n| Change | Impact |\n|--------|--------|\n| Replace `Server` with `McpServer` | Automatic tool management |\n| Remove central dispatcher | ~300 lines removed |\n| Convert JSON Schema to Zod | Native schema conversion via Zod v4 |\n| Callback-per-tool pattern | Self-contained execution logic |\n\nThis refactor will reduce complexity while preserving all existing functionality. Source: [res/mcp_server_refactor_analysis.md]()\n\n---\n\n<a id='actor-tools'></a>\n\n## Actor Tools\n\n### Related Pages\n\nRelated topics: [Tool System](#tool-system), [Storage Access Tools](#storage-tools)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/tools/actor_executor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/actor_executor.ts)\n- [src/tools/core/actor_tools_factory.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/actor_tools_factory.ts)\n- [src/tools/core/call_actor_common.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/call_actor_common.ts)\n- [src/tools/apps/call_actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/apps/call_actor.ts)\n- [src/tools/default/call_actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/default/call_actor.ts)\n- [src/utils/actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/actor.ts)\n</details>\n\n# Actor Tools\n\nActor Tools are the primary mechanism by which the Apify MCP Server enables AI assistants and MCP clients to execute Apify Actors. These tools bridge the gap between the Model Context Protocol (MCP) and Apify's Actor platform, allowing LLMs to programmatically invoke cloud programs, monitor their execution, and retrieve results.\n\n## Overview\n\nActor Tools serve as wrappers around Apify Actors, exposing them as callable MCP tools with proper input schema validation, result formatting, and execution tracking. The system supports three distinct tool types within the MCP server architecture:\n\n| Tool Type | Description | Type Discriminator |\n|-----------|-------------|-------------------|\n| **Internal Tools** | Built-in helper tools (e.g., `search-actors`, `fetch-actor-details`) | `'internal'` |\n| **Actor Tools** | Wrappers around Apify Actors | `'actor'` |\n| **Actor-MCP Tools** | Proxies to external MCP servers hosted as Actors | `'actor-mcp'` |\n\nSource: [src/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts)\n\n## Architecture\n\n### Tool Classification Hierarchy\n\n```mermaid\ngraph TD\n    A[Tools in MCP Server] --> B[Internal Tools]\n    A --> C[Actor Tools]\n    A --> D[Actor-MCP Tools]\n    \n    C --> C1[call-actor]\n    C --> C2[call-actor-widget]\n    C --> C3[Dynamic Actor Tools]\n    \n    D --> D1[Proxy MCP Tools]\n```\n\n### Actor Tool Execution Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Server as ActorsMcpServer\n    participant Factory as ActorToolsFactory\n    participant Executor as ActorExecutor\n    participant Apify as Apify Platform\n    \n    Client->>Server: Tool call request\n    Server->>Factory: Create/retrieve Actor tool\n    Factory->>Executor: Execute with input\n    Executor->>Apify: Start Actor run\n    Apify-->>Executor: Run metadata\n    Executor->>Apify: Wait for completion\n    Apify-->>Executor: Run results\n    Executor-->>Server: Formatted response\n    Server-->>Client: MCP response\n```\n\nSource: [src/tools/actor_executor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/actor_executor.ts)\n\n## Core Components\n\n### ActorExecutor\n\nThe `ActorExecutor` class is responsible for the actual execution of Apify Actors. It handles:\n\n- Actor invocation with input validation\n- Run lifecycle management (start, wait, abort)\n- Result retrieval from datasets or key-value stores\n- Error handling and response formatting\n\n**Key responsibilities:**\n\n| Responsibility | Description |\n|---------------|-------------|\n| `callActor()` | Initiates an Actor run with provided input |\n| `getActorOutput()` | Retrieves output from completed runs |\n| `abortActorRun()` | Terminates a running Actor |\n| Result formatting | Converts raw results to MCP-compatible responses |\n\nSource: [src/tools/actor_executor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/actor_executor.ts)\n\n### ActorToolsFactory\n\nThe `ActorToolsFactory` creates Actor tool definitions based on Actor metadata. It transforms Actor input schemas into MCP-compatible tool definitions with proper validation.\n\n**Factory outputs include:**\n\n| Output | Purpose |\n|--------|---------|\n| `name` | Tool identifier (e.g., `apify/web-scraper`) |\n| `description` | Human-readable tool description |\n| `inputSchema` | JSON Schema for tool arguments |\n| `ajvValidate` | Compiled AJV validator function |\n| `annotations` | MCP tool hints (readOnlyHint, openWorldHint, etc.) |\n\nSource: [src/tools/core/actor_tools_factory.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/actor_tools_factory.ts)\n\n### Call Actor Common Module\n\nThe `call_actor_common.ts` module provides shared execution logic used by all call-actor variants. It implements the pre-execution phase:\n\n```mermaid\ngraph LR\n    A[Input Validation] --> B[Actor Resolution]\n    B --> C[MCP Tool Name Parsing]\n    C --> D[Tool Call Execution]\n    D --> E[Response Formatting]\n```\n\n**Pre-execution steps:**\n\n1. **Input parsing**: Validates and extracts actor name, input, and call options\n2. **Actor resolution**: Resolves actor name to stable ID via Apify API\n3. **MCP tool routing**: Handles routing for Actor-MCP servers\n4. **Payment validation**: Checks if Actor requires payment before execution\n\nSource: [src/tools/core/call_actor_common.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/call_actor_common.ts)\n\n## Call Actor Implementations\n\nThe MCP server provides multiple implementations of the call-actor functionality, optimized for different client environments.\n\n### Default Call Actor\n\nThe default implementation (`src/tools/default/call_actor.ts`) provides standard execution with result previews. It is used by most MCP clients.\n\n**Characteristics:**\n\n| Property | Value |\n|----------|-------|\n| Mode | Default server mode |\n| Output | Limited preview (first 5 items) |\n| Widget support | None |\n| Use case | General-purpose Actor invocation |\n\n### Call Actor Widget (Apps Mode)\n\nThe widget variant (`src/tools/apps/call_actor.ts`) renders interactive MCP App widgets in the response, providing enhanced UX for clients that support it.\n\n**Characteristics:**\n\n| Property | Value |\n|----------|-------|\n| Mode | Apps server mode (`ui=true`) |\n| Output | Full results with widget rendering |\n| Widget support | Actor Run widgets, progress tracking |\n| Use case | MCP Apps-enabled clients |\n\n**Widget annotations applied:**\n\n```typescript\n{\n    title: 'Call Actor (widget)',\n    readOnlyHint: false,\n    destructiveHint: true,\n    idempotentHint: false,\n    openWorldHint: true,\n}\n```\n\nSource: [src/tools/apps/call_actor_widget.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/apps/call_actor_widget.ts)\n\n### Execution Modes Comparison\n\n| Feature | Default | Widget (Apps) |\n|---------|---------|---------------|\n| Server mode | `default` | `apps` |\n| Output preview | Limited | Full |\n| Progress notifications | Via logs | Via widget |\n| Run status tracking | Manual | Automatic |\n| UI rendering | Text only | Interactive widgets |\n\n## Actor Resolution\n\nThe resolution process maps human-readable actor names to stable actor IDs.\n\n```mermaid\ngraph TD\n    A[Input: Actor Name] --> B{User has rented Actor?}\n    B -->|Yes| C[Check rentedActorsIds]\n    B -->|No| D[Search Apify Store]\n    C --> E[Return rented Actor ID]\n    D --> F[Match by name/version]\n    F --> G[Return store Actor ID]\n    E --> H[Resolved Actor]\n    G --> H\n```\n\nSource: [src/utils/actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/actor.ts)\n\n### Resolution Strategy\n\n1. **User rented Actors**: Check if the actor name matches any Actor rented by the user\n2. **Apify Store**: Search public Actors for matching name\n3. **Version matching**: Support both explicit (`actorName@version`) and implicit versioning\n\n## Tool Annotations\n\nActor tools include MCP-compliant annotations to help clients and LLMs understand tool behavior:\n\n| Annotation | Description | Applied Value |\n|------------|-------------|---------------|\n| `title` | Short display name | Actor name (e.g., \"Call Actor\") |\n| `readOnlyHint` | Indicates read-only operation | `false` for call-actor |\n| `openWorldHint` | Indicates external network access | `true` (executes Actors) |\n| `destructiveHint` | Indicates destructive operation | `true` for call-actor |\n| `idempotentHint` | Indicates idempotent operation | `false` for call-actor |\n\nSource: [src/tools/apps/call_actor_widget.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/apps/call_actor_widget.ts)\n\n## Input Schema Handling\n\nActor tools dynamically generate input schemas from Actor definitions:\n\n```mermaid\ngraph TD\n    A[Actor Input Schema] --> B[Pruned Definition]\n    B --> C[JSON Schema]\n    C --> D[AJV Validator]\n    D --> E[MCP Tool Schema]\n```\n\n### Schema Pruning\n\nThe schema is pruned to include only fields the LLM needs to provide:\n\n| Field Type | Included | Reason |\n|------------|----------|--------|\n| Required fields | Yes | Necessary for execution |\n| Optional fields with defaults | No | Server applies defaults |\n| Hidden fields | No | Internal use only |\n\nSource: [src/utils/actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/actor.ts)\n\n## Error Handling\n\nActor tools implement robust error handling for various failure scenarios:\n\n| Error Type | Handling | Response |\n|------------|----------|----------|\n| Invalid input schema | AJV validation failure | Formatted error message |\n| Actor not found | Resolution returns error | Early response with error |\n| Payment required | Payment validation fails | Error with payment instructions |\n| Run timeout | Wait exceeds timeout | Partial results with warning |\n| Actor execution error | Run fails | Error details in response |\n\nSource: [src/tools/core/call_actor_common.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/call_actor_common.ts)\n\n## Dynamic Tool Loading\n\nThe system supports dynamic loading of Actors as tools:\n\n```mermaid\ngraph TD\n    A[Tool Configuration] --> B[Load Actors]\n    B --> C[Fetch Actor Definitions]\n    C --> D[Register Tools]\n    D --> E[Notify Tools Changed]\n    E --> F[MCP Client Updated]\n```\n\n**Loading methods:**\n\n| Method | Description |\n|--------|-------------|\n| `loadActorsAsTools()` | Load by actor IDs |\n| `loadToolsByName()` | Load by tool names |\n| `loadToolsFromUrl()` | Load from MCP server URL |\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Configuration\n\nActor tools respect the server's tools configuration parameter:\n\n```\n?tools=actors,docs,apify/rag-web-browser\n```\n\nWhen the `actors` category is included, all Actor-related tools become available, including the base `call-actor` tool and any dynamically loaded Actor tools.\n\n## See Also\n\n- [Internal Tools](./internal-tools.md) - Built-in helper tools\n- [Actor-MCP Proxy](./actor-mcp-proxy.md) - External MCP server integration\n- [Tool Annotations](./tool-annotations.md) - MCP tool metadata\n- [Server Modes](./server-modes.md) - Default vs Apps modes\n\n---\n\n<a id='storage-tools'></a>\n\n## Storage Access Tools\n\n### Related Pages\n\nRelated topics: [Actor Tools](#actor-tools)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/tools/common/get_dataset.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_dataset.ts)\n- [src/tools/common/get_dataset_items.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_dataset_items.ts)\n- [src/tools/common/get_dataset_schema.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_dataset_schema.ts)\n- [src/tools/common/get_key_value_store.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_key_value_store.ts)\n- [src/tools/common/get_key_value_store_record.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_key_value_store_record.ts)\n- [src/tools/common/get_actor_run_log.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_actor_run_log.ts)\n- [src/tools/common/run_collection.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/run_collection.ts)\n</details>\n\n# Storage Access Tools\n\nStorage Access Tools provide MCP (Model Context Protocol) clients with programmatic access to Apify's cloud storage infrastructure. These tools enable AI assistants and automated workflows to read datasets, key-value stores, and Actor run logs without requiring direct API integration.\n\n## Overview\n\nThe Apify MCP Server exposes storage resources through a collection of specialized tools that wrap the Apify API's storage endpoints. These tools follow the repository's established patterns:\n\n- Input validation via Zod schemas\n- Consistent response formatting via `buildMCPResponse()`\n- Payment-required guards for premium operations\n- Comprehensive error handling with user-friendly messages\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n## Architecture\n\n### Tool Classification\n\nStorage Access Tools fall into three categories based on the underlying Apify storage type:\n\n```mermaid\ngraph TD\n    A[Storage Access Tools] --> B[Dataset Tools]\n    A --> C[Key-Value Store Tools]\n    A --> D[Run Log Tools]\n    \n    B --> B1[get-dataset]\n    B --> B2[get-dataset-items]\n    B --> B3[get-dataset-schema]\n    \n    C --> C1[get-key-value-store]\n    C --> C2[get-key-value-store-record]\n    \n    D --> D1[get-actor-run-log]\n    D --> D2[run-collection]\n```\n\n### Data Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Server as ActorsMcpServer\n    participant Tool as Storage Tool\n    participant Apify as Apify API\n    \n    Client->>Server: Tool Request\n    Server->>Tool: call(toolArgs)\n    Tool->>Tool: Validate input with Zod\n    Tool->>Apify: API Request\n    Apify-->>Tool: Raw Storage Data\n    Tool->>Tool: Transform & Format\n    Tool-->>Server: MCP Response\n    Server-->>Client: Formatted Result\n```\n\n### Tool Entry Structure\n\nEach storage tool implements the `ToolEntry` interface with `type: 'internal'`:\n\n```typescript\nexport const exampleTool: ToolEntry = Object.freeze({\n    type: 'internal',\n    name: HelperTools.DATASET_GET_ITEMS,\n    description: 'Tool description...',\n    inputSchema: z.toJSONSchema(inputSchema),\n    outputSchema: datasetItemsOutputSchema,\n    ajvValidate: compileSchema(z.toJSONSchema(inputSchema)),\n    annotations: { /* tool annotations */ },\n    call: async (toolArgs: InternalToolArgs) => { /* implementation */ },\n});\n```\n\nSource: [src/tools/common/get_dataset_items.ts:39-62]()\n\n---\n\n## Dataset Tools\n\nDataset tools provide access to Apify's structured data storage. Datasets store results from Actor runs as JSON objects, supporting pagination, field selection, and schema inference.\n\n### Get Dataset\n\nRetrieves metadata about a specific dataset including item count, field statistics, and storage usage.\n\n**Tool Name:** `get-dataset`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `datasetId` | string | Yes | Dataset ID or name |\n\n**Response Format:**\n```json\n{\n  \"content\": [{\n    \"type\": \"text\",\n    \"text\": \"```json\\n{...dataset metadata...}\\n```\"\n  }]\n}\n```\n\n**Implementation Details:**\n\nThe tool first validates the `datasetId` parameter, then calls the Apify dataset API to fetch metadata. If the dataset is empty, it returns a friendly message rather than an error.\n\n```typescript\nif (datasetItems.length === 0) {\n    return { content: [{ type: 'text', text: `Dataset '${parsed.datasetId}' is empty.` }] };\n}\n```\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n### Get Dataset Items\n\nRetrieves actual data items from a dataset with support for pagination and field selection.\n\n**Tool Name:** `get-dataset-items`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `datasetId` | string | Yes | Dataset ID or name |\n| `offset` | integer | No | Number of items to skip (default: 0) |\n| `limit` | integer | No | Maximum items to return (default: 20, max: 10000) |\n| `fields` | string[] | No | Specific fields to return (supports dot notation) |\n| `clean` | boolean | No | Return clean data without metadata (default: true) |\n\n**Key Features:**\n\n- **Dot notation support**: Fields like `crawl.statusCode` extract nested values\n- **Auto-flattening**: Dot-notation fields are automatically flattened in output\n- **Metadata stripping**: Clean mode removes `_id`, `_createdAt`, `_index` fields\n\n**Output Schema:**\n\nThe tool returns dataset items with the following structure:\n\n```typescript\nconst datasetItemsOutputSchema = {\n    type: 'array' as const,\n    items: { type: 'object' as const }\n};\n```\n\nSource: [src/tools/common/get_dataset_items.ts:1-50]()\n\n### Get Dataset Schema\n\nInfers a JSON Schema from dataset items, useful for understanding data structure and enabling type-safe integrations.\n\n**Tool Name:** `get-dataset-schema`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `datasetId` | string | Yes | Dataset ID or name |\n| `limit` | integer | No | Max items to analyze (default: 100) |\n| `clean` | boolean | No | Exclude metadata fields (default: true) |\n\n**Implementation Details:**\n\nThe schema generation uses a shared utility that samples dataset items to infer field types:\n\n```typescript\nconst schema = generateSchemaFromItems(datasetItems, {\n    limit: parsed.limit,\n    clean: parsed.clean,\n});\n\nif (!schema) {\n    return buildMCPResponse({\n        texts: [`Failed to generate schema for dataset '${parsed.datasetId}'.`],\n        isError: true,\n        telemetry: { toolStatus: TOOL_STATUS.FAILED },\n    });\n}\n```\n\n**Output:** Returns a JSON Schema document describing all discovered fields and their types.\n\nSource: [src/tools/common/get_dataset_schema.ts:1-50]()\n\n---\n\n## Key-Value Store Tools\n\nKey-Value Store tools provide access to Apify's NoSQL storage for arbitrary data items, commonly used for Actor input/output, screenshots, and state persistence.\n\n### Get Key-Value Store\n\nRetrieves metadata and record listings from a key-value store.\n\n**Tool Name:** `get-key-value-store`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `storeId` | string | Yes | Key-value store ID or name |\n\n**Metadata Returned:**\n- Store name and ID\n- Created timestamp\n- Modified timestamp\n- Item count\n- Available record keys\n\n**Use Cases:**\n\n- Listing available records before fetching specific items\n- Checking if a store exists\n- Auditing store contents\n\nSource: [src/tools/common/get_key_value_store.ts:1-1]()\n\n### Get Key-Value Store Record\n\nRetrieves a specific record from a key-value store by its key.\n\n**Tool Name:** `get-key-value-store-record`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `storeId` | string | Yes | Key-value store ID or name |\n| `key` | string | Yes | Record key to retrieve |\n| `filename` | string | No | If record is a file, specify the filename for proper MIME type handling |\n\n**Response Handling:**\n\nThe tool handles different MIME types appropriately:\n- **JSON**: Parsed and pretty-printed\n- **Images**: Base64 encoded with data URI\n- **Other**: Raw content or appropriate representation\n\nSource: [src/tools/common/get_key_value_store_record.ts:1-1]()\n\n---\n\n## Run Log Tools\n\nRun Log tools provide access to Actor execution logs and run collection management.\n\n### Get Actor Run Log\n\nRetrieves the console output and log entries from a specific Actor run.\n\n**Tool Name:** `get-actor-run-log`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `runId` | string | Yes | Actor run ID |\n\n**Output Format:**\n\nReturns log content with timestamps and log levels preserved:\n\n```json\n{\n  \"content\": [{\n    \"type\": \"text\",\n    \"text\": \"[2024-01-15T10:30:00.000Z] INFO: Starting crawl...\\n[2024-01-15T10:30:01.000Z] DEBUG: Found 50 items\"\n  }]\n}\n```\n\n**Implementation Details:**\n\nThe tool fetches log data from the Apify Run Logs API and formats it for readability. Large logs are truncated with a warning message.\n\nSource: [src/tools/common/get_actor_run_log.ts:1-1]()\n\n### Run Collection\n\nManages collections of Actor runs, enabling listing and filtering of historical executions.\n\n**Tool Name:** `run-collection`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `action` | string | Yes | Action to perform: `list`, `get`, or `stats` |\n| `datasetId` | string | No | Filter by associated dataset |\n| `status` | string | No | Filter by run status |\n| `limit` | integer | No | Maximum results (default: 20) |\n\n**Supported Actions:**\n\n| Action | Description |\n|--------|-------------|\n| `list` | List runs matching filters |\n| `get` | Get details of a specific run |\n| `stats` | Get aggregate statistics |\n\n**Status Filter Values:**\n- `READY` - Run completed successfully\n- `RUNNING` - Run currently executing\n- `FAILED` - Run terminated with errors\n- `ABORTED` - Run manually cancelled\n\nSource: [src/tools/common/run_collection.ts:1-1]()\n\n---\n\n## Common Patterns\n\n### Input Validation\n\nAll storage tools use Zod for input validation, ensuring type safety and user-friendly error messages:\n\n```typescript\nconst getDatasetArgs = z.object({\n    datasetId: z.string().min(1, 'Dataset ID is required'),\n});\n\nconst parsed = getDatasetArgs.parse(args);\n```\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n### Response Building\n\nTools use `buildMCPResponse()` for consistent output formatting:\n\n```typescript\nreturn buildMCPResponse({\n    texts: [`Dataset '${parsed.datasetId}' has ${itemCount} items.`],\n    telemetry: { toolStatus: TOOL_STATUS.SUCCESS },\n});\n```\n\n### Error Handling\n\nErrors are caught and transformed into user-friendly messages:\n\n```typescript\ntry {\n    // API call\n} catch (error) {\n    log.softFail(`[get-dataset] Failed: ${error.message}`);\n    return buildMCPResponse({\n        texts: [`Error: ${error.message}`],\n        isError: true,\n        telemetry: { toolStatus: TOOL_STATUS.FAILED },\n    });\n}\n```\n\n---\n\n## Tool Annotations\n\nStorage tools include standardized annotations for MCP client UI rendering:\n\n```typescript\nannotations: {\n    title: 'Get Dataset Items',\n    readOnlyHint: true,      // Read-only operation\n    destructiveHint: false,  // Does not delete data\n    idempotentHint: true,    // Safe to retry\n    openWorldHint: false,    // Apify internal data\n},\n```\n\n| Annotation | Purpose |\n|------------|---------|\n| `title` | Display name in MCP client UI |\n| `readOnlyHint` | Indicates read-only operations |\n| `destructiveHint` | Warns about destructive operations |\n| `idempotentHint` | Confirms safe retry behavior |\n| `openWorldHint` | Indicates external data access |\n\nSource: [src/tools/common/get_dataset_items.ts:55-60]()\n\n---\n\n## Integration with Apify Client\n\nStorage tools use the shared Apify client utility rather than calling the API directly:\n\n```typescript\nimport { getApifyDatasetClient } from '../../utils/apify_client.js';\n\nconst datasetClient = getApifyDatasetClient();\nconst dataset = await datasetClient.getDataset({ datasetId: parsed.datasetId });\n```\n\nThis ensures:\n- Consistent authentication handling\n- Proper error transformation\n- Caching where applicable\n- Telemetry integration\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n---\n\n## Configuration\n\nStorage tools respect the server's tool loading configuration. By default, storage tools are loaded unless explicitly excluded:\n\n```bash\n# CLI configuration\nnpx @apify/actors-mcp-server --tools actors,docs,storage\n\n# Or explicitly exclude\nnpx @apify/actors-mcp-server --tools actors,docs\n```\n\nSource: [README.md:1-1]()\n\n---\n\n## Summary\n\nStorage Access Tools provide comprehensive access to Apify's cloud storage infrastructure through the MCP protocol. Key characteristics:\n\n| Aspect | Implementation |\n|--------|----------------|\n| **Dataset Access** | 3 tools for metadata, items, and schema |\n| **Key-Value Store** | 2 tools for store and record access |\n| **Run Logs** | 2 tools for log retrieval and run management |\n| **Validation** | Zod schemas with AJV compilation |\n| **Response Format** | Standard MCP content blocks |\n| **Error Handling** | User-friendly messages with telemetry |\n| **Configuration** | Respects global tool loading settings |\n\nThese tools enable AI assistants to interact with Apify storage data without requiring direct API integration, making it simple to build workflows that consume Actor output or manage storage resources.\n\n---\n\n<a id='payments-overview'></a>\n\n## Agentic Payments System\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/payments/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n- [src/payments/x402.ts](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n- [src/utils/payment_errors.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n- [src/payments/helpers.ts](https://github.com/apify/apify-mcp-server/blob/main/src/payments/helpers.ts)\n</details>\n\n# Agentic Payments System\n\nThe Agentic Payments System is a payment abstraction layer within the Apify MCP Server that enables AI agents and MCP clients to pay for Actor executions using alternative payment methods beyond traditional API tokens. The system supports multiple payment schemes including **x402** (blockchain-based payments via HTTP 402) and **Skyfire** (agentic payment tokens), allowing autonomous agents to pay for compute without requiring pre-configured API credentials.\n\n## Architecture Overview\n\nThe payment system follows a provider-based architecture where a unified `PaymentProvider` interface abstracts the specifics of each payment scheme. This design allows the MCP server to remain agnostic to payment implementation details while providing a consistent interface for payment validation, credential extraction, and header forwarding.\n\n```mermaid\ngraph TD\n    subgraph \"MCP Client\"\n        A[Tool Call with Payment]\n    end\n    \n    subgraph \"Apify MCP Server\"\n        B[Payment Provider Resolution]\n        C[validatePayment]\n        D[removePaymentFields]\n        E[getPaymentHeaders]\n        F[decorateToolSchema]\n    end\n    \n    subgraph \"Payment Providers\"\n        G[x402 Provider]\n        H[Skyfire Provider]\n    end\n    \n    subgraph \"Apify API\"\n        I[Actor Execution]\n        J[Payment Verification]\n    end\n    \n    A --> B\n    B --> G\n    B --> H\n    C --> D\n    D --> E\n    E --> I\n    F -.->|Decorates| A\n    I --> J\n```\n\nSource: [src/payments/types.ts:45-87](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n## Core Types and Interfaces\n\n### PaymentProviderId\n\nThe system defines two supported payment provider identifiers:\n\n```typescript\nexport type PaymentProviderId = 'skyfire' | 'x402';\n```\n\n| Provider | Description |\n|----------|-------------|\n| `skyfire` | Skyfire agentic payments using PAY tokens in tool arguments |\n| `x402` | x402 protocol using HTTP 402 with PAYMENT-SIGNATURE header |\n\nSource: [src/payments/types.ts:14-19](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n### PaymentProvider Interface\n\nEvery payment provider must implement the `PaymentProvider` interface:\n\n| Method | Return Type | Purpose |\n|--------|-------------|---------|\n| `id` | `PaymentProviderId` (readonly) | Provider identifier |\n| `decorateToolSchema(tool)` | `ToolEntry` | Add payment fields to tool definitions |\n| `validatePayment(args, meta, headers)` | `string \\| null` | Validate credentials before execution |\n| `getPaymentHeaders(args, meta, headers)` | `PaymentHeaders` | Extract headers for Apify API |\n| `removePaymentFields(args)` | `Record<string, unknown>` | Clean args before Actor input |\n| `allowsUnauthenticated` | `boolean` | Whether token-less access is permitted |\n| `getPaymentRequiredData?()` | `unknown` | Optional x402 structured payment data |\n| `getUsageGuide?()` | `string \\| null` | Optional payment usage documentation |\n\nSource: [src/payments/types.ts:45-87](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n### Supporting Types\n\n```typescript\n// Headers forwarded to Apify API requests\nexport type PaymentHeaders = Record<string, string>;\n\n// MCP request _meta field for payment schemes like x402\nexport type PaymentMeta = Record<string, unknown> | undefined;\n\n// HTTP headers from MCP transport layer\nexport type RequestHeaders = Record<string, string | string[] | undefined> | undefined;\n```\n\nSource: [src/payments/types.ts:22-35](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n## Payment-Aware Tool Call Context\n\nThe `PrepareToolCallContextResult` type centralizes payment processing for tool calls:\n\n```typescript\nexport type PrepareToolCallContextResult = {\n    paymentRequiredResult?: ReturnType<typeof buildPaymentRequiredResponse>;\n    toolArgsWithoutPayment: Record<string, unknown>;\n    toolArgsRedacted: unknown;\n    apifyClient: ApifyClient;\n};\n```\n\n| Field | Type | Purpose |\n|-------|------|---------|\n| `paymentRequiredResult` | `MCPResponse \\| undefined` | Structured 402 error response if payment fails |\n| `toolArgsWithoutPayment` | `Record<string, unknown>` | Args stripped of payment fields for AJV validation |\n| `toolArgsRedacted` | `unknown` | Args with sensitive fields masked for logging |\n| `apifyClient` | `ApifyClient` | Client configured with payment headers or standard token |\n\nSource: [src/payments/helpers.ts:7-16](https://github.com/apify/apify-mcp-server/blob/main/src/payments/helpers.ts)\n\n## x402 Payment Provider\n\nThe x402 provider enables blockchain-based payments using EIP-3009 TransferWithAuthorization on Base network.\n\n### Payment Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant MCP_Server\n    participant Apify_API\n    \n    Client->>Client: Sign EIP-3009 TransferWithAuthorization\n    Client->>MCP_Server: Tool call with _meta[\"x402/payment\"]\n    MCP_Server->>MCP_Server: validatePayment()\n    MCP_Server->>MCP_Server: getPaymentHeaders()\n    MCP_Server->>Apify_API: Forward PAYMENT-SIGNATURE header\n    Apify_API->>Apify_API: Verify signature & settle payment\n    Apify_API-->>MCP_Server: Actor execution result\n    MCP_Server-->>Client: Response\n```\n\n### x402 Payment Types\n\n```typescript\nexport type X402PaymentAccept = {\n    scheme?: string;\n    network?: string;\n    amount?: string;\n    asset?: string;\n    payTo?: string;\n    maxTimeoutSeconds?: number;\n    extra?: Record<string, unknown>;\n};\n\nexport type X402PaymentRequirements = {\n    x402Version?: number;\n    resource?: Record<string, unknown>;\n    accepts?: X402PaymentAccept[];\n};\n```\n\nSource: [src/payments/x402.ts:18-28](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n### Payment Data Extraction\n\nThe x402 provider reads payment data from two sources in priority order:\n\n1. **MCP `_meta` field** (preferred): `meta[\"x402/payment\"]` contains the decoded JSON payment object\n2. **HTTP `PAYMENT-SIGNATURE` header** (fallback): Base64-encoded payment data from HTTP transport\n\n```typescript\nfunction getEncodedPaymentSignature(\n    meta?: PaymentMeta, \n    requestHeaders?: RequestHeaders\n): string | undefined {\n    const metaPayment = meta?.[X402_META_KEY];\n    if (metaPayment) {\n        return Buffer.from(JSON.stringify(metaPayment)).toString('base64');\n    }\n    return getPaymentSignatureFromHeader(requestHeaders);\n}\n```\n\nSource: [src/payments/x402.ts:75-86](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n### Caching Mechanism\n\nThe x402 provider caches payment requirements at module level to prevent thundering herd during server startup:\n\n| Parameter | Value |\n|-----------|-------|\n| Cache TTL | 30 minutes |\n| Cached Item | `Promise<X402PaymentRequirements \\| undefined>` |\n\n```typescript\nlet cachedRequirementsPromise: Promise<X402PaymentRequirements | undefined> | null = null;\nlet lastFetchTime = 0;\nconst CACHE_TTL_MS = 30 * 60 * 1000;\n```\n\nSource: [src/payments/x402.ts:35-41](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n### x402 Provider Constants\n\n| Constant | Value | Purpose |\n|----------|-------|---------|\n| `X402_META_KEY` | `x402/payment` | Key for MCP `_meta` field |\n| `PAYMENT_SIGNATURE_HEADER` | `PAYMENT-SIGNATURE` | HTTP header for Apify API |\n| `PAYMENT_PROTOCOL_HEADER` | `x-apify-payment-protocol` | Protocol identification |\n| `PAYMENT_REQUIRED_HEADER` | `payment-required` | Response header for 402 |\n| `FETCH_TIMEOUT_MS` | `8000` | Timeout for payment requirements fetch |\n\nSource: [src/payments/x402.ts:52-63](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n## Payment Error Handling\n\n### 402 Response Building\n\nThe `buildPaymentRequiredResponse` function constructs MCP responses for payment failures following the x402 MCP transport spec:\n\n```typescript\nexport function buildPaymentRequiredResponse(\n    errorOrMessage: unknown, \n    precomputedPaymentData?: unknown\n) {\n    const paymentData = precomputedPaymentData ?? extractPaymentRequiredData(errorOrMessage);\n    const message = errorOrMessage instanceof Error ? errorOrMessage.message : String(errorOrMessage);\n\n    const texts = paymentData\n        ? [\n            JSON.stringify(paymentData),\n            'Payment required to run this Actor or access this resource.',\n        ]\n        : [message];\n\n    return buildMCPResponse({ texts, isError: true, structuredContent: paymentData });\n}\n```\n\nSource: [src/utils/payment_errors.ts:44-60](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n\n### Payment Data Extraction\n\nPayment-required data is extracted from two sources in priority order:\n\n| Priority | Source | Access Method |\n|----------|--------|---------------|\n| 1 | Captured HTTP header | Axios interceptor stores `payment-required` response header |\n| 2 | API response body | `ApifyApiError.data` field |\n\n```typescript\nfunction extractPaymentRequiredData(error: unknown): Record<string, unknown> | undefined {\n    // Source 1: Captured payment-required header\n    const captured = (error as ErrorWithPaymentData)[PAYMENT_REQUIRED_DATA];\n    if (captured && typeof captured === 'object') return captured;\n\n    // Source 2: ApifyApiError.data (API response body)\n    if (error instanceof ApifyApiError) {\n        const { data } = error;\n        if (typeof data === 'object' && data !== null) return data as Record<string, unknown>;\n    }\n\n    return undefined;\n}\n```\n\nSource: [src/utils/payment_errors.ts:66-87](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n\n### Axios Interceptor\n\nAn axios interceptor captures the `payment-required` response header from Apify API responses:\n\n```typescript\napifyClient.addInterceptorResponseError(async (error) => {\n    const response = (error as AxiosError<{ response?: { headers?: Record<string, string> } }>)\n        ?.response;\n    const paymentData = response?.status === HTTP_PAYMENT_REQUIRED\n        ? decodePaymentRequiredHeader(response.headers?.[PAYMENT_REQUIRED_HEADER])\n        : undefined;\n\n    if (paymentData) {\n        Object.defineProperty(error as object, PAYMENT_REQUIRED_DATA, { \n            value: paymentData, \n            enumerable: false \n        });\n    }\n\n    return Promise.reject(error);\n});\n```\n\nSource: [src/utils/payment_errors.ts:18-31](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n\n## Tool Call Processing Workflow\n\n```mermaid\ngraph TD\n    A[Tool Call Received] --> B{Pre-process payment}\n    B --> C[validatePayment]\n    C -->|Valid| D[removePaymentFields]\n    C -->|Invalid| E[Return 402 Response]\n    D --> F[Redact sensitive fields]\n    F --> G[Create ApifyClient with payment headers]\n    G --> H[AJV validation on clean args]\n    H -->|Valid| I[Execute Actor]\n    H -->|Invalid| J[Return validation error]\n    I --> K[Return result]\n    \n    style E fill:#ff6b6b\n    style K fill:#51cf66\n```\n\n## Usage Guide Integration\n\nPayment providers can optionally expose usage guides as MCP resources:\n\n```typescript\nconst listResources = async (): Promise<ListResourcesResult> => {\n    const resources: Resource[] = [];\n\n    if (paymentProvider?.getUsageGuide?.()) {\n        resources.push({\n            uri: 'file://readme.md',\n            name: 'readme',\n            description: 'Apify MCP Server usage guide...',\n            mimeType: 'text/markdown',\n        });\n    }\n    // ...\n};\n```\n\nSource: [src/resources/resource_service.ts:27-38](https://github.com/apify/apify-mcp-server/blob/main/src/resources/resource_service.ts)\n\n## Configuration Reference\n\n| Configuration Option | Provider | Description |\n|---------------------|----------|-------------|\n| `APIFY_TOKEN` | Standard | Apify API token for traditional authentication |\n| `payment=x402` | x402 | Query parameter to enable x402 payments |\n| `--x402` | x402 | CLI flag to enable x402 protocol |\n\nSource: [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n## Security Considerations\n\n### Field Redaction\n\nSensitive payment fields are redacted before logging to prevent credential exposure:\n\n```typescript\n// From PaymentProvider interface\nredactForLogging(args: unknown): unknown;\n```\n\n### Field Removal\n\nPayment-specific fields are stripped from tool arguments before passing to Actor input:\n\n```typescript\nremovePaymentFields(args: Record<string, unknown>): Record<string, unknown>;\n```\n\nThis ensures:\n1. AJV validation operates on clean schema without payment-specific fields\n2. Actor input does not contain provider-specific payment data\n3. Logging contains redacted versions only\n\n---\n\n<a id='widget-system'></a>\n\n## Widget System\n\n### Related Pages\n\nRelated topics: [UI Components Library](#ui-components)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/web/src/widgets/actor-detail-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/widgets/actor-detail-widget.tsx)\n- [src/web/src/widgets/actor-run-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/widgets/actor-run-widget.tsx)\n- [src/web/src/widgets/search-actors-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/widgets/search-actors-widget.tsx)\n- [src/web/src/utils/init-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/utils/init-widget.tsx)\n- [src/web/src/context/mcp-app-context.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/context/mcp-app-context.tsx)\n- [src/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/resources/resource_service.ts)\n- [src/web/src/pages/ActorSearch/ActorSearch.skeleton.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/pages/ActorSearch/ActorSearch.skeleton.tsx)\n- [res/web-widget-bundle-size.md](https://github.com/apify/apify-mcp-server/blob/main/res/web-widget-bundle-size.md)\n- [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n</details>\n\n# Widget System\n\n## Overview\n\nThe Widget System provides interactive, self-contained UI components that render inside MCP (Model Context Protocol) clients, specifically optimized for MCP Apps. Widgets enable rich visual experiences for Actor discovery, details viewing, and run monitoring without requiring the client to implement custom rendering logic.\n\n## Architecture\n\n### High-Level Architecture\n\n```mermaid\ngraph TD\n    subgraph \"MCP Client\"\n        A[MCP Apps SDK]\n    end\n    \n    subgraph \"Apify MCP Server\"\n        B[Resource Handler]\n        C[Tool Handlers]\n        D[Available Widgets Registry]\n    end\n    \n    subgraph \"Widget Bundle\"\n        E[Actor Search Widget]\n        F[Actor Detail Widget]\n        G[Actor Run Widget]\n    end\n    \n    subgraph \"UI Library\"\n        H[@apify/ui-library]\n        I[@apify/ui-icons]\n    end\n    \n    A -->|ui://widget/*| B\n    B -->|Lookup| D\n    D -->|Return Widget Path| B\n    B -->|Read JS Bundle| E\n    B -->|Read JS Bundle| F\n    B -->|Read JS Bundle| G\n    E -->|Import| H\n    F -->|Import| H\n    G -->|Import| H\n    C -->|Tool Output| A\n```\n\n### Widget Loading Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Server as MCP Server\n    participant FS as File System\n    participant Widget as Widget Bundle\n\n    Client->>Server: resources/read with ui://widget/actor-detail.html\n    Server->>Server: Check getMode() === ServerMode.APPS\n    Server->>Server: Lookup widget in availableWidgets\n    Server->>FS: Read widget.jsPath\n    FS-->>Server: widgetJs content\n    Server->>Server: Wrap in HTML template\n    Server-->>Client: HTML resource with MIME type\n    Client->>Widget: Execute module script\n    Widget->>Widget: useWidgetProps() reads tool output\n    Widget->>Widget: renderWidget() mounts component\n```\n\n## Widget Types\n\nThe system implements three primary widget types:\n\n| Widget | File | Purpose |\n|--------|------|---------|\n| Actor Search Widget | `search-actors-widget.tsx` | Search and browse Actors in Apify Store |\n| Actor Detail Widget | `actor-detail-widget.tsx` | Display Actor information, pricing, input schema |\n| Actor Run Widget | `actor-run-widget.tsx` | Show Actor execution progress and results |\n\n## Core Components\n\n### Widget Initialization (`init-widget.tsx`)\n\nThe `renderWidget` function is the entry point for all widgets:\n\n```typescript\n// src/web/src/utils/init-widget.tsx\nrenderWidget(WidgetComponent);\n```\n\nThis function:\n1. Creates a root container element\n2. Renders the widget component into the container\n3. Injects the necessary styles and context providers\n4. Returns cleanup functions for hot-reload scenarios\n\n### Widget Props Hook (`use-widget-props.ts`)\n\nWidgets receive tool output data through the `useWidgetProps` hook:\n\n```typescript\n// src/web/src/widgets/actor-detail-widget.tsx\nconst toolOutput = useWidgetProps<WidgetToolOutput>();\nconst details = toolOutput?.details;\n```\n\nThe hook interface:\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `details` | `ActorDetails \\| undefined` | Actor information from tool call |\n| `input` | `Record<string, unknown>` | Input parameters |\n| `meta` | `WidgetMeta` | Metadata about the widget session |\n\n### MCP App Context (`mcp-app-context.tsx`)\n\nProvides global state and utilities for widgets:\n\n```typescript\ninterface McpAppContextValue {\n    // Context methods and state\n}\n```\n\n### Widget Wrapper Pattern\n\nEach widget follows a consistent wrapper pattern:\n\n```typescript\n// src/web/src/widgets/actor-detail-widget.tsx\nconst ActorDetailWrapper = () => {\n    const toolOutput = useWidgetProps<WidgetToolOutput>();\n    const details = toolOutput?.details;\n\n    if (!details) {\n        return <div>No actor details available</div>;\n    }\n\n    return <ActorSearchDetail details={details} />;\n};\n\n(async () => {\n    if (IS_DEV_BUILD) {\n        const { setupActorDetailWidgetDev } = await import(\"./actor-detail-widget.dev\");\n        setupActorDetailWidgetDev();\n    }\n    renderWidget(ActorDetailWrapper);\n})();\n```\n\n## Resource Service Integration\n\n### URI Scheme\n\nWidgets are exposed as MCP resources using the `ui://widget/` URI scheme:\n\n```\nui://widget/actor-search.html\nui://widget/actor-detail.html\nui://widget/actor-run.html\n```\n\nSource: `src/resources/resource_service.ts`\n\n### Resource Handler Logic\n\n```typescript\n// src/resources/resource_service.ts\nif (getMode() === ServerMode.APPS && uri.startsWith('ui://widget/')) {\n    const widget = getAvailableWidgets().get(uri);\n\n    if (!widget || !widget.exists) {\n        return {\n            contents: [{\n                uri,\n                mimeType: 'text/plain',\n                text: `Widget ${uri} is not available. ${!widget ? 'Not found in registry.' : `File not found at ${widget.jsPath}`}`,\n            }],\n        };\n    }\n\n    try {\n        const fs = await import('node:fs');\n        const widgetJs = fs.readFileSync(widget.jsPath, 'utf-8');\n\n        const widgetHtml = `<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>${widget.title}</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\">${widgetJs}</script>\n  </body>\n</html>`;\n\n        const widgetContent: ExtendedResourceContents = {\n            uri,\n            mimeType: RESOURCE_MIME_TYPE,\n            text: widgetHtml,\n            html: widgetHtml,\n            _meta: widget.meta,\n        };\n        return { contents: [widgetContent] };\n    } catch (error) {\n        return {\n            contents: [{\n                uri,\n                mimeType: 'text/plain',\n                text: `Failed to load widget: ${errorMessage}`,\n            }],\n        };\n    }\n}\n```\n\n## Bundle Size Optimization\n\n### Optimization Strategy\n\nWidget bundles are optimized through narrow imports from `@apify/ui-library`. The top-level barrel import pulls in heavy transitive dependencies (floating UI, markdown helpers), which are avoided by importing specific modules.\n\n### Import Patterns\n\n```typescript\n// ❌ AVOID - Pulls entire library\nimport { Button } from '@apify/ui-library';\n\n// ✅ PREFER - Narrow import\nimport { Button } from '@apify/ui-library/dist/src/...';\n```\n\nSource: `res/web-widget-bundle-size.md`\n\n### Verified Bundle Sizes\n\n| Widget | Before | After | Reduction |\n|--------|--------|-------|-----------|\n| actor-run-widget | ~1.86 MB | ~1.16 MB | 38% |\n| actor-detail-widget | ~1.86 MB | ~1.52 MB | 18% |\n| search-actors-widget | ~1.87 MB | ~1.53 MB | 18% |\n\nSource: `res/web-widget-bundle-size.md`\n\n### Special Cost Center: Markdown\n\nMarkdown rendering is treated as a special cost center. Changes to markdown processing require re-measuring bundle size impact.\n\n## Development Workflow\n\n### Hot-Reload Development\n\nThe development server supports hot-reload for widgets:\n\n```bash\nAPIFY_TOKEN='your-apify-token' pnpm run dev\n```\n\nThis starts:\n1. Web widget builder in watch mode\n2. MCP server in standby mode on port `3001`\n3. Local esbuild dev server at `http://localhost:3226`\n\nSource: `DEVELOPMENT.md`\n\n### Preview Widgets\n\nWidgets can be previewed locally via:\n```\nhttp://localhost:3226/index.html\n```\n\nThe preview page links to:\n- Actor Search Widget: `/index-actor-search.html`\n- Actor Run Widget: `/index-actor-run.html`\n\n### UI Mode Requirement\n\nWidget rendering requires the server to run in UI mode. Enable via:\n- Query parameter: `/mcp?ui=true`\n- Environment variable: `UI_MODE=true`\n\n## Widget Tool Output Interface\n\nEach widget expects a specific output structure from the invoking tool:\n\n```typescript\ninterface WidgetToolOutput extends Record<string, unknown> {\n    details?: ActorDetails;\n}\n\ninterface ActorDetails {\n    name: string;\n    description: string;\n    pricing: PricingInfo;\n    inputSchema: InputSchema;\n    // ... other properties\n}\n```\n\n## Design System Compliance\n\nWidgets must follow the Apify design system rules defined in `DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md`:\n\n### Token Usage\n\n| Token Category | Usage | Example |\n|---------------|-------|---------|\n| Colors | Use `theme.color.*` | `theme.color.neutral.text` |\n| Spacing | Use `theme.space.*` | `theme.space.space16` |\n| Shadows | Use `theme.shadow.*` | `theme.shadow.shadow2` |\n\n### Component Structure\n\n```typescript\n// 1. Imports\nimport styled from 'styled-components';\nimport { theme } from '@apify/ui-library';\n\n// 2. Constants & Types\nexport const COMPONENT_VARIANTS = { ... } as const;\n\n// 3. Styled Components\nconst StyledWrapper = styled.div`...`;\n\n// 4. Component Implementation\nexport const Component = forwardRef<HTMLElement, Props>((props, ref) => {\n    // implementation\n});\n\n// 5. Display Name\nComponent.displayName = 'Component';\n```\n\n## Skeleton Loading States\n\nWidgets implement skeleton loading states for async content:\n\n```typescript\n// src/web/src/pages/ActorSearch/ActorSearch.skeleton.tsx\nconst SectionHeaderSkeleton: React.FC = () => {\n    return (\n        <SectionHeaderWrapper px=\"space16\" py=\"space12\">\n            <SkeletonBlock style={{ height: '24px', width: '96px' }} />\n            <SkeletonBlock style={{ height: '16px', width: '64px' }} />\n        </SectionHeaderWrapper>\n    );\n};\n```\n\n## Configuration\n\n### Widget Registry\n\nWidgets are registered in the `availableWidgets` registry, which tracks:\n- Widget URI path\n- JavaScript file path\n- Title for HTML template\n- Existence status\n- Metadata\n\n### Server Mode\n\nWidget resources are only available when `getMode() === ServerMode.APPS`. In default mode, requests to `ui://widget/*` URIs return an error message.\n\n---\n\n<a id='ui-components'></a>\n\n## UI Components Library\n\n### Related Pages\n\nRelated topics: [Widget System](#widget-system)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](https://github.com/apify/apify-mcp-server/blob/main/DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n- [src/web/package.json](https://github.com/apify/apify-mcp-server/blob/main/src/web/package.json)\n- [res/web-widget-bundle-size.md](https://github.com/apify/apify-mcp-server/blob/main/res/web-widget-bundle-size.md)\n- [src/tools/structured_output_schemas.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/structured_output_schemas.ts)\n- [src/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/resources/resource_service.ts)\n- [src/utils/server-instructions/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/server-instructions/index.ts)\n</details>\n\n# UI Components Library\n\n## Overview\n\nThe Apify MCP Server utilizes a dedicated UI Components Library to render interactive widgets within the MCP Apps environment. These components enable the server to deliver rich, styled user interfaces for displaying Actor information, search results, and run progress directly within AI assistant applications.\n\nThe UI components are built using **React 18.3.1** and **styled-components 6.3.8**, with design tokens sourced from the `@apify/ui-library` package. Source: [src/web/package.json](src/web/package.json)\n\n## Architecture\n\n### Component Location and Structure\n\nUI widgets reside in `src/web/src/widgets/` and leverage shared components from `src/web/src/components/ui/`. The component library follows a consistent pattern where all styled components import the `theme` object from `@apify/ui-library` to ensure design consistency across the application. Source: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Widget Rendering Pipeline\n\nThe following diagram illustrates how UI components integrate with the MCP server:\n\n```mermaid\ngraph TD\n    A[MCP Client Request] --> B[Server Handler]\n    B --> C{Server Mode}\n    C -->|APPS| D[Widget Registry]\n    C -->|DEFAULT| E[Standard Response]\n    D --> F[Read Widget JS Bundle]\n    F --> G[Wrap in HTML Template]\n    G --> H[Return HTML via Resource]\n    H --> I[MCP Apps Renderer]\n    I --> J[React Components Mount]\n```\n\nSource: [src/resources/resource_service.ts](src/resources/resource_service.ts)\n\n### Bundle Optimization Strategy\n\nThe widget bundles must remain self-contained while minimizing payload size. The system uses direct module imports from `@apify/ui-library/dist/src/...` instead of top-level imports to avoid pulling in heavy transitive dependencies. Source: [res/web-widget-bundle-size.md](res/web-widget-bundle-size.md)\n\n**Bundle size improvements achieved:**\n\n| Widget | Before | After | Reduction |\n|--------|--------|-------|-----------|\n| actor-run-widget | ~1.86 MB | ~1.16 MB | 37.6% |\n| actor-detail-widget | ~1.86 MB | ~1.52 MB | 18.3% |\n| search-actors-widget | ~1.87 MB | ~1.53 MB | 18.2% |\n\n## Design System Compliance\n\nAll UI components must adhere to strict design system rules defined in `DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md`. These rules ensure visual consistency and maintainability across all widgets. Source: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Design Tokens\n\nComponents **must** use `theme.*` tokens exclusively for all styling values. Hardcoded values are strictly forbidden.\n\n```typescript\n// ❌ FORBIDDEN\ncolor: '#1976d2'\npadding: '8px'\nborder-radius: '4px'\n\n// ✅ REQUIRED\ncolor: ${theme.color.primary.action}\npadding: ${theme.space.space8}\nborder-radius: ${theme.radius.radius2}\n```\n\n**Available token categories:**\n\n| Category | Examples | Purpose |\n|----------|----------|---------|\n| Colors | `theme.color.primary.action`, `theme.color.neutral.textMuted` | Brand colors and semantic variants |\n| Spacing | `theme.space.space8`, `theme.space.space16`, `theme.space.space40` | Padding, margins, gaps |\n| Border Radius | `theme.radius.radius2`, `theme.radius.radius3` | Component corners |\n| Shadows | `theme.shadow1`, `theme.shadow3`, `theme.shadowActive` | Elevation and depth |\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Component Import Pattern\n\nAll shared UI components should be imported from `@apify/ui-library`. Components must never be duplicated locally or imported from arbitrary relative paths.\n\n```typescript\n// ✅ Correct\nimport { Button, Badge, Chip, Text, Heading } from '@apify/ui-library';\n\n// ❌ Never create duplicate implementations\n```\n\n## Component Patterns\n\n### Styled Components Structure\n\nThe project follows a standardized component structure to ensure consistency across all UI elements. Source: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n**Component file organization:**\n\n```typescript\n// 1. Imports (grouped)\nimport { forwardRef } from 'react';\nimport styled from 'styled-components';\nimport { theme } from '@apify/ui-library';\n\n// 2. Constants & Types\nexport const COMPONENT_VARIANTS = { ... } as const;\ntype ComponentVariants = ValueOf<typeof COMPONENT_VARIANTS>;\n\n// 3. Styled Components\nconst StyledWrapper = styled.div`...`;\n\n// 4. Component Implementation\nexport const Component = forwardRef<HTMLElement, Props>((props, ref) => {\n    // implementation\n});\n\n// 5. Display Name\nComponent.displayName = 'Component';\n```\n\n### Transient Props Convention\n\nComponent props that should not be passed to the underlying DOM element must use the `$` prefix:\n\n```typescript\nconst StyledButton = styled.button<{ $variant?: string }>`\n    background: ${({ $variant }) => \n        $variant === 'primary' \n            ? theme.color.primary.action \n            : theme.color.neutral.background\n    };\n`;\n```\n\n**Common transient props:** `$variant`, `$isActive`, `$size`\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Typography Components\n\nTypography must use the `Text` and `Heading` components from `@apify/ui-library` rather than direct styling:\n\n```typescript\n// ✅ Correct\nimport { Text, Heading } from '@apify/ui-library';\n\n<Text type=\"body\" size=\"regular\" weight=\"normal\">Content here</Text>\n<Heading type=\"titleL\">Title here</Heading>\n\n// ❌ Never style text elements directly\n// ❌ Never use typography tokens\n```\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Spacing System\n\nThe design system defines a consistent spacing scale that must be used for all layout measurements:\n\n| Token | Usage | Example |\n|-------|-------|---------|\n| `space4` | Inline elements, icon gaps | `gap: ${theme.space.space4}` |\n| `space8` | Button padding, small gaps | `padding: ${theme.space.space8}` |\n| `space12` | Component internal spacing | `padding: ${theme.space.space12}` |\n| `space16` | Standard component padding | `padding: ${theme.space.space16}` |\n| `space24` | Section margins | `margin: ${theme.space.space24}` |\n| `space32` | Section separators | `margin: ${theme.space.space32}` |\n| `space40`, `space64`, `space80` | Large layouts | Container margins |\n\n**Rule:** Never use arbitrary values like `gap: 10px` — always round to the nearest design token.\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Common Pitfalls\n\n### Token Misuse\n\nAvoid mixing hardcoded values with design tokens in the same property:\n\n```typescript\n// ❌ WRONG\npadding: ${theme.space.space16} 10px;\n\n// ✅ CORRECT\npadding: ${theme.space.space16} ${theme.space.space10};\n```\n\n### Non-existent Token Properties\n\nAlways verify token property names exist in the theme object:\n\n```typescript\n// ❌ WRONG - These properties don't exist\ntheme.color.neutral.textLight\ntheme.color.primary.main\n\n// ✅ CORRECT - Use actual property names\ntheme.color.neutral.textMuted\ntheme.color.primary.action\n```\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Widget Output Schemas\n\nUI components receive data through structured output schemas that define the expected data format:\n\n### Actor Details Widget Schema\n\n```typescript\nexport const actorDetailsWidgetOutputSchema = {\n    type: 'object',\n    properties: {\n        actorDetails: {\n            type: 'object',\n            properties: {\n                actorInfo: { \n                    type: 'object', \n                    description: 'Widget-formatted Actor info (tier-aware pricing, widget display fields).' \n                },\n                actorCard: { \n                    type: 'string', \n                    description: 'Rendered Actor card markdown for widget display.' \n                },\n                readme: { \n                    type: 'string', \n                    description: 'Formatted Actor README for widget display.' \n                },\n            },\n            required: ['actorInfo', 'actorCard', 'readme'],\n        },\n    },\n    required: ['actorDetails'],\n};\n```\n\nSource: [src/tools/structured_output_schemas.ts](src/tools/structured_output_schemas.ts)\n\n### Actor Search Widget Schema\n\n```typescript\nexport const actorSearchOutputSchema = {\n    type: 'object',\n    properties: {\n        actors: {\n            type: 'array',\n            items: actorInfoSchema,\n            description: 'List of Actor cards matching the search query',\n        },\n        query: { type: 'string', description: 'The search query used' },\n        count: { type: 'number', description: 'Number of Actors returned' },\n        instructions: { type: 'string', description: 'Additional instructions for the LLM.' },\n    },\n    required: ['actors', 'query', 'count'],\n};\n```\n\nSource: [src/tools/structured_output_schemas.ts](src/tools/structured_output_schemas.ts)\n\n## Widget Configuration\n\n### Server Mode Detection\n\nThe UI components library operates differently based on the server mode:\n\n| Mode | Behavior | Widget Tools Available |\n|------|----------|------------------------|\n| `DEFAULT` | Standard MCP response | No widget tools exposed |\n| `APPS` | Widget rendering enabled | `search-actors-widget`, `fetch-actor-details-widget`, `actor-run-widget` |\n\nSource: [src/utils/server-instructions/index.ts](src/utils/server-instructions/index.ts)\n\n### Resource URI Scheme\n\nWidgets are accessed via the `ui://widget/` URI scheme in APPS mode:\n\n```\nui://widget/search-actors.html\nui://widget/actor-detail.html\nui://widget/actor-run.html\n```\n\nSource: [src/resources/resource_service.ts](src/resources/resource_service.ts)\n\n## Development Workflow\n\n### Pre-Work Checklist\n\nBefore any UI component work, developers should:\n\n1. **Check MCP availability** — Search for `mcp__storybook__*` and `mcp__figma__*` tools\n2. **Load design context** — Call `mcp__storybook__get-ui-building-instructions` if available\n3. **Read existing patterns** — Find 1-3 similar components in `src/web/src/**/*{keyword}*.{tsx,ts}`\n4. **Use Grep for patterns** — Search for `theme\\.color\\.|theme\\.space\\.|theme\\.radius\\.`\n\n### Verification Protocol\n\nBefore submitting UI changes, verify:\n\n| Check | Command/Method | Expected Result |\n|-------|----------------|-----------------|\n| Color audit | Regex `['\"]#[0-9a-fA-F]{3,8}['\"]` | Zero matches |\n| Spacing audit | Regex `['\"][0-9]+px['\"]` | Zero matches |\n| Import check | All styled-components import `theme` | 100% compliance |\n| Pattern match | Compare to 1-3 similar components | Consistent structure |\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Bundle Optimization Guidelines\n\n### Import Optimization\n\nThe `@apify/ui-library` package uses a barrel export pattern. Direct module imports significantly reduce bundle size:\n\n```typescript\n// ❌ Heavy - pulls entire library\nimport { Button } from '@apify/ui-library';\n\n// ✅ Optimized - only includes Button\nimport { Button } from '@apify/ui-library/dist/src/primitives/Button';\n```\n\n### Cost Centers\n\n| Component/Feature | Bundle Impact | Notes |\n|-------------------|---------------|-------|\n| Floating UI | High | Heavy transitive dependency |\n| Markdown rendering | High | Special cost center - measure impact on changes |\n| Convenience components | Medium | Prefer narrow imports |\n| Primitive components | Low | Direct module imports sufficient |\n\nSource: [res/web-widget-bundle-size.md](res/web-widget-bundle-size.md)\n\n## Dependencies\n\n### Core UI Dependencies\n\n| Package | Version | Purpose |\n|---------|---------|---------|\n| `react` | ^18.3.1 | UI framework |\n| `react-dom` | ^18.3.1 | React DOM rendering |\n| `styled-components` | ^6.3.8 | CSS-in-JS styling |\n| `@apify/ui-library` | ^1.124.0 | Design system tokens and primitives |\n| `@apify/ui-icons` | ^1.27.2 | Icon components |\n\n### Build Dependencies\n\n| Package | Version | Purpose |\n|---------|---------|---------|\n| `esbuild` | ^0.28.0 | Fast bundler for widgets |\n| `typescript` | ^5.6.3 | Type safety |\n| `tailwindcss` | ^3.4.17 | Utility CSS (used sparingly) |\n\nSource: [src/web/package.json](src/web/package.json)\n\n---\n\n<a id='development-setup'></a>\n\n## Development Setup\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n- [CONTRIBUTING.md](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n- [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n- [manifest.json](https://github.com/apify/apify-mcp-server/blob/main/manifest.json)\n- [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n</details>\n\n# Development Setup\n\nThis guide covers everything needed to set up a local development environment for the Apify MCP Server project.\n\n## Prerequisites\n\n### System Requirements\n\n| Requirement | Minimum Version | Notes |\n|-------------|-----------------|-------|\n| Node.js | 20.0.0+ | Required runtime |\n| pnpm | 11+ | Package manager |\n| Claude Desktop | 0.2.16+ | For desktop integration |\n\n**Supported Platforms:** macOS (darwin), Windows (win32), Linux (linux)\n\nSource: [manifest.json:15-24](https://github.com/apify/apify-mcp-server/blob/main/manifest.json)\n\n### Repository Architecture\n\nThe project uses a monorepo structure with the following key directories:\n\n```\napify-mcp-server/\n├── src/                    # Main MCP server source code\n│   ├── mcp/               # MCP protocol implementation\n│   └── web/               # React widgets for MCP Apps UI\n├── tests/\n│   ├── unit/              # Unit tests\n│   └── integration/       # Integration tests\n└── res/                   # Resource documentation\n```\n\nSource: [DEVELOPMENT.md:50-57](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Installation\n\n### 1. Enable Corepack\n\nThe project uses pnpm 11+ as specified in `package.json#packageManager`. Corepack (bundled with Node 16+) automatically manages the pnpm version:\n\n```bash\ncorepack enable\n```\n\nThis is a one-time setup that makes pnpm available system-wide.\n\n### 2. Install Dependencies\n\nInstall all project dependencies in a single command:\n\n```bash\npnpm install\n```\n\nThis command installs dependencies for both the root workspace and the `src/web` workspace package simultaneously.\n\n> **Note:** The `devEngines.packageManager` is pinned with `onFail: \"error\"`, which means running `npm install` or `yarn install` will fail. This ensures lockfile consistency.\n\nSource: [DEVELOPMENT.md:41-45](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Environment Configuration\n\n### APIFY_TOKEN Setup\n\nThe `APIFY_TOKEN` is required for most server operations.\n\n#### For Claude Code\n\nCreate or edit `.claude/settings.local.json`:\n\n```json\n{\n  \"env\": {\n    \"APIFY_TOKEN\": \"<YOUR_APIFY_API_TOKEN>\"\n  }\n}\n```\n\nRestart Claude Code for the changes to take effect. The token is automatically picked up by both Claude Code MCP servers (defined in `.mcp.json`) and mcpc.\n\n#### For Local Development\n\nCreate an environment file `.env` in the project root:\n\n```text\nAPIFY_TOKEN=\"your-apify-token\"\n```\n\nSource: [DEVELOPMENT.md:14-24](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n### Environment Variables Reference\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `APIFY_TOKEN` | Yes | Apify API authentication token |\n| `APIFY_META_ORIGIN` | No | Meta origin for tracking (e.g., `STANDBY`) |\n| `UI_MODE` | No | Enable UI mode for widget rendering (`true`/`false`) |\n\n## Building the Project\n\n### Production Build\n\nTo build the MCP server for production:\n\n```bash\npnpm run build\n```\n\nThis compiles the TypeScript source and produces output in the `dist/` directory.\n\nSource: [DEVELOPMENT.md:64-68](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n### Development Server\n\nFor active development with hot-reload capabilities, the project includes a development server at `src/dev_server.ts`. This server provides:\n\n- Automatic recompilation on file changes\n- Debugging endpoints for MCP protocol inspection\n- Live widget preview at `http://localhost:3001`\n\n## Running the Server\n\n### HTTP Streamable Mode\n\nRun the server as an HTTP server using Apify CLI:\n\n```bash\nexport APIFY_TOKEN=\"your-apify-token\"\nexport APIFY_META_ORIGIN=STANDBY\napify run -p\n```\n\nThe server will be exposed at `http://localhost:3001`.\n\nSource: [README.md:28-34](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n### Standard I/O (stdio) Mode\n\nFor use with the MCP Inspector or local clients:\n\n```bash\nexport APIFY_TOKEN=\"your-apify-token\"\nnpx @modelcontextprotocol/inspector node ./dist/stdio.js\n```\n\nThe Inspector will display a URL for browser-based debugging.\n\nSource: [README.md:40-46](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n## Testing\n\n### Testing Layers\n\nThe project implements a multi-layer testing strategy:\n\n| Layer | Command | Coverage |\n|-------|---------|----------|\n| Unit Tests | `pnpm run test:unit` | Individual modules in isolation |\n| Integration Tests | `pnpm run test:integration` | Full server over all transports against real Apify API |\n| Interactive Verification | `mcpc @stdio tools-call ...` | End-to-end during development |\n| LLM Evaluations | CI only | Multiple models via OpenRouter |\n\nSource: [DEVELOPMENT.md:26-36](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n### Unit Tests\n\nUnit tests verify individual modules without external dependencies:\n\n```bash\npnpm run test:unit\n```\n\nNo credentials are required for unit tests.\n\n### Integration Tests\n\nIntegration tests verify the complete MCP server functionality:\n\n```bash\npnpm run test:integration\n```\n\n**Requirements:**\n- Valid `APIFY_TOKEN` environment variable\n- Compiled production build (`pnpm run build`)\n\n### Interactive Probing with mcpc\n\nFor manual verification during development:\n\n```bash\nmcpc @stdio tools-call ...\n```\n\n### LLM Evaluations\n\nLLM evaluations run in CI and require the `validated` label on the PR:\n\n```bash\n# Trigger eval workflow\n# 1. Apply the 'validated' label to your PR\n\n# Environment variables required in CI:\nPHOENIX_*        # Phoenix evaluation platform credentials\nOPENROUTER_*     # OpenRouter API credentials\n```\n\nEvaluations run automatically:\n- When `validated` label is applied to a PR\n- On every merge to the `master` branch\n\nResults are posted to Phoenix for analysis.\n\nSource: [DEVELOPMENT.md:35-38](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Development Workflow\n\n### Mermaid: Development Workflow\n\n```mermaid\ngraph TD\n    A[Clone Repository] --> B[Enable corepack]\n    B --> C[pnpm install]\n    C --> D[Configure APIFY_TOKEN]\n    D --> E{Development Mode}\n    \n    E -->|HTTP Stream| F[apify run -p]\n    E -->|stdio| G[node ./dist/stdio.js]\n    E -->|Widget Dev| H[src/web dev server]\n    \n    F --> I[Debug with MCP Inspector]\n    G --> I\n    H --> J[Browser Preview: localhost:3001]\n    \n    I --> K{Testing}\n    K -->|Unit| L[pnpm run test:unit]\n    K -->|Integration| M[pnpm run test:integration]\n    K -->|Manual| N[mcpc probing]\n    \n    L --> O[Validate & Submit PR]\n    M --> O\n    N --> O\n```\n\n### Branch Naming\n\nAll feature branches must follow the format:\n\n```\n<type>/<short-description>\n```\n\nWhere `<type>` matches conventional commit types:\n\n| Type | Use Case |\n|------|----------|\n| `feat` | New features |\n| `fix` | Bug fixes |\n| `chore` | Maintenance tasks |\n| `refactor` | Code refactoring |\n| `docs` | Documentation updates |\n\n**Examples:**\n- `feat/add-dataset-tool`\n- `fix/connection-timeout`\n- `chore/update-dependencies`\n\nSource: [CONTRIBUTING.md:8-13](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n\n### Commit Messages\n\nAll commits and PR titles must follow the **Conventional Commits** format:\n\n```\n<type>(<scope>)!: <description>\n```\n\n| Component | Required | Description |\n|-----------|----------|-------------|\n| type | Yes | feat, fix, chore, refactor, docs, etc. |\n| scope | Yes | The affected component/module |\n| `!` | No | Indicates breaking change |\n| description | Yes | Brief summary of changes |\n\n**Examples:**\n```\nfeat: Add new tool for fetching actor details\nfeat!: Migrate to new MCP SDK version\nfix: Handle connection errors gracefully\nchore: Update dependencies\n```\n\nSource: [CONTRIBUTING.md:17-35](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n\n## UI Widget Development\n\n### Widget Architecture\n\nThe MCP Apps (ChatGPT Apps) UI widgets are built as a separate React project within `src/web/`. Widgets are rendered based on tool output—modifying widget data requires changing the corresponding tool's return value.\n\n### UI Mode\n\nWidget rendering requires the server to run in UI mode:\n\n**Via Query Parameter:**\n```\n/mcp?ui=true\n```\n\n**Via Environment Variable:**\n```bash\nexport UI_MODE=true\n```\n\n**Via CLI Flag:**\n```bash\nnpx @apify/actors-mcp-server --ui true\n```\n\n### Widget Preview\n\nPreview widgets during development:\n\n```bash\n# Actor Search Widget\n# Open: http://localhost:3001/index-actor-search.html\n\n# Actor Run Widget  \n# Open: http://localhost:3001/index-actor-run.html\n```\n\nSource: [DEVELOPMENT.md:58-62](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Code Quality Standards\n\n### Naming Conventions\n\n| Element | Convention | Example |\n|---------|------------|---------|\n| Types/Interfaces | PascalCase | `ActorDetails`, `ToolConfig` |\n| Variables/Functions | camelCase | `actorName`, `fetchActorDetails()` |\n| Constants | SCREAMING_SNAKE_CASE | `MAX_RETRIES`, `WIDGET_REGISTRY` |\n| Zod Validators | Suffix with `Validator` | `ActorValidator` |\n\n### String Formatting\n\n**Single-line strings:** Use single quotes\n```typescript\nconst message = 'Operation completed';\n```\n\n**Multi-line strings:** Use `dedent` for LLM-facing content\n```typescript\nimport dedent from 'dedent';\n\nconst description = dedent`\n    Line 1\n    Line 2\n`;\n```\n\n**Avoid:**\n- `[].join('\\n')` for multiline strings\n- Hardcoded hex colors or pixel values in UI code\n\nSource: [CONTRIBUTING.md:56-75](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n\n## Troubleshooting\n\n### Common Issues\n\n| Issue | Solution |\n|-------|----------|\n| `pnpm install` fails | Ensure Node.js 20+ is installed |\n| Wrong pnpm version | Run `corepack enable` |\n| Tests fail with \"Token required\" | Set `APIFY_TOKEN` environment variable |\n| Widgets not rendering | Verify `UI_MODE=true` is set |\n\n### Node Version Management\n\nThe `.nvmrc` file pins the development tooling Node version (currently 24). This is intentionally higher than the published floor to support modern tooling features.\n\n```bash\n# Check current Node version\nnode --version\n\n# Switch to project-required version (requires nvm)\nnvm use\n```\n\n### Verifying Installation\n\nRun the following commands to verify your setup:\n\n```bash\n# Verify pnpm version\npnpm --version  # Should be 11+\n\n# Verify Node version\nnode --version  # Should be 20+\n\n# Run unit tests\npnpm run test:unit\n\n# Build project\npnpm run build\n```\n\nIf all commands succeed, your development environment is properly configured.\n\n---\n\n---\n\n## Doramagic Pitfall Log\n\nProject: apify/apify-mcp-server\n\nSummary: Found 22 potential pitfall items; 5 are high/blocking. Highest priority: installation - 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode.\n\n## 1. installation · 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：fix: Allow calling MCP server actors in normal (one-shot) mode\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_be82315ed0f441ba9d942931d846d78c | https://github.com/apify/apify-mcp-server/issues/857 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 2. configuration · 来源证据：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8ec6ff22f24a4bb18b439177f4a8c270 | https://github.com/apify/apify-mcp-server/issues/892 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 3. security_permissions · 来源证据：Do not include the rag web browser when ?payment=x402\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Do not include the rag web browser when ?payment=x402\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_23bafe4901554148896241f0a1e183b0 | https://github.com/apify/apify-mcp-server/issues/875 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 4. security_permissions · 来源证据：Perf: `search-actors` tools returns huuuge `inputFields` object\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Perf: `search-actors` tools returns huuuge `inputFields` object\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_af51cb3cbcb3479fbbdf27cedef734aa | https://github.com/apify/apify-mcp-server/issues/888 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 5. security_permissions · 来源证据：feat(telemetry): track tool result size in bytes\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat(telemetry): track tool result size in bytes\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_9c2ef77c88914458910ae67d9f903931 | https://github.com/apify/apify-mcp-server/issues/838 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 6. identity · 仓库名和安装名不一致\n\n- Severity: medium\n- Evidence strength: runtime_trace\n- Finding: 仓库名 `apify-mcp-server` 与安装入口 `@apify/actors-mcp-server` 不完全一致。\n- User impact: 用户照着仓库名搜索包或照着包名找仓库时容易走错入口。\n- Suggested check: 在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。\n- Reproduction command: `npx @apify/actors-mcp-server`\n- Guardrail action: 页面必须同时展示 repo 名和真实安装入口，避免用户搜索错包。\n- Evidence: identity.distribution | github_repo:911256711 | https://github.com/apify/apify-mcp-server | repo=apify-mcp-server; install=@apify/actors-mcp-server\n\n## 7. installation · 来源证据：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_9c05c17621e3443dad6175f21db31a34 | https://github.com/apify/apify-mcp-server/issues/894 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 8. installation · 来源证据：feat: Add structured output to remaining storage tools\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: Add structured output to remaining storage tools\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_c9b7c39f3e8f43e88ee52c2c8ae94b01 | https://github.com/apify/apify-mcp-server/issues/884 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 9. installation · 来源证据：feat: migrate direct actor tools to canonical RunResponse shape\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: migrate direct actor tools to canonical RunResponse shape\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6b304ff2763849fe9b4678cc7bf9f5b2 | https://github.com/apify/apify-mcp-server/issues/852 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 10. installation · 来源证据：test: Consolidate duplicated MCP server test fixtures\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：test: Consolidate duplicated MCP server test fixtures\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_5a7a24d9e8ce42468a7775a54dfa8ca6 | https://github.com/apify/apify-mcp-server/issues/847 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 11. configuration · 来源证据：feat: Dataset tools correctness and coverage\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：feat: Dataset tools correctness and coverage\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_3fa86b498f66434a8f247c1b63fb56c9 | https://github.com/apify/apify-mcp-server/issues/784 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 12. capability · 能力判断依赖假设\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: README/documentation is current enough for a first validation pass.\n- User impact: 假设不成立时，用户拿不到承诺的能力。\n- Suggested check: 将假设转成下游验证清单。\n- Guardrail action: 假设必须转成验证项；没有验证结果前不能写成事实。\n- Evidence: capability.assumptions | github_repo:911256711 | https://github.com/apify/apify-mcp-server | README/documentation is current enough for a first validation pass.\n\n## 13. runtime · 来源证据：chore: Add mixpanel analytics for storage tools + error rates\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chore: Add mixpanel analytics for storage tools + error rates\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_03dbd8daa0c840d690bddb1d52e189c1 | https://github.com/apify/apify-mcp-server/issues/887 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 14. maintenance · 维护活跃度未知\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: 未记录 last_activity_observed。\n- User impact: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- Suggested check: 补 GitHub 最近 commit、release、issue/PR 响应信号。\n- Guardrail action: 维护活跃度未知时，推荐强度不能标为高信任。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | last_activity_observed missing\n\n## 15. security_permissions · 下游验证发现风险项\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 下游已经要求复核，不能在页面中弱化。\n- Suggested check: 进入安全/权限治理复核队列。\n- Guardrail action: 下游风险存在时必须保持 review/recommendation 降级。\n- Evidence: downstream_validation.risk_items | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium\n\n## 16. security_permissions · 存在评分风险\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 风险会影响是否适合普通用户安装。\n- Suggested check: 把风险写入边界卡，并确认是否需要人工复核。\n- Guardrail action: 评分风险必须进入边界卡，不能只作为内部分数。\n- Evidence: risks.scoring_risks | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium\n\n## 17. security_permissions · 来源证据：[Bug]: Inconsistent `search-actors` schema and results\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[Bug]: Inconsistent `search-actors` schema and results\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_364bc036f84b42e8b7be6534cb76381e | https://github.com/apify/apify-mcp-server/issues/889 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 18. security_permissions · 来源证据：design: Calibrate get-dataset-schema output detail\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：design: Calibrate get-dataset-schema output detail\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8b7a4266d8eb4298919b5cb2a58fa420 | https://github.com/apify/apify-mcp-server/issues/882 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 19. security_permissions · 来源证据：refactor: Extract storage tool helpers\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：refactor: Extract storage tool helpers\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_496f0061952341728e4222b961251325 | https://github.com/apify/apify-mcp-server/issues/890 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 20. security_permissions · 来源证据：tools/list response contains `type: \"unknown\"` in an input schema — rejected by ajv-based MCP clients (LibreChat)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：tools/list response contains `type: \"unknown\"` in an input schema — rejected by ajv-based MCP clients (LibreChat)\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_77fae88d35e2486d8125a2ecea9abdc7 | https://github.com/apify/apify-mcp-server/issues/738 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 21. maintenance · issue/PR 响应质量未知\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: issue_or_pr_quality=unknown。\n- User impact: 用户无法判断遇到问题后是否有人维护。\n- Suggested check: 抽样最近 issue/PR，判断是否长期无人处理。\n- Guardrail action: issue/PR 响应未知时，必须提示维护风险。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | issue_or_pr_quality=unknown\n\n## 22. maintenance · 发布节奏不明确\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: release_recency=unknown。\n- User impact: 安装命令和文档可能落后于代码，用户踩坑概率升高。\n- Suggested check: 确认最近 release/tag 和 README 安装命令是否一致。\n- Guardrail action: 发布节奏未知或过期时，安装说明必须标注可能漂移。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | release_recency=unknown\n\n<!-- canonical_name: apify/apify-mcp-server; human_manual_source: deepwiki_human_wiki -->\n",
      "markdown_key": "apify-mcp-server",
      "pages": "draft",
      "source_refs": [
        {
          "evidence_id": "github_repo:911256711",
          "kind": "repo",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/apify/apify-mcp-server"
        },
        {
          "evidence_id": "art_5baf09b5b64d4527bb2d8936099f5d69",
          "kind": "docs",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/apify/apify-mcp-server#readme"
        }
      ],
      "summary": "DeepWiki/Human Wiki output with a Doramagic pitfall appendix.",
      "title": "apify-mcp-server 说明书",
      "toc": [
        "https://github.com/apify/apify-mcp-server Project Manual",
        "Table of Contents",
        "Project Overview",
        "What is the Apify MCP Server?",
        "Architecture Overview",
        "Available Tools",
        "Deployment Modes",
        "User Configuration",
        "Doramagic 踩坑日志"
      ]
    }
  },
  "quality_gate": {
    "blocking_gaps": [],
    "category_confidence": "medium",
    "compile_status": "ready_for_review",
    "five_assets_present": true,
    "install_sandbox_verified": true,
    "missing_evidence": [],
    "next_action": "publish to Doramagic.ai project surfaces",
    "prompt_preview_boundary_ok": true,
    "publish_status": "publishable",
    "quick_start_verified": true,
    "repo_clone_verified": true,
    "repo_commit": "a6600017d733743b702f2989008216197b87f0f2",
    "repo_inspection_error": null,
    "repo_inspection_files": [
      "pyproject.toml",
      "pnpm-lock.yaml",
      "Dockerfile",
      "package.json",
      "README.md",
      "docs/claude-code-tools.json",
      "src/stdio.ts",
      "src/server_card.ts",
      "src/errors.ts",
      "src/index.ts",
      "src/index_internals.ts",
      "src/types.ts",
      "src/instrument.ts",
      "src/apify_client.ts",
      "src/state.ts",
      "src/tsconfig.json",
      "src/dev_server.ts",
      "src/telemetry.ts",
      "src/input.ts",
      "src/const.ts",
      "src/mcp/actors.ts",
      "src/mcp/utils.ts",
      "src/mcp/server.ts",
      "src/mcp/client.ts",
      "src/mcp/proxy.ts",
      "src/mcp/const.ts",
      "src/prompts/latest_news_on_topic.ts",
      "src/prompts/index.ts",
      "src/payments/skyfire.ts",
      "src/payments/resolve.ts",
      "src/payments/index.ts",
      "src/payments/types.ts",
      "src/payments/x402.ts",
      "src/payments/helpers.ts",
      "src/payments/const.ts",
      "src/tools/utils.ts",
      "src/tools/categories.ts",
      "src/tools/build.ts",
      "src/tools/index.ts",
      "src/tools/structured_output_schemas.ts"
    ],
    "repo_inspection_verified": true,
    "review_reasons": [],
    "tag_count_ok": true,
    "unsupported_claims": [],
    "semantic_rework": {
      "status": "fallback_patched",
      "identity": "mcp_integration",
      "source": "semantic_truth_gate",
      "source_backed": true,
      "semantic_truth_source": "semantic_profile",
      "evidence_refs": [
        "high_signal_fields"
      ]
    }
  },
  "schema_version": "0.1",
  "user_assets": {
    "ai_context_pack": {
      "asset_id": "ai_context_pack",
      "filename": "AI_CONTEXT_PACK.md",
      "markdown": "# @apify/actors-mcp-server - Doramagic AI Context Pack\n\n> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。\n\n## 充分原则\n\n- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。\n- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。\n\n## 给宿主 AI 的使用方式\n\n你正在读取 Doramagic 为 @apify/actors-mcp-server 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。\n\n## Claim 消费规则\n\n- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。\n- **事实最低状态**：`supported`\n- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。\n- `weak`：只能作为低置信度线索，必须要求用户继续核实。\n- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。\n- `unverified`：不得作为事实使用，应明确说证据不足。\n- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。\n\n## 它最适合谁\n\n- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0003` supported 0.86\n- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`.claude/skills/bug-triage/SKILL.md`, `.claude/skills/dig/SKILL.md` Claim：`clm_0004` supported 0.86\n\n## 它能做什么\n\n- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`.claude/skills/bug-triage/SKILL.md`, `.claude/skills/dig/SKILL.md` Claim：`clm_0001` supported 0.86\n- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0002` supported 0.86\n\n## 怎么开始\n\n- `npx @apify/actors-mcp-server --tools actors,docs,apify/rag-web-browser` 证据：`README.md` Claim：`clm_0005` supported 0.86\n- `npx @apify/actors-mcp-server --tools apify/my-actor` 证据：`README.md` Claim：`clm_0006` supported 0.86\n- `npx @apify/actors-mcp-server --ui true` 证据：`README.md` Claim：`clm_0007` supported 0.86\n- `npx @apify/actors-mcp-server` 证据：`README.md` Claim：`clm_0005` supported 0.86, `clm_0006` supported 0.86, `clm_0007` supported 0.86, `clm_0008` supported 0.86 等\n- `npx @apify/actors-mcp-server --telemetry-enabled=false` 证据：`README.md` Claim：`clm_0009` supported 0.86\n- `npx @modelcontextprotocol/inspector node ./dist/stdio.js` 证据：`README.md` Claim：`clm_0010` supported 0.86\n\n## 继续前判断卡\n\n- **当前建议**：需要管理员/安全审批\n- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。\n\n### 30 秒判断\n\n- **现在怎么做**：需要管理员/安全审批\n- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装\n- **先别相信**：工具权限边界不能在安装前相信。\n- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件\n\n### 现在可以相信\n\n- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0003` supported 0.86\n- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`.claude/skills/bug-triage/SKILL.md`, `.claude/skills/dig/SKILL.md` Claim：`clm_0004` supported 0.86\n- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.claude/skills/bug-triage/SKILL.md`, `.claude/skills/dig/SKILL.md` Claim：`clm_0001` supported 0.86\n- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86\n- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0005` supported 0.86\n\n### 现在还不能相信\n\n- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。\n- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。\n- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。\n- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.claude/skills/bug-triage/SKILL.md`, `.claude/skills/dig/SKILL.md`, `CLAUDE.md`\n- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。\n- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。\n- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。\n- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`\n\n### 继续会触碰什么\n\n- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`\n- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.claude/skills/bug-triage/SKILL.md`, `.claude/skills/dig/SKILL.md`, `CLAUDE.md`\n- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`\n- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`.mcp.json`, `CLAUDE.md`, `DEVELOPMENT.md`, `README.md` 等\n- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。\n\n### 最小安全下一步\n\n- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）\n- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）\n- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）\n- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）\n- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）\n\n### 退出方式\n\n- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。\n- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。\n- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。\n- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。\n- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。\n\n## 哪些只能预览\n\n- 解释项目适合谁和能做什么\n- 基于项目文档演示典型对话流程\n- 帮助用户判断是否值得安装或继续研究\n\n## 哪些必须安装后验证\n\n- 真实安装 Skill、插件或 CLI\n- 执行脚本、修改本地文件或访问外部服务\n- 验证真实输出质量、性能和兼容性\n\n## 边界与风险判断卡\n\n- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0011` inferred 0.45\n- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0012` supported 0.86\n- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。\n- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。\n- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。\n\n## 开工前工作上下文\n\n### 加载顺序\n\n- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。\n- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。\n- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。\n- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。\n- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。\n\n### 任务路由\n\n- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`.claude/skills/bug-triage/SKILL.md`, `.claude/skills/dig/SKILL.md` Claim：`clm_0001` supported 0.86\n- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86\n\n### 上下文规模\n\n- 文件总数：297\n- 重要文件覆盖：40/297\n- 证据索引条目：77\n- 角色 / Skill 条目：2\n\n### 证据不足时的处理\n\n- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。\n- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。\n- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。\n- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。\n\n## Prompt Recipes\n\n### 适配判断\n\n- 目标：判断这个项目是否适合用户当前任务。\n- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。\n\n```text\n请基于 @apify/actors-mcp-server 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。\n```\n\n### 安装前体验\n\n- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。\n- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。\n\n```text\n请把 @apify/actors-mcp-server 当作安装前体验资产，而不是已安装工具或真实运行环境。\n\n请严格输出四段：\n1. 先问我 3 个必要问题。\n2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。\n3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。\n4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。\n\n硬性边界：\n- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。\n- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。\n- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。\n- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。\n- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。\n- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。\n\n```\n\n### 角色 / Skill 选择\n\n- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。\n- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。\n\n```text\n请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。\n```\n\n### 风险预检\n\n- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。\n- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。\n\n```text\n请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。\n```\n\n### 宿主 AI 开工指令\n\n- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。\n- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。\n\n```text\n请基于 @apify/actors-mcp-server 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。\n```\n\n\n## 角色 / Skill 索引\n\n- 共索引 2 个角色 / Skill / 项目文档条目。\n\n- **bug-triage**（skill）：- 激活提示：当用户任务与“bug-triage”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/bug-triage/SKILL.md`\n- **dig**（skill）：- 激活提示：当用户任务与“dig”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/dig/SKILL.md`\n\n## 证据索引\n\n- 共索引 77 条证据。\n\n- **Apify MCP server**（documentation）：TypeScript, ES modules. Runs in two modes: stdio local CLI clients, stdio.ts and HTTP Streamable dev server.ts . 证据：`CLAUDE.md`\n- **Table of Contents**（documentation）：The Apify Model Context Protocol MCP server at mcp.apify.com https://mcp.apify.com enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, and any other website using thousands of ready-made scrapers, crawlers, and automation tools from Apify Store https://apify.com/store . It supports OAuth, allowing you to connect from clients like Claude.ai or Visual Studio Code using just the URL. 证据：`README.md`\n- **MCP tool selection evaluation**（documentation）：Evaluates MCP server tool selection. Phoenix is used only for storing results and visualization. 证据：`evals/README.md`\n- **Tests**（documentation）：This directory contains unit and integration tests for the actors-mcp-server project. 证据：`tests/README.md`\n- **Workflow Evaluation System**（documentation）：Tests AI agents performing multi-turn conversations with Apify MCP tools, evaluated by an LLM judge. 证据：`evals/workflows/README.md`\n- **Package**（package_manifest）：{ \"name\": \"@apify/actors-mcp-server\", \"version\": \"0.10.9\", \"type\": \"module\", \"description\": \"Apify MCP Server\", \"mcpName\": \"com.apify/apify-mcp-server\", \"engines\": { \"node\": \" =22.0.0\" }, \"devEngines\": { \"packageManager\": { \"name\": \"pnpm\", \"version\": \"11.1.3\", \"onFail\": \"error\" } }, \"packageManager\": \"pnpm@11.1.3\", \"main\": \"dist/index.js\", \"exports\": { \".\": \"./dist/index.js\", \"./internals\": \"./dist/index internals.js\", \"./internals.js\": \"./dist/index internals.js\", \"./manifest.json\": \"./manifest.json\" }, \"bin\": { \"actors-mcp-server\": \"./dist/stdio.js\" }, \"files\": \"dist\", \"LICENSE\", \"package.json\", \"server.json\", \"manifest.json\" , \"repository\": { \"type\": \"git\", \"url\": \"https://github.com/api… 证据：`package.json`\n- **Contributing Guidelines**（documentation）：Welcome! This document describes how to contribute to this repository. Following these guidelines helps us maintain a clean history, consistent quality, and smooth review process. All pull requests are subject to automated and manual review against these guidelines. 证据：`CONTRIBUTING.md`\n- **Package**（package_manifest）：{ \"name\": \"@apify/mcp-web-widget\", \"version\": \"0.1.0\", \"type\": \"module\", \"scripts\": { \"dev\": \"node build.js --watch\", \"build\": \"node build.js\" }, \"keywords\": , \"author\": \"\", \"license\": \"ISC\", \"description\": \"\", \"dependencies\": { \"@apify/ui-icons\": \"^1.27.2\", \"@apify/ui-library\": \"^1.124.0\", \"@modelcontextprotocol/ext-apps\": \"^1.1.2\", \"pluralize\": \"^8.0.0\", \"react\": \"^18.3.1\", \"react-dom\": \"^18.3.1\", \"styled-components\": \"^6.3.8\" }, \"devDependencies\": { \"@types/pluralize\": \"^0.0.33\", \"@types/react\": \"^19.2.7\", \"@types/react-dom\": \"^19.2.3\", \"autoprefixer\": \"^10.4.20\", \"esbuild\": \"^0.28.0\", \"postcss\": \"^8.4.49\", \"tailwindcss\": \"^3.4.17\", \"typescript\": \"^5.6.3\" } } 证据：`src/web/package.json`\n- **Bug Triage**（skill_instruction）：Triage open bug issues on apify/apify-mcp-server . Analyze, draft responses, get approval, post. 证据：`.claude/skills/bug-triage/SKILL.md`\n- **Dig**（skill_instruction）：Flexible skill for exploring, planning, and speccing work on the Apify MCP server. Do NOT edit source files — this skill is for understanding and planning only. 证据：`.claude/skills/dig/SKILL.md`\n- **Changelog**（documentation）：All notable changes to this project will be documented in this file. 证据：`CHANGELOG.md`\n- **Design System Agent Instructions**（documentation）：CRITICAL : These instructions are MANDATORY for all UI/frontend work. Follow exactly as written. 证据：`DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md`\n- **Development**（documentation）：This repository public provides: - The core MCP server implementation published as an NPM package - The stdio entry point CLI - An Express HTTP server for local development and testing 证据：`DEVELOPMENT.md`\n- **License**（documentation）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the \"Software\" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`LICENSE.md`\n- **Failed Cases Analysis & Implementation Guide**（documentation）：Failed Cases Analysis & Implementation Guide 证据：`evals/2025_11_04_failed_cases_analysis.md`\n- **Actor Input Schema: required vs default vs prefill**（documentation）：Actor Input Schema: required vs default vs prefill 证据：`res/actor_input_schema_required_fields.md`\n- **Algolia Search Response Analysis**（documentation）：This document contains insights about Algolia API responses for each documentation source. This information helps understand the data structure returned by Algolia and informs decisions about response processing logic. 证据：`res/algolia.md`\n- **V4 — call-actor redesign RFC**（documentation）：Status: contract being implemented across PRs 823 get-actor-run waitSecs and 825 call-actor waitSecs + storage reshape . Field names below reflect the final shipping shape, not the original draft. Audience: PM and tech lead. No prior reading required — this document is self-contained. 证据：`res/call_actor_redesign_v4.md`\n- **ChatGPT MCP Apps Submission**（documentation）：Status: In Progress Last updated: 2026-03-12 证据：`res/chatgpt-app-submission.md`\n- **Resources Directory Index**（documentation）：This directory contains useful documents and insights about the repository architecture, design decisions, and implementation details that don't belong in code comments or JSDoc. 证据：`res/index.md`\n- **Integration test coverage audit**（documentation）：Audit of tests/integration/suite.ts against the MCP 2025-11-25 spec and the request handlers actually wired in src/mcp/server.ts and src/dev server.ts . Goal: identify protocol-level gaps that block confident deploys, without duplicating SDK or unit tests. 证据：`res/integration_test_coverage_audit.md`\n- **Integration test coverage — implementation plan PR / issue breakdown**（documentation）：Integration test coverage — implementation plan PR / issue breakdown 证据：`res/integration_test_coverage_plan.md`\n- **MCP Resources Implementation Analysis for Apify MCP Server**（documentation）：MCP Resources Implementation Analysis for Apify MCP Server 证据：`res/mcp_resources_analysis.md`\n- **MCP Server Refactoring: Migration to High-Level API**（documentation）：MCP Server Refactoring: Migration to High-Level API 证据：`res/mcp_server_refactor_analysis.md`\n- **MCP Tasks and SDK Features Reference**（documentation）：MCP Tasks and SDK Features Reference 证据：`res/mcp_task_reference.md`\n- **Patterns for Simplifying the Apify MCP Server Codebase**（documentation）：Patterns for Simplifying the Apify MCP Server Codebase 证据：`res/patterns_for_simplification.md`\n- **Pricing output contract**（documentation）：Contract for pricingInfoToStructured and pricingInfoToString in src/utils/pricing info.ts . 证据：`res/pricing_output_contract.md`\n- **tasks/cancel → Actor abort flow**（documentation）：How a client's tasks/cancel request gets translated into an actual apifyClient.run runId .abort call against the Apify platform, and what PR 812 issue 763 changed. 证据：`res/tasks_cancel_abort_flow.md`\n- **Web Widget Bundle Size Notes**（documentation）：The widget bundles in src/web/dist must stay self-contained, but the top-level @apify/ui-library and @apify/ui-icons entrypoints are expensive to bundle. 证据：`res/web-widget-bundle-size.md`\n- **Key principles**（documentation）：You are a development testing agent for the Apify MCP server. Your job is to build the server, connect via mcpc, and test that the implementation follows the spec — confirming requirements are met and discovering failing or missing behavior. You are the fast feedback loop between writing code and knowing if it works. 证据：`.claude/agents/mcpc-tester.md`\n- **.Mcp**（structured_config）：{ \"mcpServers\": { \"storybook\": { \"type\": \"http\", \"url\": \"https://baldasseva--storybook-mcp.apify.actor/mcp?token=${APIFY TOKEN}\" }, \"figma\": { \"type\": \"http\", \"url\": \"https://mcp.figma.com/mcp\" }, \"dev\": { \"type\": \"http\", \"url\": \"http://localhost:3001\", \"headers\": { \"Authorization\": \"Bearer ${APIFY TOKEN}\" } }, \"stdio\": { \"command\": \"node\", \"args\": \"dist/stdio.js\" , \"env\": { \"APIFY TOKEN\": \"${APIFY TOKEN}\", \"NODE EXTRA CA CERTS\": \"${NODE EXTRA CA CERTS}\" } }, \"stdio-full\": { \"command\": \"node\", \"args\": \"dist/stdio.js\", \"--tools=actors,docs,experimental,runs,storage,apify/rag-web-browser\" , \"env\": { \"APIFY TOKEN\": \"${APIFY TOKEN}\", \"NODE EXTRA CA CERTS\": \"${NODE EXTRA CA CERTS}\" } } } } 证据：`.mcp.json`\n- **Claude Code Tools**（structured_config）：{ \"tools\": { \"name\": \"Task\", \"description\": \"Launch a new agent to handle complex, multi-step tasks autonomously. \\n\\nAvailable agent types and the tools they have access to:\\n- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. Tools: \\n- statusline-setup: Use this agent to configure the user's Claude Code status line setting. Tools: Read, Edit \\n- output-style-setup: Use this agent to create a Claude Code output style. Tools: Read, Write, Edit, Gl… 证据：`docs/claude-code-tools.json`\n- **Tsconfig**（structured_config）：{ \"compilerOptions\": { \"target\": \"ES2019\", \"module\": \"ES2022\", \"moduleResolution\": \"bundler\", \"lib\": \"ESNext\" , \"strict\": true, \"esModuleInterop\": true, \"allowSyntheticDefaultImports\": true, \"skipLibCheck\": true, \"noEmit\": true, \"types\": \"vitest/globals\" }, \"include\": \" .ts\" } 证据：`evals/tsconfig.json`\n- **Glama**（structured_config）：{ \"$schema\": \"https://glama.ai/mcp/schemas/server.json\", \"maintainers\": \"jirispilka\", \"mq37\" } 证据：`glama.json`\n- **Manifest**（structured_config）：{ \"manifest version\": \"0.3\", \"name\": \"apify-mcp-server\", \"display name\": \"Apify\", \"version\": \"0.10.9\", \"description\": \"Extract data from any website with thousands of scrapers, crawlers, and automations on Apify Store.\", \"long description\": \"Apify is the world's largest marketplace of tools for web scraping, crawling, data extraction, and web automation. Get structured data from social media, e-commerce, search engines, maps, travel sites, or any other website.\", \"keywords\": \"apify\", \"actors\", \"dataset\", \"mcp\", \"automation\", \"web\", \"web automation\", \"web scraper\", \"web crawler\", \"scraping\", \"crawl\", \"crawler\", \"crawling\", \"ai\", \"data\", \"extraction\", \"bright\", \"fire\", \"data extraction\", \"API… 证据：`manifest.json`\n- **Server**（structured_config）：{ \"$schema\": \"https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json\", \"name\": \"com.apify/apify-mcp-server\", \"description\": \"Extract data from any website with thousands of scrapers, crawlers, and automations on Apify Store ⚡\", \"repository\": { \"url\": \"https://github.com/apify/apify-mcp-server\", \"source\": \"github\" }, \"version\": \"0.10.9\", \"remotes\": { \"type\": \"streamable-http\", \"url\": \"https://mcp.apify.com/\", \"headers\": { \"name\": \"Authorization\", \"description\": \"Apify API token for authentication with Apify platform services. For example 'Bearer '\", \"isRequired\": true, \"isSecret\": true } } } 证据：`server.json`\n- **Tsconfig**（structured_config）：{ \"extends\": \"../tsconfig.json\", \"compilerOptions\": { \"rootDir\": \"./\", \"outDir\": \"../dist\", \"noEmit\": false, }, \"include\": \"./ / \" , \"exclude\": \"web\" } 证据：`src/tsconfig.json`\n- **Tsconfig**（structured_config）：{ \"extends\": \"@apify/tsconfig\", \"compilerOptions\": { \"module\": \"ES2022\", \"moduleResolution\": \"Bundler\", \"skipLibCheck\": true, \"noEmit\": true, }, \"include\": \"src/ / \", \"tests/ / \" , \"exclude\": \"src/web\" } 证据：`tsconfig.json`\n- **Results**（structured_config）：{ \"version\": \"1.0\", \"results\": { \"anthropic/claude-haiku-4.5:x-ai/grok-4.1-fast:search-google-maps\": { \"timestamp\": \"2026-01-07T10:59:07.836Z\", \"agentModel\": \"anthropic/claude-haiku-4.5\", \"judgeModel\": \"x-ai/grok-4.1-fast\", \"testId\": \"search-google-maps\", \"verdict\": \"PASS\", \"reason\": \"The agent used the appropriate search-actors tool with correct arguments to find Google Maps-related actors and provided a clear response with more than 3 results, including names and detailed descriptions meeting all requirements.\", \"durationMs\": 15021, \"turns\": 2, \"error\": null }, \"anthropic/claude-haiku-4.5:x-ai/grok-4.1-fast:search-add-python-actor\": { \"timestamp\": \"2026-01-07T10:59:07.837Z\", \"agentModel\":… 证据：`evals/workflows/results.json`\n- **Tsconfig**（structured_config）：{ \"compilerOptions\": { \"target\": \"ES2020\", \"useDefineForClassFields\": true, \"lib\": \"ES2020\", \"DOM\", \"DOM.Iterable\" , \"module\": \"ESNext\", \"skipLibCheck\": true, \"moduleResolution\": \"bundler\", \"allowSyntheticDefaultImports\": true, \"esModuleInterop\": true, \"resolveJsonModule\": true, \"isolatedModules\": true, \"noEmit\": true, \"jsx\": \"react-jsx\", \"strict\": true, \"noUnusedLocals\": true, \"noUnusedParameters\": true, \"noFallthroughCasesInSwitch\": true, \"types\": }, \"include\": \"src\" } 证据：`src/web/tsconfig.json`\n- **configurations**（source_file）：crawlee and apify storage folders apify storage crawlee storage storage 证据：`.dockerignore`\n- **EditorConfig is a file format and collection of text editor plugins**（source_file）：EditorConfig is a file format and collection of text editor plugins for maintaining consistent coding styles between different editors and IDEs See https://editorconfig.org for more information 证据：`.editorconfig`\n- **EVALS**（source_file）：EVALS PHOENIX API KEY= PHOENIX HOST= 证据：`.env.example`\n- **This file tells Git which files shouldn't be added to source control**（source_file）：This file tells Git which files shouldn't be added to source control 证据：`.gitignore`\n- **.npmignore**（source_file）：.npmignore Exclude everything by default 证据：`.npmignore`\n- **.nvmrc**（source_file）：24 证据：`.nvmrc`\n- **.sentryclirc**（source_file）：defaults org=apify project=apify-mcp 证据：`.sentryclirc`\n- **Stage 1: Build the project**（source_file）：Stage 1: Build the project FROM node:24-alpine AS builder 证据：`Dockerfile`\n- **Apify Logo**（source_file）： 证据：`docs/apify-logo.svg`\n- **Important tool context**（source_file）：/ Configuration for Apify MCP Server evaluations. / 证据：`evals/config.ts`\n- **!/usr/bin/env tsx**（source_file）：!/usr/bin/env tsx / One-time script to create Phoenix dataset from test cases. Run this once to upload test cases to Phoenix platform and receive a dataset ID. / 证据：`evals/create_dataset.ts`\n- **!/usr/bin/env tsx**（source_file）：import dotenv from 'dotenv'; import log from '@apify/log'; import { loadTools, createOpenRouterTask, createToolSelectionLLMEvaluator, loadTestCases, filterById, type TestCase } from './evaluation utils.js'; import { PASS THRESHOLD } from './config.js'; 证据：`evals/eval_single.ts`\n- **Evaluation Utils**（source_file）：/ Shared evaluation utilities extracted from run-evaluation.ts / 证据：`evals/evaluation_utils.ts`\n- **!/usr/bin/env tsx**（source_file）：!/usr/bin/env tsx / Main evaluation script for MCP tool calling TypeScript version . / 证据：`evals/run_evaluation.ts`\n- **Evaluation 2025**（source_file）：{ \"cells\": { \"cell type\": \"markdown\", \"metadata\": { \"id\": \"-CjOraVLBBeV\" }, \"source\": \" MCP Evaluation\\n\", \"\\n\", \" Context\\n\", \"\\n\", \"For the MCP server tool calls evaluation, there are several objectives:\\n\", \"\\n\", \"1. Help to identify problems in the description of the tools\\n\", \"2. Create a test suite that can be run manually or automatically in a CI\\n\", \"3. Allow for quick iteration on the tool descriptions\\n\", \"\\n\", \"We considered several options to evaluate the MCP server tool calls.\\n\", \"\\n\", \"1. ✍️ Create test cases manually \\n\", \"\\n\", \"- Pros: \\n\", \" - Straightforward approach\\n\", \" - Simple to create test cases for each tool\\n\", \"\\n\", \"- Cons: \\n\", \" - A bit complicated to create… 证据：`notebooks/evaluation_2025.ipynb`\n- **Oxlint.Config**（source_file）：import { defineConfig } from '@apify/oxlint-config'; 证据：`oxlint.config.ts`\n- **72-hour quarantine on newly published versions to blunt supply-chain attacks**（source_file）：72-hour quarantine on newly published versions to blunt supply-chain attacks compromised packages typically get yanked within hours of discovery, but the longer window catches slow-detection cases too . Excludes are scopes we publish ourselves and trust on the same release cadence. minimumReleaseAge: 4320 minimumReleaseAgeExclude: - \"@apify/ \" - \"@apify-packages/ \" 证据：`pnpm-workspace.yaml`\n- **Pyproject**（source_file）：project name = \"apify-mcp-evals\" version = \"0.1.0\" description = \"Python evaluations for Apify MCP Server using Arize Phoenix\" requires-python = \" =3.12\" dependencies = \"arize-phoenix =12.5.0\", \"anthropic =0.33.1\", \"openai =1.0.0\", \"pandas =2.0.0\", \"python-dotenv =1.0.0\", \"tqdm =4.65.0\", 证据：`pyproject.toml`\n- **Check Widgets**（source_file）：/ eslint-disable no-console / / Build-time check to ensure widget files exist This script validates that all registered widgets have corresponding files / 证据：`scripts/check_widgets.ts`\n- **!/usr/bin/env node**（source_file）：!/usr/bin/env node / Dev orchestrator: runs web widget builder in watch mode and the MCP server in standby dev mode. Ensures the server always reads compiled assets from src/web/dist while enabling hot-reload. / 证据：`scripts/dev_standby.js`\n- 其余 17 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。\n\n## 宿主 AI 必须遵守的规则\n\n- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`CLAUDE.md`, `README.md`, `evals/README.md`\n- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`CLAUDE.md`, `README.md`, `evals/README.md`\n\n## 用户开工前应该回答的问题\n\n- 你准备在哪个宿主 AI 或本地环境中使用它？\n- 你只是想先体验工作流，还是准备真实安装？\n- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？\n\n## 验收标准\n\n- 所有能力声明都能回指到 evidence_refs 中的文件路径。\n- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。\n- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。\n\n---\n\n## Doramagic Context Augmentation\n\nThe following material strengthens the Repomix/AI Context Pack body. Human Manual is only a reading skeleton; pitfall logs become hard operating constraints for the host AI.\n\n## Human Manual Skeleton\n\nUsage rule: this is only a reading path and salience signal, not factual authority. Concrete facts must still come from repo evidence / Claim Graph.\n\nHard rules for the host AI:\n- Do not treat page titles, order, summaries, or importance as project facts.\n- When explaining the Human Manual skeleton, state that it is only a reading path / salience signal.\n- Capability, installation, compatibility, runtime status, and risk judgments must cite repo evidence, source paths, or Claim Graph.\n\n- **Project Overview**：importance `high`\n  - source_paths: README.md, package.json, src/const.ts\n- **Core Architecture**：importance `high`\n  - source_paths: src/mcp/server.ts, src/mcp/actors.ts, src/mcp/client.ts, src/index.ts, src/types.ts\n- **Transport Layer**：importance `medium`\n  - source_paths: src/stdio.ts, src/server_card.ts, src/index_internals.ts\n- **Tool System**：importance `high`\n  - source_paths: src/tools/index.ts, src/tools/build.ts, src/tools/categories.ts, src/utils/tools_loader.ts, src/utils/tool_categories_helpers.ts\n- **Actor Tools**：importance `high`\n  - source_paths: src/tools/actor_executor.ts, src/tools/core/actor_tools_factory.ts, src/tools/core/call_actor_common.ts, src/tools/apps/call_actor.ts, src/tools/default/call_actor.ts\n- **Storage Access Tools**：importance `medium`\n  - source_paths: src/tools/common/get_dataset.ts, src/tools/common/get_dataset_items.ts, src/tools/common/get_dataset_schema.ts, src/tools/common/get_key_value_store.ts, src/tools/common/get_key_value_store_record.ts\n- **Agentic Payments System**：importance `high`\n  - source_paths: src/payments/index.ts, src/payments/x402.ts, src/payments/skyfire.ts, src/payments/resolve.ts, src/payments/const.ts\n- **Widget System**：importance `medium`\n  - source_paths: src/web/src/components/layout/WidgetLayout.tsx, src/web/src/widgets/actor-detail-widget.tsx, src/web/src/widgets/actor-run-widget.tsx, src/web/src/widgets/search-actors-widget.tsx, src/web/src/utils/init-widget.tsx\n\n## Repo Inspection Evidence\n\n- repo_clone_verified: true\n- repo_inspection_verified: true\n- repo_commit: `a6600017d733743b702f2989008216197b87f0f2`\n- inspected_files: `pyproject.toml`, `pnpm-lock.yaml`, `Dockerfile`, `package.json`, `README.md`, `docs/claude-code-tools.json`, `src/stdio.ts`, `src/server_card.ts`, `src/errors.ts`, `src/index.ts`, `src/index_internals.ts`, `src/types.ts`, `src/instrument.ts`, `src/apify_client.ts`, `src/state.ts`, `src/tsconfig.json`, `src/dev_server.ts`, `src/telemetry.ts`, `src/input.ts`, `src/const.ts`\n\nHard rules for the host AI:\n- Without repo_clone_verified=true, do not claim the source code has been read.\n- Without repo_inspection_verified=true, do not turn README/docs/package observations into facts.\n- Without quick_start_verified=true, do not claim the Quick Start has been successfully run.\n\n## Doramagic Pitfall Constraints\n\nThese rules come from Doramagic discovery, validation, or compilation pitfalls. The host AI must treat them as operating constraints, not general background notes.\n\n### Constraint 1: 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：fix: Allow calling MCP server actors in normal (one-shot) mode\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_be82315ed0f441ba9d942931d846d78c | https://github.com/apify/apify-mcp-server/issues/857 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 2: 来源证据：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n\n- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能影响升级、迁移或版本选择。\n- Evidence: community_evidence:github | cevd_8ec6ff22f24a4bb18b439177f4a8c270 | https://github.com/apify/apify-mcp-server/issues/892 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 3: 来源证据：Do not include the rag web browser when ?payment=x402\n\n- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Do not include the rag web browser when ?payment=x402\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能影响授权、密钥配置或安全边界。\n- Evidence: community_evidence:github | cevd_23bafe4901554148896241f0a1e183b0 | https://github.com/apify/apify-mcp-server/issues/875 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 4: 来源证据：Perf: `search-actors` tools returns huuuge `inputFields` object\n\n- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Perf: `search-actors` tools returns huuuge `inputFields` object\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能影响授权、密钥配置或安全边界。\n- Evidence: community_evidence:github | cevd_af51cb3cbcb3479fbbdf27cedef734aa | https://github.com/apify/apify-mcp-server/issues/888 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 5: 来源证据：feat(telemetry): track tool result size in bytes\n\n- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat(telemetry): track tool result size in bytes\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能影响授权、密钥配置或安全边界。\n- Evidence: community_evidence:github | cevd_9c2ef77c88914458910ae67d9f903931 | https://github.com/apify/apify-mcp-server/issues/838 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 6: 仓库名和安装名不一致\n\n- Trigger: 仓库名 `apify-mcp-server` 与安装入口 `@apify/actors-mcp-server` 不完全一致。\n- Host AI rule: 在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。\n- Why it matters: 用户照着仓库名搜索包或照着包名找仓库时容易走错入口。\n- Evidence: identity.distribution | github_repo:911256711 | https://github.com/apify/apify-mcp-server | repo=apify-mcp-server; install=@apify/actors-mcp-server\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 7: 来源证据：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_9c05c17621e3443dad6175f21db31a34 | https://github.com/apify/apify-mcp-server/issues/894 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 8: 来源证据：feat: Add structured output to remaining storage tools\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: Add structured output to remaining storage tools\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_c9b7c39f3e8f43e88ee52c2c8ae94b01 | https://github.com/apify/apify-mcp-server/issues/884 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 9: 来源证据：feat: migrate direct actor tools to canonical RunResponse shape\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: migrate direct actor tools to canonical RunResponse shape\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能阻塞安装或首次运行。\n- Evidence: community_evidence:github | cevd_6b304ff2763849fe9b4678cc7bf9f5b2 | https://github.com/apify/apify-mcp-server/issues/852 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 10: 来源证据：test: Consolidate duplicated MCP server test fixtures\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：test: Consolidate duplicated MCP server test fixtures\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_5a7a24d9e8ce42468a7775a54dfa8ca6 | https://github.com/apify/apify-mcp-server/issues/847 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n",
      "summary": "Context and operating boundaries for host AI agents.",
      "title": "AI Context Pack"
    },
    "boundary_risk_card": {
      "asset_id": "boundary_risk_card",
      "filename": "BOUNDARY_RISK_CARD.md",
      "markdown": "# Boundary & Risk Card\n\nProject: apify/apify-mcp-server\n\n## Doramagic Trial Decision\n\nCurrent decision: it can enter pre-publication recommendation checks. First use should still start with least privilege, a temporary directory, and reversible configuration.\n\n## What The User Can Do Now\n\n- Read the Human Manual first to understand the project purpose and main workflows.\n- Use Prompt Preview for pre-install exploration; it validates interaction shape, not real execution.\n- Run official Quick Start commands only inside an isolated environment, not a primary setup.\n\n## Do Not Do Yet\n\n- Do not treat Prompt Preview as a real project execution result.\n- Do not treat metadata-only validation as sandbox installation validation.\n- Do not describe unverified capabilities as supported, working, or safe to install.\n- Do not provide production data, private files, real secrets, or primary host configuration on first trial.\n\n## Pre-Install Checklist\n\n- Host AI match: mcp_host\n- Official installation entry status: official entry point found\n- Isolated temporary directory, temporary host, or container validation: required\n- Configuration rollback path: required\n- API keys, network access, file access, or host configuration changes: treat as high risk until confirmed\n- Installation command, actual output, and failure logs: must be recorded\n\n## Current Blockers\n\n- No blockers.\n\n## Project-Specific Pitfalls\n\n- 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode (high): 可能增加新用户试用和生产接入成本。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 来源证据：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]` (high): 可能影响升级、迁移或版本选择。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 来源证据：Do not include the rag web browser when ?payment=x402 (high): 可能影响授权、密钥配置或安全边界。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 来源证据：Perf: `search-actors` tools returns huuuge `inputFields` object (high): 可能影响授权、密钥配置或安全边界。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 来源证据：feat(telemetry): track tool result size in bytes (high): 可能影响授权、密钥配置或安全边界。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n\n## Risk And Permission Notes\n\n- no_demo: medium\n\n## Evidence Gaps\n\n- No structured evidence gaps are currently visible.\n",
      "summary": "Installation, permission, validation, and pre-recommendation risks.",
      "title": "Boundary & Risk Card"
    },
    "human_manual": {
      "asset_id": "human_manual",
      "filename": "HUMAN_MANUAL.md",
      "markdown": "# https://github.com/apify/apify-mcp-server Project Manual\n\nGenerated on: 2026-05-22 10:52:06 UTC\n\n## Table of Contents\n\n- [Project Overview](#overview)\n- [Core Architecture](#architecture-details)\n- [Transport Layer](#transport-layer)\n- [Tool System](#tool-system)\n- [Actor Tools](#actor-tools)\n- [Storage Access Tools](#storage-tools)\n- [Agentic Payments System](#payments-overview)\n- [Widget System](#widget-system)\n- [UI Components Library](#ui-components)\n- [Development Setup](#development-setup)\n\n<a id='overview'></a>\n\n## Project Overview\n\n### Related Pages\n\nRelated topics: [Core Architecture](#architecture-details), [Tool System](#tool-system)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n- [manifest.json](https://github.com/apify/apify-mcp-server/blob/main/manifest.json)\n- [CONTRIBUTING.md](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n- [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n- [res/algolia.md](https://github.com/apify/apify-mcp-server/blob/main/res/algolia.md)\n- [res/mcp_resources_analysis.md](https://github.com/apify/apify-mcp-server/blob/main/res/mcp_resources_analysis.md)\n- [res/index.md](https://github.com/apify/apify-mcp-server/blob/main/res/index.md)\n</details>\n\n# Project Overview\n\nApify MCP Server is a Model Context Protocol (MCP) server that provides AI assistants with access to Apify's platform capabilities. The server acts as a bridge between AI models and Apify's cloud infrastructure, enabling AI assistants to search and interact with Actors, documentation, and web content.\n\nSource: [README.md:1]()\n\n## What is the Apify MCP Server?\n\nThe Apify MCP Server implements the MCP specification to expose Apify platform features as tools that AI assistants can invoke. This allows AI models to:\n\n- Search and discover Actors on the Apify platform\n- Fetch detailed information about specific Actors\n- Search Apify and Crawlee documentation\n- Execute web scraping and automation tasks through the RAG web browser tool\n\nSource: [README.md:22-30]()\n\n## Architecture Overview\n\nThe project follows a monorepo structure with the following key directories:\n\n| Directory | Purpose |\n|-----------|---------|\n| `src/` | Core MCP server implementation |\n| `src/web/` | React UI widgets for MCP Apps (ChatGPT integration) |\n| `tests/unit/` | Unit tests for individual modules |\n| `tests/integration/` | Integration tests for full server functionality |\n| `res/` | Technical documentation and analysis |\n\nSource: [DEVELOPMENT.md:1-20]()\n\n### Server Components\n\nThe MCP server is built around the `ActorsMcpServer` class in `src/mcp/server.ts`, which wraps the low-level MCP `Server` API. The server exposes tools through request handlers for tool listing and tool calling.\n\n```mermaid\ngraph TD\n    A[AI Assistant] -->|MCP Protocol| B[ActorsMcpServer]\n    B -->|Tool Requests| C[Tool Registry]\n    C -->|Actors Tools| D[Actor Discovery & Execution]\n    C -->|Docs Tools| E[Algolia Search API]\n    C -->|RAG Tools| F[RAG Web Browser]\n    D -->|API Calls| G[Apify API]\n    E -->|Search Queries| H[Algolia]\n    F -->|Browser Actions| I[Crawlee/Puppeteer]\n```\n\nSource: [res/mcp_resources_analysis.md:1-15]()\n\n## Available Tools\n\nThe server provides the following tool categories and individual tools:\n\n### Default Tools\n\nWhen no query parameters are provided, the MCP server loads these tools by default:\n\n| Tool Category | Description |\n|---------------|-------------|\n| `actors` | Search and discover Actors on the Apify platform |\n| `docs` | Search Apify and Crawlee documentation |\n| `apify/rag-web-browser` | RAG-enabled web browsing for AI consumption |\n\nSource: [README.md:48-52]()\n\n### Tool Configuration\n\nTools can be configured via query parameters or command-line flags:\n\n| Configuration Method | Example |\n|----------------------|---------|\n| Hosted server URL | `https://mcp.apify.com?tools=actors,docs,apify/rag-web-browser` |\n| CLI flag | `npx @apify/actors-mcp-server --tools actors,docs` |\n| Minimal (single Actor) | `https://mcp.apify.com?tools=apify/my-actor` |\n\nSource: [README.md:55-75]()\n\n### Unauthenticated Access\n\nThe hosted server allows access without an API token when only specific tools are requested:\n\n| Allowed Tool | Description |\n|--------------|-------------|\n| `search-actors` | Search Actors without authentication |\n| `fetch-actor-details` | Get Actor details without authentication |\n| `search-apify-docs` | Search Apify docs without authentication |\n| `fetch-apify-docs` | Get doc pages without authentication |\n\nSource: [README.md:33-35]()\n\n## Deployment Modes\n\nThe Apify MCP Server supports multiple deployment configurations:\n\n### HTTP Streamable Mode\n\nRuns as an HTTP server compatible with the streamable HTTP transport:\n\n```bash\nexport APIFY_TOKEN=\"your-apify-token\"\nexport APIFY_META_ORIGIN=STANDBY\napify run -p\n```\n\nThe server exposes endpoints at `http://localhost:3001` by default.\n\nSource: [README.md:14-20]()\n\n### Standard Input/Output (stdio) Mode\n\nRuns as a subprocess communicating via stdin/stdout, suitable for local development and debugging:\n\n```bash\nnpx @modelcontextprotocol/inspector node ./dist/stdio.js\n```\n\nSource: [README.md:22-30]()\n\n### Claude Desktop Integration\n\nThe server can be configured as a Claude Desktop MCP tool:\n\n```json\n{\n  \"mcpServers\": {\n    \"apify\": {\n      \"command\": \"node\",\n      \"args\": [\"${__dirname}/dist/stdio.js\", \"--tools\", \"${user_config.tools}\"],\n      \"env\": {\n        \"APIFY_TOKEN\": \"${user_config.apify_token}\"\n      }\n    }\n  }\n}\n```\n\nSource: [manifest.json:35-45]()\n\n## User Configuration\n\nThe server accepts the following user configuration options:\n\n| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n| `apify_token` | string | Yes* | - | Apify API token from console.apify.com |\n| `tools` | string | No | `actors,docs,apify/rag-web-browser` | Comma-separated list of tool categories or specific Actors |\n\n*Required unless using unauthenticated access with specific tools.\n\nSource: [manifest.json:47-65]()\n\n## Documentation Search Architecture\n\nThe docs tool integrates with Algolia to provide search across Apify and Crawlee documentation:\n\n```mermaid\ngraph LR\n    A[Search Query] -->|Algolia API| B[Algolia Index]\n    B -->|Results| C[processAlgoliaResponse]\n    C -->|URLs with fragments| D[LLM Response]\n    \n    E[Fetch Tool] -->|URL Request| F[Documentation Site]\n    F -->|HTML Content| E\n```\n\n### Algolia Response Processing\n\nThe server processes Algolia responses differently based on the documentation source:\n\n| Source | URL Fragments | Content Field |\n|--------|---------------|---------------|\n| Apify docs | Supported | Always populated |\n| Crawlee docs | Not supported | Not available |\n\nSource: [res/algolia.md:1-50]()\n\n### URL Fragment Handling\n\nThe server embeds page anchors directly in returned URLs for section-specific navigation:\n\n```typescript\n// Returns ready-to-use URLs with anchors\n{ url: \"https://docs.apify.com/actors#build-actors\", content: \"...\" }\n```\n\nThis approach simplifies the LLM's ability to navigate to specific sections without complex URL reconstruction logic.\n\nSource: [res/algolia.md:55-70]()\n\n## MCP Resources\n\nThe server exposes MCP resources for specific use cases:\n\n| Resource Type | URI Pattern | Description |\n|---------------|-------------|-------------|\n| Skyfire usage guide | `file://readme.md` | Enabled when `skyfireMode` is true |\n| UI widgets | `ui://widget/*` | React widgets for OpenAI MCP Apps |\n\nSource: [res/mcp_resources_analysis.md:15-30]()\n\n## Development Setup\n\n### Prerequisites\n\n| Requirement | Version |\n|-------------|---------|\n| Node.js | >=20.0.0 |\n| pnpm | 11+ |\n\nSource: [DEVELOPMENT.md:25-30]()\n\n### Installation\n\n```bash\ncorepack enable     # enables pnpm via corepack\npnpm install        # installs root + src/web workspace packages\n```\n\nSource: [DEVELOPMENT.md:30-35]()\n\n### Building\n\n```bash\npnpm run build\n```\n\nBuilds the TypeScript source to JavaScript in the `dist/` directory.\n\nSource: [DEVELOPMENT.md:60-65]()\n\n## Testing\n\nThe project maintains multiple testing layers:\n\n| Test Layer | Command | Coverage |\n|------------|---------|----------|\n| Unit tests | `pnpm run test:unit` | Individual modules in isolation |\n| Integration tests | `pnpm run test:integration` | Full server over all transports |\n| LLM evals | CI only (apply `validated` label) | Multiple AI models via OpenRouter |\n\nSource: [DEVELOPMENT.md:8-20]()\n\n### Test Configuration\n\n| Environment Variable | Purpose |\n|---------------------|---------|\n| `APIFY_TOKEN` | Required for integration tests |\n| `PHOENIX_*` | Phoenix evaluation secrets |\n| `OPENROUTER_*` | OpenRouter API secrets |\n\nSource: [DEVELOPMENT.md:15-20]()\n\n## UI Widgets\n\nFor OpenAI MCP Apps integration, the server supports React-based UI widgets located in `src/web/`. Widgets are rendered based on tool output and require the server to run in UI mode:\n\n```\nhttps://mcp.apify.com?ui=true\n```\n\nOr set the environment variable `UI_MODE=true`.\n\nSource: [DEVELOPMENT.md:50-55]()\n\n### Widget Configuration\n\nWidgets must use the Apify design system tokens:\n\n| Property | Token Pattern | Example |\n|----------|---------------|---------|\n| Text color | `theme.color.{cat}.{prop}` | `theme.color.neutral.text` |\n| Background | `theme.color.{cat}.{prop}` | `theme.color.primary.background` |\n| Spacing | `theme.space.space{N}` | `theme.space.space16` |\n| Border radius | `theme.radius.radius{N}` | `theme.radius.radius8` |\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md:1-20]()\n\n## Contribution Guidelines\n\nThe project follows conventional commits for versioning and changelog generation:\n\n### Branch Naming\n\n```text\nfeat/add-dataset-tool\nfix/connection-timeout\nchore/update-dependencies\n```\n\n### Commit Format\n\n```\n<type>(<scope>): <description>\n\nTypes: feat, fix, refactor, chore, docs, test, etc.\n```\n\nBreaking changes are indicated with `!` after the scope.\n\nSource: [CONTRIBUTING.md:1-30]()\n\n## Compatibility\n\n| Platform | Claude Desktop Version | Node.js |\n|----------|----------------------|---------|\n| macOS (darwin) | >=0.2.16 | >=20.0.0 |\n| Windows (win32) | >=0.2.16 | >=20.0.0 |\n| Linux | >=0.2.16 | >=20.0.0 |\n\nSource: [manifest.json:20-28]()\n\n## Repository Structure\n\nThe codebase is split across two repositories:\n\n| Repository | Purpose |\n|------------|---------|\n| `apify-mcp-server` (this repo) | Core MCP logic and public code |\n| `apify-mcp-server-internal` | Hosted server deployment |\n\nChanges must be synchronized between both repositories. Canary releases are created by adding the `beta` tag to a PR branch.\n\nSource: [README.md:38-42]()\n\n---\n\n<a id='architecture-details'></a>\n\n## Core Architecture\n\n### Related Pages\n\nRelated topics: [Project Overview](#overview), [Transport Layer](#transport-layer)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n- [src/mcp/actors.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/actors.ts)\n- [src/mcp/client.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/client.ts)\n- [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts)\n- [src/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts)\n- [src/mcp/proxy.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/proxy.ts)\n</details>\n\n# Core Architecture\n\nThe Apify MCP Server implements a Model Context Protocol (MCP) server that exposes Apify platform capabilities as tools for Large Language Models (LLMs). The architecture uses the low-level MCP `Server` SDK with a custom tool management system, supporting both stdio and HTTP Streamable transports.\n\n## System Overview\n\nThe server acts as a bridge between LLMs and the Apify platform, enabling AI assistants to:\n\n- Search and discover Actors on the Apify platform\n- Execute Actors programmatically\n- Access Apify documentation\n- Manage Actor runs and retrieve results\n- Proxy external MCP servers through Actorized deployments\n\nSource: [src/mcp/server.ts:1-50](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n```mermaid\ngraph TD\n    subgraph \"Transport Layer\"\n        STDIO[stdio.ts<br/>Standard I/O]\n        HTTP[dev_server.ts<br/>HTTP Streamable]\n    end\n    \n    subgraph \"Core Server\"\n        AMS[ActorsMcpServer]\n        TM[Tool Manager<br/>Map&lt;string, ToolEntry&gt;]\n        TS[TaskStore]\n        AS[ActorStore]\n    end\n    \n    subgraph \"Tool Registry\"\n        HT[Helper Tools]\n        AT[Actor Tools]\n        AMT[Actor-MCP Proxy Tools]\n    end\n    \n    subgraph \"External Services\"\n        APIFY[Apify API]\n        APIClient[ApifyClient]\n    end\n    \n    STDIO --> AMS\n    HTTP --> AMS\n    AMS --> TM\n    AMS --> TS\n    AMS --> AS\n    TM --> HT\n    TM --> AT\n    TM --> AMT\n    AMS --> APIClient\n    APIClient --> APIFY\n```\n\n## High-Level Component Architecture\n\n### ActorsMcpServer (Central Coordinator)\n\nThe `ActorsMcpServer` class is the core component that orchestrates all MCP functionality:\n\n| Property | Type | Purpose |\n|----------|------|---------|\n| `server` | `Server` | Low-level MCP SDK server instance |\n| `tools` | `Map<string, ToolEntry>` | Tool registry for all registered tools |\n| `taskStore` | `TaskStore` | Tracks running and completed tasks |\n| `actorStore` | `ActorStore` | Caches Actor metadata and input schemas |\n| `serverMode` | `ServerMode` | Resolved server mode (default/apps) |\n| `options` | `ActorsMcpServerOptions` | Server configuration options |\n\nSource: [src/mcp/server.ts:280-320](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Tool Entry Types\n\nThe server manages three distinct tool types defined in the discriminated union:\n\n```typescript\ntype ToolEntry = HelperTool | ActorTool | ActorMcpTool;\n```\n\n| Tool Type | Type Discriminator | Purpose | Source |\n|-----------|-------------------|---------|--------|\n| `HelperTool` | `type: 'internal'` | Built-in server tools (search, docs) | [src/types.ts:135-145](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) |\n| `ActorTool` | `type: 'actor'` | Dynamic Actor-based tools | [src/types.ts:147-153](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) |\n| `ActorMcpTool` | `type: 'actor-mcp'` | External MCP server proxy via Actor | [src/types.ts:155-162](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) |\n\nSource: [src/types.ts:130-175](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts)\n\n## Transport Architecture\n\nThe server supports two transport mechanisms, selected based on deployment context:\n\n### Stdio Transport\n\nUsed for local CLI clients and the MCP Inspector. Communication occurs through standard input/output streams.\n\nSource: [src/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index.ts)\n\n### HTTP Streamable Transport\n\nUsed for hosted deployments at `mcp.apify.com`. Enables remote client connections with streaming response support.\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n| Transport | Use Case | Entry Point |\n|-----------|----------|-------------|\n| stdio | Local CLI, MCP Inspector | `stdio.ts` |\n| HTTP Streamable | Hosted server, remote clients | `dev_server.ts` |\n\n## Request Handler Architecture\n\nThe server uses low-level MCP SDK request handlers for all protocol operations:\n\n### Handler Registration Pattern\n\n```typescript\nserver.setRequestHandler(ListToolsRequestSchema, async () => { ... });\nserver.setRequestHandler(CallToolRequestSchema, async (request) => { ... });\nserver.setRequestHandler(ListResourcesRequestSchema, async () => { ... });\nserver.setRequestHandler(ReadResourceRequestSchema, async (request) => { ... });\n```\n\nSource: [src/mcp/server.ts:200-250](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Central Tool Dispatcher\n\nAll tool calls flow through a central dispatcher that routes based on tool type:\n\n```mermaid\ngraph LR\n    A[CallTool Request] --> B{Extract toolName}\n    B --> C{Lookup in tools Map}\n    C -->|HelperTool| D[Execute call function]\n    C -->|ActorTool| E[Call Apify API]\n    C -->|ActorMcpTool| F[Proxy to Actor-MCP]\n    D --> G[Return result]\n    E --> G\n    F --> G\n```\n\nSource: [src/mcp/server.ts:400-500](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Tool Lifecycle Management\n\n### Dynamic Tool Loading\n\nActors are loaded as tools through the `loadActorsAsTools()` method:\n\n1. Fetch Actor list from Apify API or configured Actor IDs\n2. Transform Actor metadata into `ActorTool` entries\n3. Upsert tools into the registry Map\n4. Send `notifications/tools/list_changed` to connected clients\n\nSource: [src/mcp/actors.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/actors.ts)\n\n### Tool Registration Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Server as ActorsMcpServer\n    participant API as Apify API\n    participant Store as tools Map\n    \n    Client->>Server: initialize (capabilities)\n    Server->>Server: resolveServerMode()\n    Server->>API: fetchActors() / getActorDetails()\n    API-->>Server: Actor metadata\n    Server->>Store: upsertTools()\n    Server-->>Client: tools/list response\n    Client->>Server: notifications/tools/list_changed\n```\n\n## Server Mode System\n\nThe server supports automatic mode detection based on client capabilities:\n\n| Mode | Trigger | Behavior |\n|------|---------|----------|\n| `default` | Non-MCP Apps clients | Standard tool responses |\n| `apps` | MCP Apps clients (`uiMode === 'openai'`) | Enhanced responses with widget metadata |\n\nSource: [src/mcp/server.ts:300-340](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Mode Auto-Detection\n\nThe `serverMode` property transitions from `'auto'` to either `'default'` or `'apps'` during the `initialize` request handler:\n\n```typescript\n// Preliminary value at construction\npublic serverMode: ServerMode;\n\n// Finalized inside initialize handler\nprivate serverModeResolved: boolean;\n```\n\nSource: [src/mcp/server.ts:310-325](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Resource System\n\nThe server implements MCP resources for UI widgets and documentation:\n\n### Resource Types\n\n| Resource Type | URI Pattern | Condition | Source |\n|---------------|-------------|-----------|--------|\n| Skyfire Guide | `file://readme.md` | `skyfireMode === true` | [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts) |\n| UI Widgets | `ui://widget/*.html` | `uiMode === 'openai'` | [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts) |\n\n### Resource Handler Implementation\n\n```typescript\nreturn {\n    listResources,\n    readResource,\n    listResourceTemplates: async () => ({ resourceTemplates: [] }),\n};\n```\n\nSource: [src/mcp/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/resources/resource_service.ts)\n\n## Actor-MCP Proxy Architecture\n\nExternal MCP servers can be proxied through the Apify platform using the `ActorMcpTool` type:\n\n```mermaid\ngraph LR\n    subgraph \"This Server\"\n        A[ActorMcpTool] --> B[proxy.ts]\n    end\n    \n    subgraph \"Apify Platform\"\n        B -->|callActor| C[Actor Container]\n    end\n    \n    subgraph \"Remote MCP Server\"\n        C -->|HTTP| D[External Server]\n        D -->|MCP Response| C\n    end\n    \n    C -->|Actor Result| B\n```\n\nSource: [src/mcp/proxy.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/proxy.ts)\n\n## Task Management\n\n### TaskStore\n\nThe `TaskStore` class manages long-running task execution:\n\n| Method | Purpose |\n|--------|---------|\n| `createTask()` | Initialize a new task |\n| `updateTask()` | Update task status/progress |\n| `getTask()` | Retrieve task details |\n| `listTasks()` | List all tasks |\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n### Progress Tracking\n\nLong-running operations support progress notifications via `createProgressTracker`:\n\n```typescript\nconst tracker = createProgressTracker(taskId, totalSteps);\ntracker.report(progress, total, message);\n```\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Client Configuration\n\n### ApifyClient Integration\n\nThe server uses the Apify JavaScript client for API communication:\n\n```typescript\nconst apifyClient = new ApifyClient({\n    token: apifyToken,\n});\n```\n\nSource: [src/mcp/client.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/client.ts)\n\n### Token Propagation\n\n| Location | Mechanism |\n|----------|------------|\n| HTTP Headers | `Authorization: Bearer <token>` |\n| MCP Meta | `_meta.apifyToken` in tool call |\n\nSource: [src/mcp/server.ts:630-650](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Configuration Options\n\nThe `ActorsMcpServerOptions` interface defines server configuration:\n\n| Option | Type | Default | Purpose |\n|--------|------|---------|---------|\n| `apifyToken` | `string` | Required | Apify API authentication |\n| `tools` | `string \\| string[]` | `default` | Tool categories/Actors to load |\n| `serverMode` | `ServerModeOption` | `'auto'` | Server mode override |\n| `skyfireMode` | `boolean` | `false` | Enable Skyfire-specific resources |\n| `uiMode` | `UiMode` | `'default'` | UI response format |\n\nSource: [src/mcp/server.ts:200-280](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Capability Advertisement\n\nThe server advertises the following MCP capabilities during initialization:\n\n```typescript\ncapabilities: {\n    logging: {},\n    prompts: { listChanged: false },\n    resources: options.skyfireMode ? { listChanged: false } : undefined,\n    tools: { listChanged: true },\n}\n```\n\nSource: [src/mcp/server.ts:210-218](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Entry Points\n\n| Entry Point | Transport | File |\n|-------------|-----------|------|\n| `dist/stdio.js` | stdio | `src/stdio.ts` |\n| `dist/index.js` (HTTP) | Streamable HTTP | `src/dev_server.ts` |\n\nSource: [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n---\n\n<a id='transport-layer'></a>\n\n## Transport Layer\n\n### Related Pages\n\nRelated topics: [Core Architecture](#architecture-details), [Development Setup](#development-setup)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts)\n- [src/server_card.ts](https://github.com/apify/apify-mcp-server/blob/main/src/server_card.ts)\n- [src/index_internals.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index_internals.ts)\n- [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n- [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n- [src/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index.ts)\n</details>\n\n# Transport Layer\n\nThe Apify MCP Server implements a dual-transport architecture that supports both local command-line clients and remote HTTP clients. This design allows the same core server logic to operate in different deployment scenarios while maintaining a consistent MCP protocol implementation.\n\n## Overview\n\nThe transport layer handles the communication between MCP clients and the `ActorsMcpServer` core. The server supports two primary transport mechanisms:\n\n| Transport Mode | Entry Point | Use Case | Protocol |\n|---------------|-------------|----------|----------|\n| **Stdio** | `stdio.ts` | Local CLI clients, Claude Code, MCP Inspector | Standard I/O via process stdin/stdout |\n| **HTTP Streamable** | `dev_server.ts` | Remote clients, hosted deployment at mcp.apify.com | Streamable HTTP with Server-Sent Events |\n\nSource: [src/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index.ts) · [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n## Architecture Diagram\n\n```mermaid\ngraph TB\n    subgraph \"Client Layer\"\n        CLI[CLI Client]\n        HTTP_CLIENT[HTTP Client]\n        MCP_INSPECTOR[MCP Inspector]\n    end\n\n    subgraph \"Transport Layer\"\n        STDIO[Stdio Transport<br/>stdio.ts]\n        HTTP[HTTP Transport<br/>dev_server.ts]\n        WEBSOCKET[WebSocket Support<br/>mcp/server.ts]\n    end\n\n    subgraph \"Core Server\"\n        SERVER[ActorsMcpServer<br/>server.ts]\n        TOOLS[Tool Handlers]\n        RESOURCES[Resource Handlers]\n        TASKS[Task Store]\n    end\n\n    CLI --> STDIO\n    HTTP_CLIENT --> HTTP\n    MCP_INSPECTOR -->|stdio mode| STDIO\n    MCP_INSPECTOR -->|http mode| HTTP\n\n    STDIO --> SERVER\n    HTTP --> SERVER\n    WEBSOCKET --> SERVER\n\n    SERVER --> TOOLS\n    SERVER --> RESOURCES\n    SERVER --> TASKS\n```\n\n## Stdio Transport\n\nThe Standard I/O transport is designed for local development and CLI-based clients. It communicates via process stdin and stdout using JSON-RPC messages.\n\n### Entry Point\n\nThe stdio transport is initialized in `src/stdio.ts`:\n\n```typescript\nimport { createStdioServer } from '@modelcontextprotocol/sdk/server/stdio';\n\n// Server initialization with transport\nconst server = new ActorsMcpServer(options);\nconst transport = createStdioServer();\nawait server.connect(transport);\n```\n\nSource: [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts)\n\n### Connection Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Stdio as Stdio Transport\n    participant Server as ActorsMcpServer\n\n    Note over Client,Stdio: Process startup\n    Stdio->>Server: Initialize connection\n    Server->>Stdio: MCP handshake (initialize)\n    Client->>Stdio: Initialize response\n    Stdio->>Server: Handshake complete\n\n    loop Message Loop\n        Client->>Stdio: JSON-RPC Request\n        Stdio->>Server: Forward request\n        Server->>Server: Process tool/resource/task\n        Server->>Stdio: JSON-RPC Response\n        Stdio->>Client: Response output\n    end\n\n    Note over Client,Stdio: Process termination\n    Client->>Stdio: SIGINT\n    Stdio->>Server: Cleanup\n```\n\n### Configuration\n\nThe stdio transport inherits server configuration from environment variables and constructor options:\n\n| Parameter | Source | Description |\n|-----------|--------|-------------|\n| `APIFY_TOKEN` | Environment | Apify API authentication token |\n| `serverMode` | Constructor | `\"default\"`, `\"apps\"`, or `\"auto\"` |\n| `skyfireMode` | Constructor | Enables Skyfire usage guide resource |\n\nSource: [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts) · [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## HTTP Streamable Transport\n\nThe HTTP transport enables remote client connections using the MCP Streamable HTTP specification. This is used for the hosted deployment at `mcp.apify.com`.\n\n### Server Implementation\n\nThe HTTP server is implemented using Express in `src/dev_server.ts`:\n\n```typescript\nimport express from 'express';\nimport { createServer } from 'http';\nimport { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/http';\n\nconst app = express();\nconst server = createServer(app);\n\n// Streamable HTTP transport with session management\nconst transport = new StreamableHTTPServerTransport({\n    sessionIdGenerator: () => crypto.randomUUID(),\n    onSession: initializeSession,\n});\n```\n\nSource: [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n### HTTP Endpoints\n\n| Endpoint | Method | Purpose |\n|----------|--------|---------|\n| `/mcp` | POST | JSON-RPC requests (tools, resources, tasks) |\n| `/mcp` | GET | Server-Sent Events for notifications |\n| `/health` | GET | Health check endpoint |\n\nSource: [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n### Session Management\n\n```mermaid\ngraph LR\n    A[Client] -->|1. POST /mcp| B{Has Session ID?}\n    B -->|No| C[Create New Session]\n    B -->|Yes| D[Find Existing Session]\n    C --> E[Initialize MCP]\n    D --> E\n    E --> F[Store in Map]\n    F --> G[Process Request]\n    G --> H[Return Response]\n```\n\nThe transport uses UUID-based session identifiers to maintain separate server instances per client connection.\n\nSource: [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n## Server Card\n\nThe `ServerCard` component provides metadata and capability information about the MCP server for discovery and documentation purposes.\n\n### ServerCard Structure\n\n```typescript\nexport interface ServerCard {\n    name: string;\n    version: string;\n    description: string;\n    homepageUrl: string;\n    repositoryUrl: string;\n    documentationUrl: string;\n    capabilities: ServerCapabilities;\n    auth?: AuthConfig;\n    configSchema?: Record<string, unknown>;\n}\n```\n\nSource: [src/server_card.ts](https://github.com/apify/apify-mcp-server/blob/main/src/server_card.ts)\n\n### Capability Declaration\n\nThe server advertises its capabilities during the MCP `initialize` handshake:\n\n```typescript\nconst capabilities = {\n    tools: { listChanged: true },\n    tasks: { list: true, cancel: true, requests: { tools: { call: true } } },\n    resources: {},\n    prompts: {},\n    logging: {},\n};\n```\n\nSource: [src/mcp/server.ts:146](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts#L146)\n\n## Internal Exports\n\nThe `index_internals.ts` module exposes internal components for testing and advanced usage scenarios:\n\n| Export | Type | Purpose |\n|--------|------|---------|\n| `ActorsMcpServer` | Class | Core MCP server implementation |\n| `createResourceService` | Function | Resource service factory |\n| `ToolEntry` | Type | Union type for all tool variants |\n| `ServerMode` | Enum | Server operating mode |\n\nSource: [src/index_internals.ts](https://github.com/apify/apify-mcp-server/blob/main/src/index_internals.ts)\n\n## Server Modes\n\nThe transport layer operates differently based on the selected server mode:\n\n| Mode | Description | Transport Impact |\n|------|-------------|------------------|\n| `default` | Standard Apify tools | All tools available |\n| `apps` | OpenAI UI widgets mode | Additional UI widget resources |\n| `auto` | Capability-based detection | Mode resolved during initialize |\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Request Handler Wiring\n\nAll transports delegate to the same core request handlers registered in `ActorsMcpServer`:\n\n```mermaid\ngraph TD\n    T1[Stdio Transport] --> S[ActorsMcpServer]\n    T2[HTTP Transport] --> S\n    T3[WebSocket Transport] --> S\n\n    S --> H1[ListToolsRequestHandler]\n    S --> H2[CallToolRequestHandler]\n    S --> H3[ListResourcesRequestHandler]\n    S --> H4[ReadResourceRequestHandler]\n    S --> H5[ListTasksRequestHandler]\n    S --> H6[GetTaskRequestHandler]\n\n    H1 --> T[Tool Execution]\n    H2 --> T\n```\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts) · [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n## Integration with MCP SDK\n\nThe transport layer uses the official `@modelcontextprotocol/sdk` package for protocol implementation:\n\n| SDK Component | Usage |\n|--------------|-------|\n| `Server` | Low-level MCP protocol server |\n| `StreamableHTTPServerTransport` | HTTP transport implementation |\n| `createStdioServer` | Stdio transport factory |\n| `RequestHandlerExtra` | Request context wrapper |\n\nSource: [src/stdio.ts](https://github.com/apify/apify-mcp-server/blob/main/src/stdio.ts) · [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n\n## Testing Transport Layers\n\nThe project includes transport-specific integration tests:\n\n| Test File | Transport | Coverage |\n|-----------|-----------|----------|\n| `tests/integration/suite.ts` | All transports | Main test suite |\n| `stdio.ts` (in integration) | Stdio | Stdin/stdout messaging |\n| `http.ts` (in integration) | HTTP Streamable | REST endpoints |\n| `sse.ts` (in integration) | Server-Sent Events | Notification streaming |\n\nSource: [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md) · [tests/integration/](https://github.com/apify/apify-mcp-server/blob/main/tests/integration/)\n\n## Summary\n\nThe Apify MCP Server implements a transport-agnostic architecture where:\n\n1. **Stdio Transport** handles local CLI clients through stdin/stdout JSON-RPC messaging\n2. **HTTP Transport** enables remote access via Streamable HTTP with session management\n3. **Core Server** (`ActorsMcpServer`) remains independent of transport implementation\n4. **Capability negotiation** occurs during MCP initialize handshake\n5. **All transports** delegate to the same request handlers for tools, resources, and tasks\n\nThis separation allows the server to serve both local development needs and production hosted deployments while maintaining a single, testable codebase.\n\n---\n\n<a id='tool-system'></a>\n\n## Tool System\n\n### Related Pages\n\nRelated topics: [Actor Tools](#actor-tools), [Storage Access Tools](#storage-tools)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts) (primary server implementation)\n- [src/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts) (tool type definitions)\n- [src/tools/common/search_apify_docs.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/search_apify_docs.ts) (tool implementation example)\n- [src/mcp/proxy.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/proxy.ts) (Actor-MCP proxy tools)\n- [res/mcp_server_refactor_analysis.md](https://github.com/apify/apify-mcp-server/blob/main/res/mcp_server_refactor_analysis.md) (architecture analysis)\n- [res/mcp_resources_analysis.md](https://github.com/apify/apify-mcp-server/blob/main/res/mcp_resources_analysis.md) (resources and tools overview)\n</details>\n\n# Tool System\n\nThe Tool System is the core component of the Apify MCP Server, enabling AI assistants to interact with Apify's platform capabilities through a standardized Model Context Protocol (MCP) interface. The system provides dynamic tool loading, registration, execution, and removal capabilities for three distinct tool types: internal helper tools, Actor tools, and Actor-MCP proxy tools.\n\n## Architecture Overview\n\nThe Tool System follows a centralized registration model where `ActorsMcpServer` manages all tool lifecycle operations. Tools are stored in a `Map<string, ToolEntry>` and exposed to MCP clients via request handlers. Source: [src/mcp/server.ts]()\n\n```mermaid\ngraph TD\n    subgraph \"MCP Client\"\n        A[Claude / VS Code]\n    end\n    \n    subgraph \"ActorsMcpServer\"\n        B[Server Instance]\n        C[Tool Registry Map]\n        D[setupToolHandlers]\n        E[Central Dispatcher]\n    end\n    \n    subgraph \"Tool Types\"\n        F[HelperTool]\n        G[ActorTool]\n        H[ActorMcpTool]\n    end\n    \n    A -->|tools/call| B\n    B --> D\n    D -->|route by type| E\n    E -->|internal| F\n    E -->|actor| G\n    E -->|actor-mcp| H\n    \n    C -.->|stores| F\n    C -.->|stores| G\n    C -.->|stores| H\n```\n\n## Tool Type Definitions\n\nThe system defines three tool types through discriminated unions in `src/types.ts`. Source: [src/types.ts:135-174]()\n\n| Tool Type | Description | Execution Mode |\n|-----------|-------------|-----------------|\n| `HelperTool` | Internal server tools with direct callback execution | Synchronous |\n| `ActorTool` | Apify Actor-based tools for scalable execution | Asynchronous via Actor API |\n| `ActorMcpTool` | External MCP server tools proxied through Apify | Delegated to origin server |\n\n### HelperTool\n\nInternal tools that execute directly within the server process:\n\n```typescript\ntype HelperTool = ToolBase & {\n    type: 'internal';\n    call: (toolArgs: InternalToolArgs) => Promise<object>;\n};\n```\n\nExamples include `search-actors`, `fetch-actor-details`, `search-apify-docs`, and `fetch-apify-docs`. Source: [README.md]()\n\n### ActorTool\n\nTools that invoke Apify Actors on the platform:\n\n```typescript\ntype ActorTool = ToolBase & {\n    type: 'actor';\n    actorFullName: string;\n    memoryMbytes?: number;\n};\n```\n\nThese tools launch Actors with configurable memory allocation for scalable cloud execution.\n\n### ActorMcpTool\n\nProxied tools from external MCP servers, enabling the Apify platform to bridge between MCP implementations:\n\n```typescript\ntype ActorMcpTool = ToolBase & {\n    type: 'actor-mcp';\n    originToolName: string;\n    actorId: string;\n    serverId: string;\n    serverUrl: string;\n};\n```\n\n## Tool Registration Flow\n\nTools are loaded and registered through a multi-stage process:\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Server as ActorsMcpServer\n    participant Loader as tools_loader.ts\n    participant Registry as Tool Registry\n    \n    Client->>Server: loadActorsAsTools()\n    Server->>Loader: loadToolsByCategory(tools)\n    Loader-->>Server: Tool definitions\n    Server->>Server: upsertTools(toolDefs)\n    Server->>Registry: Map.set(name, entry)\n    Server->>Client: sendToolListChanged()\n```\n\n### Dynamic Loading\n\nThe `loadActorsAsTools()` method handles dynamic tool loading based on configuration. When called, it:\n\n1. Resolves tool categories or specific Actor names from configuration\n2. Loads tool definitions from `src/utils/tools_loader.ts`\n3. Calls `upsertTools()` to register each tool\n4. Broadcasts `tools/list_changed` notification to connected clients Source: [res/mcp_server_refactor_analysis.md]()\n\n### Tool Removal\n\nThe `removeToolsByName()` method removes tools from the registry and notifies clients:\n\n```typescript\nremoveToolsByName(toolNames: string[]): void\n```\n\nThis operation:\n- Deletes tools from the internal `Map`\n- Calls `sendToolListChanged()` to update clients\n- Validates that tools exist before removal\n\n## Central Dispatcher Pattern\n\nThe current implementation uses a central dispatcher in `setupToolHandlers()` to route tool execution based on `tool.type`. Source: [src/mcp/server.ts]()\n\n```mermaid\ngraph LR\n    A[Request] --> B{tool.type}\n    B -->|internal| C[Execute callback]\n    B -->|actor| D[Create Actor client]\n    B -->|actor-mcp| E[Connect to MCP proxy]\n    \n    C --> F[Return result]\n    D --> G[Run Actor]\n    G --> F\n    E --> H[Forward request]\n    H --> F\n```\n\n## Tool Input Validation\n\nTool arguments are validated using JSON Schema with AJV before execution:\n\n```typescript\nconst validate = compileSchema(inputSchema);\nconst valid = validate(toolArgs);\n```\n\nThe `compileSchema` utility from `src/utils/ajv.js` provides schema compilation with custom error messages. Source: [src/tools/common/search_apify_docs.ts:12]()\n\n## Actor-MCP Proxy Integration\n\nThe proxy subsystem in `src/mcp/proxy.ts` enables tools from external MCP servers to be exposed through the Apify MCP interface. Source: [src/mcp/proxy.ts]()\n\nWhen an `ActorMcpTool` is called:\n1. The server connects to the origin MCP server\n2. The request is forwarded with original arguments\n3. Responses are transformed and returned to the client\n4. Progress notifications are propagated\n\n## Default Tools Configuration\n\nThe server loads default tools when no specific configuration is provided:\n\n| Tool | Category | Description |\n|------|----------|-------------|\n| `actors` | Category | Actor discovery and invocation tools |\n| `docs` | Category | Apify and Crawlee documentation search |\n| `apify/rag-web-browser` | Specific | RAG-enabled web browser for data extraction |\n\nSource: [README.md]()\n\n### Unauthenticated Access\n\nCertain tools are explicitly enabled for unauthenticated access:\n- `search-actors`\n- `fetch-actor-details`\n- `search-apify-docs`\n- `fetch-apify-docs`\n\nAccess is granted when the `tools` query parameter includes only these tools. Source: [README.md]()\n\n## Tool Registration Factory (Target Architecture)\n\nAn upcoming refactor will replace the central dispatcher with callback-per-tool registration patterns:\n\n```typescript\n// Internal tools\nregisterInternalTool(tool: InternalToolDefinition): RegisteredTool\n\n// Actor tools  \nregisterActorTool(actorDef: ActorDefinition): RegisteredTool\n\n// Actor-MCP proxy tools\nregisterActorMcpTool(mcpTool: ExternalTool, serverUrl: string, actorId: string): RegisteredTool\n```\n\nEach tool will be self-contained with its own callback, eliminating the need for type-checking in the dispatcher. Source: [res/mcp_server_refactor_analysis.md]()\n\n## CLI Configuration\n\nTools can be configured via command-line flags:\n\n```bash\n# Load default tools\nnpx @apify/actors-mcp-server --tools actors,docs,apify/rag-web-browser\n\n# Minimal single-Actor configuration\nnpx @apify/actors-mcp-server --tools apify/my-actor\n```\n\nSource: [README.md]()\n\n## Testing Strategy\n\nThe tool system is tested at multiple levels:\n\n| Test Level | Coverage |\n|------------|----------|\n| Unit tests | Individual tool execution, schema validation, registration patterns |\n| Integration tests | Full tool lifecycle, dynamic loading/removal, notifications |\n| Manual testing | MCP client verification, protocol compliance |\n\nSource: [DEVELOPMENT.md]()\n\n### Key Integration Tests\n\nIntegration tests in `tests/integration/suite.ts` verify:\n- `tools/list` returns correct tools with proper metadata\n- `tools/call` executes each tool type correctly\n- `tools/call` returns proper validation errors\n- `notifications/tools/list_changed` are sent on changes\n- `notifications/progress` work for long-running operations\n\nSource: [res/integration_test_coverage_audit.md]()\n\n## Future Refactoring\n\nThe Tool System is scheduled for migration from the low-level `Server` API to the high-level `McpServer` API:\n\n| Change | Impact |\n|--------|--------|\n| Replace `Server` with `McpServer` | Automatic tool management |\n| Remove central dispatcher | ~300 lines removed |\n| Convert JSON Schema to Zod | Native schema conversion via Zod v4 |\n| Callback-per-tool pattern | Self-contained execution logic |\n\nThis refactor will reduce complexity while preserving all existing functionality. Source: [res/mcp_server_refactor_analysis.md]()\n\n---\n\n<a id='actor-tools'></a>\n\n## Actor Tools\n\n### Related Pages\n\nRelated topics: [Tool System](#tool-system), [Storage Access Tools](#storage-tools)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/tools/actor_executor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/actor_executor.ts)\n- [src/tools/core/actor_tools_factory.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/actor_tools_factory.ts)\n- [src/tools/core/call_actor_common.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/call_actor_common.ts)\n- [src/tools/apps/call_actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/apps/call_actor.ts)\n- [src/tools/default/call_actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/default/call_actor.ts)\n- [src/utils/actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/actor.ts)\n</details>\n\n# Actor Tools\n\nActor Tools are the primary mechanism by which the Apify MCP Server enables AI assistants and MCP clients to execute Apify Actors. These tools bridge the gap between the Model Context Protocol (MCP) and Apify's Actor platform, allowing LLMs to programmatically invoke cloud programs, monitor their execution, and retrieve results.\n\n## Overview\n\nActor Tools serve as wrappers around Apify Actors, exposing them as callable MCP tools with proper input schema validation, result formatting, and execution tracking. The system supports three distinct tool types within the MCP server architecture:\n\n| Tool Type | Description | Type Discriminator |\n|-----------|-------------|-------------------|\n| **Internal Tools** | Built-in helper tools (e.g., `search-actors`, `fetch-actor-details`) | `'internal'` |\n| **Actor Tools** | Wrappers around Apify Actors | `'actor'` |\n| **Actor-MCP Tools** | Proxies to external MCP servers hosted as Actors | `'actor-mcp'` |\n\nSource: [src/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/types.ts)\n\n## Architecture\n\n### Tool Classification Hierarchy\n\n```mermaid\ngraph TD\n    A[Tools in MCP Server] --> B[Internal Tools]\n    A --> C[Actor Tools]\n    A --> D[Actor-MCP Tools]\n    \n    C --> C1[call-actor]\n    C --> C2[call-actor-widget]\n    C --> C3[Dynamic Actor Tools]\n    \n    D --> D1[Proxy MCP Tools]\n```\n\n### Actor Tool Execution Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Server as ActorsMcpServer\n    participant Factory as ActorToolsFactory\n    participant Executor as ActorExecutor\n    participant Apify as Apify Platform\n    \n    Client->>Server: Tool call request\n    Server->>Factory: Create/retrieve Actor tool\n    Factory->>Executor: Execute with input\n    Executor->>Apify: Start Actor run\n    Apify-->>Executor: Run metadata\n    Executor->>Apify: Wait for completion\n    Apify-->>Executor: Run results\n    Executor-->>Server: Formatted response\n    Server-->>Client: MCP response\n```\n\nSource: [src/tools/actor_executor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/actor_executor.ts)\n\n## Core Components\n\n### ActorExecutor\n\nThe `ActorExecutor` class is responsible for the actual execution of Apify Actors. It handles:\n\n- Actor invocation with input validation\n- Run lifecycle management (start, wait, abort)\n- Result retrieval from datasets or key-value stores\n- Error handling and response formatting\n\n**Key responsibilities:**\n\n| Responsibility | Description |\n|---------------|-------------|\n| `callActor()` | Initiates an Actor run with provided input |\n| `getActorOutput()` | Retrieves output from completed runs |\n| `abortActorRun()` | Terminates a running Actor |\n| Result formatting | Converts raw results to MCP-compatible responses |\n\nSource: [src/tools/actor_executor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/actor_executor.ts)\n\n### ActorToolsFactory\n\nThe `ActorToolsFactory` creates Actor tool definitions based on Actor metadata. It transforms Actor input schemas into MCP-compatible tool definitions with proper validation.\n\n**Factory outputs include:**\n\n| Output | Purpose |\n|--------|---------|\n| `name` | Tool identifier (e.g., `apify/web-scraper`) |\n| `description` | Human-readable tool description |\n| `inputSchema` | JSON Schema for tool arguments |\n| `ajvValidate` | Compiled AJV validator function |\n| `annotations` | MCP tool hints (readOnlyHint, openWorldHint, etc.) |\n\nSource: [src/tools/core/actor_tools_factory.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/actor_tools_factory.ts)\n\n### Call Actor Common Module\n\nThe `call_actor_common.ts` module provides shared execution logic used by all call-actor variants. It implements the pre-execution phase:\n\n```mermaid\ngraph LR\n    A[Input Validation] --> B[Actor Resolution]\n    B --> C[MCP Tool Name Parsing]\n    C --> D[Tool Call Execution]\n    D --> E[Response Formatting]\n```\n\n**Pre-execution steps:**\n\n1. **Input parsing**: Validates and extracts actor name, input, and call options\n2. **Actor resolution**: Resolves actor name to stable ID via Apify API\n3. **MCP tool routing**: Handles routing for Actor-MCP servers\n4. **Payment validation**: Checks if Actor requires payment before execution\n\nSource: [src/tools/core/call_actor_common.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/call_actor_common.ts)\n\n## Call Actor Implementations\n\nThe MCP server provides multiple implementations of the call-actor functionality, optimized for different client environments.\n\n### Default Call Actor\n\nThe default implementation (`src/tools/default/call_actor.ts`) provides standard execution with result previews. It is used by most MCP clients.\n\n**Characteristics:**\n\n| Property | Value |\n|----------|-------|\n| Mode | Default server mode |\n| Output | Limited preview (first 5 items) |\n| Widget support | None |\n| Use case | General-purpose Actor invocation |\n\n### Call Actor Widget (Apps Mode)\n\nThe widget variant (`src/tools/apps/call_actor.ts`) renders interactive MCP App widgets in the response, providing enhanced UX for clients that support it.\n\n**Characteristics:**\n\n| Property | Value |\n|----------|-------|\n| Mode | Apps server mode (`ui=true`) |\n| Output | Full results with widget rendering |\n| Widget support | Actor Run widgets, progress tracking |\n| Use case | MCP Apps-enabled clients |\n\n**Widget annotations applied:**\n\n```typescript\n{\n    title: 'Call Actor (widget)',\n    readOnlyHint: false,\n    destructiveHint: true,\n    idempotentHint: false,\n    openWorldHint: true,\n}\n```\n\nSource: [src/tools/apps/call_actor_widget.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/apps/call_actor_widget.ts)\n\n### Execution Modes Comparison\n\n| Feature | Default | Widget (Apps) |\n|---------|---------|---------------|\n| Server mode | `default` | `apps` |\n| Output preview | Limited | Full |\n| Progress notifications | Via logs | Via widget |\n| Run status tracking | Manual | Automatic |\n| UI rendering | Text only | Interactive widgets |\n\n## Actor Resolution\n\nThe resolution process maps human-readable actor names to stable actor IDs.\n\n```mermaid\ngraph TD\n    A[Input: Actor Name] --> B{User has rented Actor?}\n    B -->|Yes| C[Check rentedActorsIds]\n    B -->|No| D[Search Apify Store]\n    C --> E[Return rented Actor ID]\n    D --> F[Match by name/version]\n    F --> G[Return store Actor ID]\n    E --> H[Resolved Actor]\n    G --> H\n```\n\nSource: [src/utils/actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/actor.ts)\n\n### Resolution Strategy\n\n1. **User rented Actors**: Check if the actor name matches any Actor rented by the user\n2. **Apify Store**: Search public Actors for matching name\n3. **Version matching**: Support both explicit (`actorName@version`) and implicit versioning\n\n## Tool Annotations\n\nActor tools include MCP-compliant annotations to help clients and LLMs understand tool behavior:\n\n| Annotation | Description | Applied Value |\n|------------|-------------|---------------|\n| `title` | Short display name | Actor name (e.g., \"Call Actor\") |\n| `readOnlyHint` | Indicates read-only operation | `false` for call-actor |\n| `openWorldHint` | Indicates external network access | `true` (executes Actors) |\n| `destructiveHint` | Indicates destructive operation | `true` for call-actor |\n| `idempotentHint` | Indicates idempotent operation | `false` for call-actor |\n\nSource: [src/tools/apps/call_actor_widget.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/apps/call_actor_widget.ts)\n\n## Input Schema Handling\n\nActor tools dynamically generate input schemas from Actor definitions:\n\n```mermaid\ngraph TD\n    A[Actor Input Schema] --> B[Pruned Definition]\n    B --> C[JSON Schema]\n    C --> D[AJV Validator]\n    D --> E[MCP Tool Schema]\n```\n\n### Schema Pruning\n\nThe schema is pruned to include only fields the LLM needs to provide:\n\n| Field Type | Included | Reason |\n|------------|----------|--------|\n| Required fields | Yes | Necessary for execution |\n| Optional fields with defaults | No | Server applies defaults |\n| Hidden fields | No | Internal use only |\n\nSource: [src/utils/actor.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/actor.ts)\n\n## Error Handling\n\nActor tools implement robust error handling for various failure scenarios:\n\n| Error Type | Handling | Response |\n|------------|----------|----------|\n| Invalid input schema | AJV validation failure | Formatted error message |\n| Actor not found | Resolution returns error | Early response with error |\n| Payment required | Payment validation fails | Error with payment instructions |\n| Run timeout | Wait exceeds timeout | Partial results with warning |\n| Actor execution error | Run fails | Error details in response |\n\nSource: [src/tools/core/call_actor_common.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/core/call_actor_common.ts)\n\n## Dynamic Tool Loading\n\nThe system supports dynamic loading of Actors as tools:\n\n```mermaid\ngraph TD\n    A[Tool Configuration] --> B[Load Actors]\n    B --> C[Fetch Actor Definitions]\n    C --> D[Register Tools]\n    D --> E[Notify Tools Changed]\n    E --> F[MCP Client Updated]\n```\n\n**Loading methods:**\n\n| Method | Description |\n|--------|-------------|\n| `loadActorsAsTools()` | Load by actor IDs |\n| `loadToolsByName()` | Load by tool names |\n| `loadToolsFromUrl()` | Load from MCP server URL |\n\nSource: [src/mcp/server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/mcp/server.ts)\n\n## Configuration\n\nActor tools respect the server's tools configuration parameter:\n\n```\n?tools=actors,docs,apify/rag-web-browser\n```\n\nWhen the `actors` category is included, all Actor-related tools become available, including the base `call-actor` tool and any dynamically loaded Actor tools.\n\n## See Also\n\n- [Internal Tools](./internal-tools.md) - Built-in helper tools\n- [Actor-MCP Proxy](./actor-mcp-proxy.md) - External MCP server integration\n- [Tool Annotations](./tool-annotations.md) - MCP tool metadata\n- [Server Modes](./server-modes.md) - Default vs Apps modes\n\n---\n\n<a id='storage-tools'></a>\n\n## Storage Access Tools\n\n### Related Pages\n\nRelated topics: [Actor Tools](#actor-tools)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/tools/common/get_dataset.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_dataset.ts)\n- [src/tools/common/get_dataset_items.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_dataset_items.ts)\n- [src/tools/common/get_dataset_schema.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_dataset_schema.ts)\n- [src/tools/common/get_key_value_store.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_key_value_store.ts)\n- [src/tools/common/get_key_value_store_record.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_key_value_store_record.ts)\n- [src/tools/common/get_actor_run_log.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/get_actor_run_log.ts)\n- [src/tools/common/run_collection.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/common/run_collection.ts)\n</details>\n\n# Storage Access Tools\n\nStorage Access Tools provide MCP (Model Context Protocol) clients with programmatic access to Apify's cloud storage infrastructure. These tools enable AI assistants and automated workflows to read datasets, key-value stores, and Actor run logs without requiring direct API integration.\n\n## Overview\n\nThe Apify MCP Server exposes storage resources through a collection of specialized tools that wrap the Apify API's storage endpoints. These tools follow the repository's established patterns:\n\n- Input validation via Zod schemas\n- Consistent response formatting via `buildMCPResponse()`\n- Payment-required guards for premium operations\n- Comprehensive error handling with user-friendly messages\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n## Architecture\n\n### Tool Classification\n\nStorage Access Tools fall into three categories based on the underlying Apify storage type:\n\n```mermaid\ngraph TD\n    A[Storage Access Tools] --> B[Dataset Tools]\n    A --> C[Key-Value Store Tools]\n    A --> D[Run Log Tools]\n    \n    B --> B1[get-dataset]\n    B --> B2[get-dataset-items]\n    B --> B3[get-dataset-schema]\n    \n    C --> C1[get-key-value-store]\n    C --> C2[get-key-value-store-record]\n    \n    D --> D1[get-actor-run-log]\n    D --> D2[run-collection]\n```\n\n### Data Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Server as ActorsMcpServer\n    participant Tool as Storage Tool\n    participant Apify as Apify API\n    \n    Client->>Server: Tool Request\n    Server->>Tool: call(toolArgs)\n    Tool->>Tool: Validate input with Zod\n    Tool->>Apify: API Request\n    Apify-->>Tool: Raw Storage Data\n    Tool->>Tool: Transform & Format\n    Tool-->>Server: MCP Response\n    Server-->>Client: Formatted Result\n```\n\n### Tool Entry Structure\n\nEach storage tool implements the `ToolEntry` interface with `type: 'internal'`:\n\n```typescript\nexport const exampleTool: ToolEntry = Object.freeze({\n    type: 'internal',\n    name: HelperTools.DATASET_GET_ITEMS,\n    description: 'Tool description...',\n    inputSchema: z.toJSONSchema(inputSchema),\n    outputSchema: datasetItemsOutputSchema,\n    ajvValidate: compileSchema(z.toJSONSchema(inputSchema)),\n    annotations: { /* tool annotations */ },\n    call: async (toolArgs: InternalToolArgs) => { /* implementation */ },\n});\n```\n\nSource: [src/tools/common/get_dataset_items.ts:39-62]()\n\n---\n\n## Dataset Tools\n\nDataset tools provide access to Apify's structured data storage. Datasets store results from Actor runs as JSON objects, supporting pagination, field selection, and schema inference.\n\n### Get Dataset\n\nRetrieves metadata about a specific dataset including item count, field statistics, and storage usage.\n\n**Tool Name:** `get-dataset`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `datasetId` | string | Yes | Dataset ID or name |\n\n**Response Format:**\n```json\n{\n  \"content\": [{\n    \"type\": \"text\",\n    \"text\": \"```json\\n{...dataset metadata...}\\n```\"\n  }]\n}\n```\n\n**Implementation Details:**\n\nThe tool first validates the `datasetId` parameter, then calls the Apify dataset API to fetch metadata. If the dataset is empty, it returns a friendly message rather than an error.\n\n```typescript\nif (datasetItems.length === 0) {\n    return { content: [{ type: 'text', text: `Dataset '${parsed.datasetId}' is empty.` }] };\n}\n```\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n### Get Dataset Items\n\nRetrieves actual data items from a dataset with support for pagination and field selection.\n\n**Tool Name:** `get-dataset-items`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `datasetId` | string | Yes | Dataset ID or name |\n| `offset` | integer | No | Number of items to skip (default: 0) |\n| `limit` | integer | No | Maximum items to return (default: 20, max: 10000) |\n| `fields` | string[] | No | Specific fields to return (supports dot notation) |\n| `clean` | boolean | No | Return clean data without metadata (default: true) |\n\n**Key Features:**\n\n- **Dot notation support**: Fields like `crawl.statusCode` extract nested values\n- **Auto-flattening**: Dot-notation fields are automatically flattened in output\n- **Metadata stripping**: Clean mode removes `_id`, `_createdAt`, `_index` fields\n\n**Output Schema:**\n\nThe tool returns dataset items with the following structure:\n\n```typescript\nconst datasetItemsOutputSchema = {\n    type: 'array' as const,\n    items: { type: 'object' as const }\n};\n```\n\nSource: [src/tools/common/get_dataset_items.ts:1-50]()\n\n### Get Dataset Schema\n\nInfers a JSON Schema from dataset items, useful for understanding data structure and enabling type-safe integrations.\n\n**Tool Name:** `get-dataset-schema`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `datasetId` | string | Yes | Dataset ID or name |\n| `limit` | integer | No | Max items to analyze (default: 100) |\n| `clean` | boolean | No | Exclude metadata fields (default: true) |\n\n**Implementation Details:**\n\nThe schema generation uses a shared utility that samples dataset items to infer field types:\n\n```typescript\nconst schema = generateSchemaFromItems(datasetItems, {\n    limit: parsed.limit,\n    clean: parsed.clean,\n});\n\nif (!schema) {\n    return buildMCPResponse({\n        texts: [`Failed to generate schema for dataset '${parsed.datasetId}'.`],\n        isError: true,\n        telemetry: { toolStatus: TOOL_STATUS.FAILED },\n    });\n}\n```\n\n**Output:** Returns a JSON Schema document describing all discovered fields and their types.\n\nSource: [src/tools/common/get_dataset_schema.ts:1-50]()\n\n---\n\n## Key-Value Store Tools\n\nKey-Value Store tools provide access to Apify's NoSQL storage for arbitrary data items, commonly used for Actor input/output, screenshots, and state persistence.\n\n### Get Key-Value Store\n\nRetrieves metadata and record listings from a key-value store.\n\n**Tool Name:** `get-key-value-store`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `storeId` | string | Yes | Key-value store ID or name |\n\n**Metadata Returned:**\n- Store name and ID\n- Created timestamp\n- Modified timestamp\n- Item count\n- Available record keys\n\n**Use Cases:**\n\n- Listing available records before fetching specific items\n- Checking if a store exists\n- Auditing store contents\n\nSource: [src/tools/common/get_key_value_store.ts:1-1]()\n\n### Get Key-Value Store Record\n\nRetrieves a specific record from a key-value store by its key.\n\n**Tool Name:** `get-key-value-store-record`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `storeId` | string | Yes | Key-value store ID or name |\n| `key` | string | Yes | Record key to retrieve |\n| `filename` | string | No | If record is a file, specify the filename for proper MIME type handling |\n\n**Response Handling:**\n\nThe tool handles different MIME types appropriately:\n- **JSON**: Parsed and pretty-printed\n- **Images**: Base64 encoded with data URI\n- **Other**: Raw content or appropriate representation\n\nSource: [src/tools/common/get_key_value_store_record.ts:1-1]()\n\n---\n\n## Run Log Tools\n\nRun Log tools provide access to Actor execution logs and run collection management.\n\n### Get Actor Run Log\n\nRetrieves the console output and log entries from a specific Actor run.\n\n**Tool Name:** `get-actor-run-log`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `runId` | string | Yes | Actor run ID |\n\n**Output Format:**\n\nReturns log content with timestamps and log levels preserved:\n\n```json\n{\n  \"content\": [{\n    \"type\": \"text\",\n    \"text\": \"[2024-01-15T10:30:00.000Z] INFO: Starting crawl...\\n[2024-01-15T10:30:01.000Z] DEBUG: Found 50 items\"\n  }]\n}\n```\n\n**Implementation Details:**\n\nThe tool fetches log data from the Apify Run Logs API and formats it for readability. Large logs are truncated with a warning message.\n\nSource: [src/tools/common/get_actor_run_log.ts:1-1]()\n\n### Run Collection\n\nManages collections of Actor runs, enabling listing and filtering of historical executions.\n\n**Tool Name:** `run-collection`\n\n**Input Schema:**\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `action` | string | Yes | Action to perform: `list`, `get`, or `stats` |\n| `datasetId` | string | No | Filter by associated dataset |\n| `status` | string | No | Filter by run status |\n| `limit` | integer | No | Maximum results (default: 20) |\n\n**Supported Actions:**\n\n| Action | Description |\n|--------|-------------|\n| `list` | List runs matching filters |\n| `get` | Get details of a specific run |\n| `stats` | Get aggregate statistics |\n\n**Status Filter Values:**\n- `READY` - Run completed successfully\n- `RUNNING` - Run currently executing\n- `FAILED` - Run terminated with errors\n- `ABORTED` - Run manually cancelled\n\nSource: [src/tools/common/run_collection.ts:1-1]()\n\n---\n\n## Common Patterns\n\n### Input Validation\n\nAll storage tools use Zod for input validation, ensuring type safety and user-friendly error messages:\n\n```typescript\nconst getDatasetArgs = z.object({\n    datasetId: z.string().min(1, 'Dataset ID is required'),\n});\n\nconst parsed = getDatasetArgs.parse(args);\n```\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n### Response Building\n\nTools use `buildMCPResponse()` for consistent output formatting:\n\n```typescript\nreturn buildMCPResponse({\n    texts: [`Dataset '${parsed.datasetId}' has ${itemCount} items.`],\n    telemetry: { toolStatus: TOOL_STATUS.SUCCESS },\n});\n```\n\n### Error Handling\n\nErrors are caught and transformed into user-friendly messages:\n\n```typescript\ntry {\n    // API call\n} catch (error) {\n    log.softFail(`[get-dataset] Failed: ${error.message}`);\n    return buildMCPResponse({\n        texts: [`Error: ${error.message}`],\n        isError: true,\n        telemetry: { toolStatus: TOOL_STATUS.FAILED },\n    });\n}\n```\n\n---\n\n## Tool Annotations\n\nStorage tools include standardized annotations for MCP client UI rendering:\n\n```typescript\nannotations: {\n    title: 'Get Dataset Items',\n    readOnlyHint: true,      // Read-only operation\n    destructiveHint: false,  // Does not delete data\n    idempotentHint: true,    // Safe to retry\n    openWorldHint: false,    // Apify internal data\n},\n```\n\n| Annotation | Purpose |\n|------------|---------|\n| `title` | Display name in MCP client UI |\n| `readOnlyHint` | Indicates read-only operations |\n| `destructiveHint` | Warns about destructive operations |\n| `idempotentHint` | Confirms safe retry behavior |\n| `openWorldHint` | Indicates external data access |\n\nSource: [src/tools/common/get_dataset_items.ts:55-60]()\n\n---\n\n## Integration with Apify Client\n\nStorage tools use the shared Apify client utility rather than calling the API directly:\n\n```typescript\nimport { getApifyDatasetClient } from '../../utils/apify_client.js';\n\nconst datasetClient = getApifyDatasetClient();\nconst dataset = await datasetClient.getDataset({ datasetId: parsed.datasetId });\n```\n\nThis ensures:\n- Consistent authentication handling\n- Proper error transformation\n- Caching where applicable\n- Telemetry integration\n\nSource: [src/tools/common/get_dataset.ts:1-1]()\n\n---\n\n## Configuration\n\nStorage tools respect the server's tool loading configuration. By default, storage tools are loaded unless explicitly excluded:\n\n```bash\n# CLI configuration\nnpx @apify/actors-mcp-server --tools actors,docs,storage\n\n# Or explicitly exclude\nnpx @apify/actors-mcp-server --tools actors,docs\n```\n\nSource: [README.md:1-1]()\n\n---\n\n## Summary\n\nStorage Access Tools provide comprehensive access to Apify's cloud storage infrastructure through the MCP protocol. Key characteristics:\n\n| Aspect | Implementation |\n|--------|----------------|\n| **Dataset Access** | 3 tools for metadata, items, and schema |\n| **Key-Value Store** | 2 tools for store and record access |\n| **Run Logs** | 2 tools for log retrieval and run management |\n| **Validation** | Zod schemas with AJV compilation |\n| **Response Format** | Standard MCP content blocks |\n| **Error Handling** | User-friendly messages with telemetry |\n| **Configuration** | Respects global tool loading settings |\n\nThese tools enable AI assistants to interact with Apify storage data without requiring direct API integration, making it simple to build workflows that consume Actor output or manage storage resources.\n\n---\n\n<a id='payments-overview'></a>\n\n## Agentic Payments System\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/payments/types.ts](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n- [src/payments/x402.ts](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n- [src/utils/payment_errors.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n- [src/payments/helpers.ts](https://github.com/apify/apify-mcp-server/blob/main/src/payments/helpers.ts)\n</details>\n\n# Agentic Payments System\n\nThe Agentic Payments System is a payment abstraction layer within the Apify MCP Server that enables AI agents and MCP clients to pay for Actor executions using alternative payment methods beyond traditional API tokens. The system supports multiple payment schemes including **x402** (blockchain-based payments via HTTP 402) and **Skyfire** (agentic payment tokens), allowing autonomous agents to pay for compute without requiring pre-configured API credentials.\n\n## Architecture Overview\n\nThe payment system follows a provider-based architecture where a unified `PaymentProvider` interface abstracts the specifics of each payment scheme. This design allows the MCP server to remain agnostic to payment implementation details while providing a consistent interface for payment validation, credential extraction, and header forwarding.\n\n```mermaid\ngraph TD\n    subgraph \"MCP Client\"\n        A[Tool Call with Payment]\n    end\n    \n    subgraph \"Apify MCP Server\"\n        B[Payment Provider Resolution]\n        C[validatePayment]\n        D[removePaymentFields]\n        E[getPaymentHeaders]\n        F[decorateToolSchema]\n    end\n    \n    subgraph \"Payment Providers\"\n        G[x402 Provider]\n        H[Skyfire Provider]\n    end\n    \n    subgraph \"Apify API\"\n        I[Actor Execution]\n        J[Payment Verification]\n    end\n    \n    A --> B\n    B --> G\n    B --> H\n    C --> D\n    D --> E\n    E --> I\n    F -.->|Decorates| A\n    I --> J\n```\n\nSource: [src/payments/types.ts:45-87](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n## Core Types and Interfaces\n\n### PaymentProviderId\n\nThe system defines two supported payment provider identifiers:\n\n```typescript\nexport type PaymentProviderId = 'skyfire' | 'x402';\n```\n\n| Provider | Description |\n|----------|-------------|\n| `skyfire` | Skyfire agentic payments using PAY tokens in tool arguments |\n| `x402` | x402 protocol using HTTP 402 with PAYMENT-SIGNATURE header |\n\nSource: [src/payments/types.ts:14-19](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n### PaymentProvider Interface\n\nEvery payment provider must implement the `PaymentProvider` interface:\n\n| Method | Return Type | Purpose |\n|--------|-------------|---------|\n| `id` | `PaymentProviderId` (readonly) | Provider identifier |\n| `decorateToolSchema(tool)` | `ToolEntry` | Add payment fields to tool definitions |\n| `validatePayment(args, meta, headers)` | `string \\| null` | Validate credentials before execution |\n| `getPaymentHeaders(args, meta, headers)` | `PaymentHeaders` | Extract headers for Apify API |\n| `removePaymentFields(args)` | `Record<string, unknown>` | Clean args before Actor input |\n| `allowsUnauthenticated` | `boolean` | Whether token-less access is permitted |\n| `getPaymentRequiredData?()` | `unknown` | Optional x402 structured payment data |\n| `getUsageGuide?()` | `string \\| null` | Optional payment usage documentation |\n\nSource: [src/payments/types.ts:45-87](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n### Supporting Types\n\n```typescript\n// Headers forwarded to Apify API requests\nexport type PaymentHeaders = Record<string, string>;\n\n// MCP request _meta field for payment schemes like x402\nexport type PaymentMeta = Record<string, unknown> | undefined;\n\n// HTTP headers from MCP transport layer\nexport type RequestHeaders = Record<string, string | string[] | undefined> | undefined;\n```\n\nSource: [src/payments/types.ts:22-35](https://github.com/apify/apify-mcp-server/blob/main/src/payments/types.ts)\n\n## Payment-Aware Tool Call Context\n\nThe `PrepareToolCallContextResult` type centralizes payment processing for tool calls:\n\n```typescript\nexport type PrepareToolCallContextResult = {\n    paymentRequiredResult?: ReturnType<typeof buildPaymentRequiredResponse>;\n    toolArgsWithoutPayment: Record<string, unknown>;\n    toolArgsRedacted: unknown;\n    apifyClient: ApifyClient;\n};\n```\n\n| Field | Type | Purpose |\n|-------|------|---------|\n| `paymentRequiredResult` | `MCPResponse \\| undefined` | Structured 402 error response if payment fails |\n| `toolArgsWithoutPayment` | `Record<string, unknown>` | Args stripped of payment fields for AJV validation |\n| `toolArgsRedacted` | `unknown` | Args with sensitive fields masked for logging |\n| `apifyClient` | `ApifyClient` | Client configured with payment headers or standard token |\n\nSource: [src/payments/helpers.ts:7-16](https://github.com/apify/apify-mcp-server/blob/main/src/payments/helpers.ts)\n\n## x402 Payment Provider\n\nThe x402 provider enables blockchain-based payments using EIP-3009 TransferWithAuthorization on Base network.\n\n### Payment Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant MCP_Server\n    participant Apify_API\n    \n    Client->>Client: Sign EIP-3009 TransferWithAuthorization\n    Client->>MCP_Server: Tool call with _meta[\"x402/payment\"]\n    MCP_Server->>MCP_Server: validatePayment()\n    MCP_Server->>MCP_Server: getPaymentHeaders()\n    MCP_Server->>Apify_API: Forward PAYMENT-SIGNATURE header\n    Apify_API->>Apify_API: Verify signature & settle payment\n    Apify_API-->>MCP_Server: Actor execution result\n    MCP_Server-->>Client: Response\n```\n\n### x402 Payment Types\n\n```typescript\nexport type X402PaymentAccept = {\n    scheme?: string;\n    network?: string;\n    amount?: string;\n    asset?: string;\n    payTo?: string;\n    maxTimeoutSeconds?: number;\n    extra?: Record<string, unknown>;\n};\n\nexport type X402PaymentRequirements = {\n    x402Version?: number;\n    resource?: Record<string, unknown>;\n    accepts?: X402PaymentAccept[];\n};\n```\n\nSource: [src/payments/x402.ts:18-28](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n### Payment Data Extraction\n\nThe x402 provider reads payment data from two sources in priority order:\n\n1. **MCP `_meta` field** (preferred): `meta[\"x402/payment\"]` contains the decoded JSON payment object\n2. **HTTP `PAYMENT-SIGNATURE` header** (fallback): Base64-encoded payment data from HTTP transport\n\n```typescript\nfunction getEncodedPaymentSignature(\n    meta?: PaymentMeta, \n    requestHeaders?: RequestHeaders\n): string | undefined {\n    const metaPayment = meta?.[X402_META_KEY];\n    if (metaPayment) {\n        return Buffer.from(JSON.stringify(metaPayment)).toString('base64');\n    }\n    return getPaymentSignatureFromHeader(requestHeaders);\n}\n```\n\nSource: [src/payments/x402.ts:75-86](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n### Caching Mechanism\n\nThe x402 provider caches payment requirements at module level to prevent thundering herd during server startup:\n\n| Parameter | Value |\n|-----------|-------|\n| Cache TTL | 30 minutes |\n| Cached Item | `Promise<X402PaymentRequirements \\| undefined>` |\n\n```typescript\nlet cachedRequirementsPromise: Promise<X402PaymentRequirements | undefined> | null = null;\nlet lastFetchTime = 0;\nconst CACHE_TTL_MS = 30 * 60 * 1000;\n```\n\nSource: [src/payments/x402.ts:35-41](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n### x402 Provider Constants\n\n| Constant | Value | Purpose |\n|----------|-------|---------|\n| `X402_META_KEY` | `x402/payment` | Key for MCP `_meta` field |\n| `PAYMENT_SIGNATURE_HEADER` | `PAYMENT-SIGNATURE` | HTTP header for Apify API |\n| `PAYMENT_PROTOCOL_HEADER` | `x-apify-payment-protocol` | Protocol identification |\n| `PAYMENT_REQUIRED_HEADER` | `payment-required` | Response header for 402 |\n| `FETCH_TIMEOUT_MS` | `8000` | Timeout for payment requirements fetch |\n\nSource: [src/payments/x402.ts:52-63](https://github.com/apify/apify-mcp-server/blob/main/src/payments/x402.ts)\n\n## Payment Error Handling\n\n### 402 Response Building\n\nThe `buildPaymentRequiredResponse` function constructs MCP responses for payment failures following the x402 MCP transport spec:\n\n```typescript\nexport function buildPaymentRequiredResponse(\n    errorOrMessage: unknown, \n    precomputedPaymentData?: unknown\n) {\n    const paymentData = precomputedPaymentData ?? extractPaymentRequiredData(errorOrMessage);\n    const message = errorOrMessage instanceof Error ? errorOrMessage.message : String(errorOrMessage);\n\n    const texts = paymentData\n        ? [\n            JSON.stringify(paymentData),\n            'Payment required to run this Actor or access this resource.',\n        ]\n        : [message];\n\n    return buildMCPResponse({ texts, isError: true, structuredContent: paymentData });\n}\n```\n\nSource: [src/utils/payment_errors.ts:44-60](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n\n### Payment Data Extraction\n\nPayment-required data is extracted from two sources in priority order:\n\n| Priority | Source | Access Method |\n|----------|--------|---------------|\n| 1 | Captured HTTP header | Axios interceptor stores `payment-required` response header |\n| 2 | API response body | `ApifyApiError.data` field |\n\n```typescript\nfunction extractPaymentRequiredData(error: unknown): Record<string, unknown> | undefined {\n    // Source 1: Captured payment-required header\n    const captured = (error as ErrorWithPaymentData)[PAYMENT_REQUIRED_DATA];\n    if (captured && typeof captured === 'object') return captured;\n\n    // Source 2: ApifyApiError.data (API response body)\n    if (error instanceof ApifyApiError) {\n        const { data } = error;\n        if (typeof data === 'object' && data !== null) return data as Record<string, unknown>;\n    }\n\n    return undefined;\n}\n```\n\nSource: [src/utils/payment_errors.ts:66-87](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n\n### Axios Interceptor\n\nAn axios interceptor captures the `payment-required` response header from Apify API responses:\n\n```typescript\napifyClient.addInterceptorResponseError(async (error) => {\n    const response = (error as AxiosError<{ response?: { headers?: Record<string, string> } }>)\n        ?.response;\n    const paymentData = response?.status === HTTP_PAYMENT_REQUIRED\n        ? decodePaymentRequiredHeader(response.headers?.[PAYMENT_REQUIRED_HEADER])\n        : undefined;\n\n    if (paymentData) {\n        Object.defineProperty(error as object, PAYMENT_REQUIRED_DATA, { \n            value: paymentData, \n            enumerable: false \n        });\n    }\n\n    return Promise.reject(error);\n});\n```\n\nSource: [src/utils/payment_errors.ts:18-31](https://github.com/apify/apify-mcp-server/blob/main/src/utils/payment_errors.ts)\n\n## Tool Call Processing Workflow\n\n```mermaid\ngraph TD\n    A[Tool Call Received] --> B{Pre-process payment}\n    B --> C[validatePayment]\n    C -->|Valid| D[removePaymentFields]\n    C -->|Invalid| E[Return 402 Response]\n    D --> F[Redact sensitive fields]\n    F --> G[Create ApifyClient with payment headers]\n    G --> H[AJV validation on clean args]\n    H -->|Valid| I[Execute Actor]\n    H -->|Invalid| J[Return validation error]\n    I --> K[Return result]\n    \n    style E fill:#ff6b6b\n    style K fill:#51cf66\n```\n\n## Usage Guide Integration\n\nPayment providers can optionally expose usage guides as MCP resources:\n\n```typescript\nconst listResources = async (): Promise<ListResourcesResult> => {\n    const resources: Resource[] = [];\n\n    if (paymentProvider?.getUsageGuide?.()) {\n        resources.push({\n            uri: 'file://readme.md',\n            name: 'readme',\n            description: 'Apify MCP Server usage guide...',\n            mimeType: 'text/markdown',\n        });\n    }\n    // ...\n};\n```\n\nSource: [src/resources/resource_service.ts:27-38](https://github.com/apify/apify-mcp-server/blob/main/src/resources/resource_service.ts)\n\n## Configuration Reference\n\n| Configuration Option | Provider | Description |\n|---------------------|----------|-------------|\n| `APIFY_TOKEN` | Standard | Apify API token for traditional authentication |\n| `payment=x402` | x402 | Query parameter to enable x402 payments |\n| `--x402` | x402 | CLI flag to enable x402 protocol |\n\nSource: [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n## Security Considerations\n\n### Field Redaction\n\nSensitive payment fields are redacted before logging to prevent credential exposure:\n\n```typescript\n// From PaymentProvider interface\nredactForLogging(args: unknown): unknown;\n```\n\n### Field Removal\n\nPayment-specific fields are stripped from tool arguments before passing to Actor input:\n\n```typescript\nremovePaymentFields(args: Record<string, unknown>): Record<string, unknown>;\n```\n\nThis ensures:\n1. AJV validation operates on clean schema without payment-specific fields\n2. Actor input does not contain provider-specific payment data\n3. Logging contains redacted versions only\n\n---\n\n<a id='widget-system'></a>\n\n## Widget System\n\n### Related Pages\n\nRelated topics: [UI Components Library](#ui-components)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [src/web/src/widgets/actor-detail-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/widgets/actor-detail-widget.tsx)\n- [src/web/src/widgets/actor-run-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/widgets/actor-run-widget.tsx)\n- [src/web/src/widgets/search-actors-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/widgets/search-actors-widget.tsx)\n- [src/web/src/utils/init-widget.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/utils/init-widget.tsx)\n- [src/web/src/context/mcp-app-context.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/context/mcp-app-context.tsx)\n- [src/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/resources/resource_service.ts)\n- [src/web/src/pages/ActorSearch/ActorSearch.skeleton.tsx](https://github.com/apify/apify-mcp-server/blob/main/src/web/src/pages/ActorSearch/ActorSearch.skeleton.tsx)\n- [res/web-widget-bundle-size.md](https://github.com/apify/apify-mcp-server/blob/main/res/web-widget-bundle-size.md)\n- [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n</details>\n\n# Widget System\n\n## Overview\n\nThe Widget System provides interactive, self-contained UI components that render inside MCP (Model Context Protocol) clients, specifically optimized for MCP Apps. Widgets enable rich visual experiences for Actor discovery, details viewing, and run monitoring without requiring the client to implement custom rendering logic.\n\n## Architecture\n\n### High-Level Architecture\n\n```mermaid\ngraph TD\n    subgraph \"MCP Client\"\n        A[MCP Apps SDK]\n    end\n    \n    subgraph \"Apify MCP Server\"\n        B[Resource Handler]\n        C[Tool Handlers]\n        D[Available Widgets Registry]\n    end\n    \n    subgraph \"Widget Bundle\"\n        E[Actor Search Widget]\n        F[Actor Detail Widget]\n        G[Actor Run Widget]\n    end\n    \n    subgraph \"UI Library\"\n        H[@apify/ui-library]\n        I[@apify/ui-icons]\n    end\n    \n    A -->|ui://widget/*| B\n    B -->|Lookup| D\n    D -->|Return Widget Path| B\n    B -->|Read JS Bundle| E\n    B -->|Read JS Bundle| F\n    B -->|Read JS Bundle| G\n    E -->|Import| H\n    F -->|Import| H\n    G -->|Import| H\n    C -->|Tool Output| A\n```\n\n### Widget Loading Flow\n\n```mermaid\nsequenceDiagram\n    participant Client as MCP Client\n    participant Server as MCP Server\n    participant FS as File System\n    participant Widget as Widget Bundle\n\n    Client->>Server: resources/read with ui://widget/actor-detail.html\n    Server->>Server: Check getMode() === ServerMode.APPS\n    Server->>Server: Lookup widget in availableWidgets\n    Server->>FS: Read widget.jsPath\n    FS-->>Server: widgetJs content\n    Server->>Server: Wrap in HTML template\n    Server-->>Client: HTML resource with MIME type\n    Client->>Widget: Execute module script\n    Widget->>Widget: useWidgetProps() reads tool output\n    Widget->>Widget: renderWidget() mounts component\n```\n\n## Widget Types\n\nThe system implements three primary widget types:\n\n| Widget | File | Purpose |\n|--------|------|---------|\n| Actor Search Widget | `search-actors-widget.tsx` | Search and browse Actors in Apify Store |\n| Actor Detail Widget | `actor-detail-widget.tsx` | Display Actor information, pricing, input schema |\n| Actor Run Widget | `actor-run-widget.tsx` | Show Actor execution progress and results |\n\n## Core Components\n\n### Widget Initialization (`init-widget.tsx`)\n\nThe `renderWidget` function is the entry point for all widgets:\n\n```typescript\n// src/web/src/utils/init-widget.tsx\nrenderWidget(WidgetComponent);\n```\n\nThis function:\n1. Creates a root container element\n2. Renders the widget component into the container\n3. Injects the necessary styles and context providers\n4. Returns cleanup functions for hot-reload scenarios\n\n### Widget Props Hook (`use-widget-props.ts`)\n\nWidgets receive tool output data through the `useWidgetProps` hook:\n\n```typescript\n// src/web/src/widgets/actor-detail-widget.tsx\nconst toolOutput = useWidgetProps<WidgetToolOutput>();\nconst details = toolOutput?.details;\n```\n\nThe hook interface:\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `details` | `ActorDetails \\| undefined` | Actor information from tool call |\n| `input` | `Record<string, unknown>` | Input parameters |\n| `meta` | `WidgetMeta` | Metadata about the widget session |\n\n### MCP App Context (`mcp-app-context.tsx`)\n\nProvides global state and utilities for widgets:\n\n```typescript\ninterface McpAppContextValue {\n    // Context methods and state\n}\n```\n\n### Widget Wrapper Pattern\n\nEach widget follows a consistent wrapper pattern:\n\n```typescript\n// src/web/src/widgets/actor-detail-widget.tsx\nconst ActorDetailWrapper = () => {\n    const toolOutput = useWidgetProps<WidgetToolOutput>();\n    const details = toolOutput?.details;\n\n    if (!details) {\n        return <div>No actor details available</div>;\n    }\n\n    return <ActorSearchDetail details={details} />;\n};\n\n(async () => {\n    if (IS_DEV_BUILD) {\n        const { setupActorDetailWidgetDev } = await import(\"./actor-detail-widget.dev\");\n        setupActorDetailWidgetDev();\n    }\n    renderWidget(ActorDetailWrapper);\n})();\n```\n\n## Resource Service Integration\n\n### URI Scheme\n\nWidgets are exposed as MCP resources using the `ui://widget/` URI scheme:\n\n```\nui://widget/actor-search.html\nui://widget/actor-detail.html\nui://widget/actor-run.html\n```\n\nSource: `src/resources/resource_service.ts`\n\n### Resource Handler Logic\n\n```typescript\n// src/resources/resource_service.ts\nif (getMode() === ServerMode.APPS && uri.startsWith('ui://widget/')) {\n    const widget = getAvailableWidgets().get(uri);\n\n    if (!widget || !widget.exists) {\n        return {\n            contents: [{\n                uri,\n                mimeType: 'text/plain',\n                text: `Widget ${uri} is not available. ${!widget ? 'Not found in registry.' : `File not found at ${widget.jsPath}`}`,\n            }],\n        };\n    }\n\n    try {\n        const fs = await import('node:fs');\n        const widgetJs = fs.readFileSync(widget.jsPath, 'utf-8');\n\n        const widgetHtml = `<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>${widget.title}</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\">${widgetJs}</script>\n  </body>\n</html>`;\n\n        const widgetContent: ExtendedResourceContents = {\n            uri,\n            mimeType: RESOURCE_MIME_TYPE,\n            text: widgetHtml,\n            html: widgetHtml,\n            _meta: widget.meta,\n        };\n        return { contents: [widgetContent] };\n    } catch (error) {\n        return {\n            contents: [{\n                uri,\n                mimeType: 'text/plain',\n                text: `Failed to load widget: ${errorMessage}`,\n            }],\n        };\n    }\n}\n```\n\n## Bundle Size Optimization\n\n### Optimization Strategy\n\nWidget bundles are optimized through narrow imports from `@apify/ui-library`. The top-level barrel import pulls in heavy transitive dependencies (floating UI, markdown helpers), which are avoided by importing specific modules.\n\n### Import Patterns\n\n```typescript\n// ❌ AVOID - Pulls entire library\nimport { Button } from '@apify/ui-library';\n\n// ✅ PREFER - Narrow import\nimport { Button } from '@apify/ui-library/dist/src/...';\n```\n\nSource: `res/web-widget-bundle-size.md`\n\n### Verified Bundle Sizes\n\n| Widget | Before | After | Reduction |\n|--------|--------|-------|-----------|\n| actor-run-widget | ~1.86 MB | ~1.16 MB | 38% |\n| actor-detail-widget | ~1.86 MB | ~1.52 MB | 18% |\n| search-actors-widget | ~1.87 MB | ~1.53 MB | 18% |\n\nSource: `res/web-widget-bundle-size.md`\n\n### Special Cost Center: Markdown\n\nMarkdown rendering is treated as a special cost center. Changes to markdown processing require re-measuring bundle size impact.\n\n## Development Workflow\n\n### Hot-Reload Development\n\nThe development server supports hot-reload for widgets:\n\n```bash\nAPIFY_TOKEN='your-apify-token' pnpm run dev\n```\n\nThis starts:\n1. Web widget builder in watch mode\n2. MCP server in standby mode on port `3001`\n3. Local esbuild dev server at `http://localhost:3226`\n\nSource: `DEVELOPMENT.md`\n\n### Preview Widgets\n\nWidgets can be previewed locally via:\n```\nhttp://localhost:3226/index.html\n```\n\nThe preview page links to:\n- Actor Search Widget: `/index-actor-search.html`\n- Actor Run Widget: `/index-actor-run.html`\n\n### UI Mode Requirement\n\nWidget rendering requires the server to run in UI mode. Enable via:\n- Query parameter: `/mcp?ui=true`\n- Environment variable: `UI_MODE=true`\n\n## Widget Tool Output Interface\n\nEach widget expects a specific output structure from the invoking tool:\n\n```typescript\ninterface WidgetToolOutput extends Record<string, unknown> {\n    details?: ActorDetails;\n}\n\ninterface ActorDetails {\n    name: string;\n    description: string;\n    pricing: PricingInfo;\n    inputSchema: InputSchema;\n    // ... other properties\n}\n```\n\n## Design System Compliance\n\nWidgets must follow the Apify design system rules defined in `DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md`:\n\n### Token Usage\n\n| Token Category | Usage | Example |\n|---------------|-------|---------|\n| Colors | Use `theme.color.*` | `theme.color.neutral.text` |\n| Spacing | Use `theme.space.*` | `theme.space.space16` |\n| Shadows | Use `theme.shadow.*` | `theme.shadow.shadow2` |\n\n### Component Structure\n\n```typescript\n// 1. Imports\nimport styled from 'styled-components';\nimport { theme } from '@apify/ui-library';\n\n// 2. Constants & Types\nexport const COMPONENT_VARIANTS = { ... } as const;\n\n// 3. Styled Components\nconst StyledWrapper = styled.div`...`;\n\n// 4. Component Implementation\nexport const Component = forwardRef<HTMLElement, Props>((props, ref) => {\n    // implementation\n});\n\n// 5. Display Name\nComponent.displayName = 'Component';\n```\n\n## Skeleton Loading States\n\nWidgets implement skeleton loading states for async content:\n\n```typescript\n// src/web/src/pages/ActorSearch/ActorSearch.skeleton.tsx\nconst SectionHeaderSkeleton: React.FC = () => {\n    return (\n        <SectionHeaderWrapper px=\"space16\" py=\"space12\">\n            <SkeletonBlock style={{ height: '24px', width: '96px' }} />\n            <SkeletonBlock style={{ height: '16px', width: '64px' }} />\n        </SectionHeaderWrapper>\n    );\n};\n```\n\n## Configuration\n\n### Widget Registry\n\nWidgets are registered in the `availableWidgets` registry, which tracks:\n- Widget URI path\n- JavaScript file path\n- Title for HTML template\n- Existence status\n- Metadata\n\n### Server Mode\n\nWidget resources are only available when `getMode() === ServerMode.APPS`. In default mode, requests to `ui://widget/*` URIs return an error message.\n\n---\n\n<a id='ui-components'></a>\n\n## UI Components Library\n\n### Related Pages\n\nRelated topics: [Widget System](#widget-system)\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](https://github.com/apify/apify-mcp-server/blob/main/DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n- [src/web/package.json](https://github.com/apify/apify-mcp-server/blob/main/src/web/package.json)\n- [res/web-widget-bundle-size.md](https://github.com/apify/apify-mcp-server/blob/main/res/web-widget-bundle-size.md)\n- [src/tools/structured_output_schemas.ts](https://github.com/apify/apify-mcp-server/blob/main/src/tools/structured_output_schemas.ts)\n- [src/resources/resource_service.ts](https://github.com/apify/apify-mcp-server/blob/main/src/resources/resource_service.ts)\n- [src/utils/server-instructions/index.ts](https://github.com/apify/apify-mcp-server/blob/main/src/utils/server-instructions/index.ts)\n</details>\n\n# UI Components Library\n\n## Overview\n\nThe Apify MCP Server utilizes a dedicated UI Components Library to render interactive widgets within the MCP Apps environment. These components enable the server to deliver rich, styled user interfaces for displaying Actor information, search results, and run progress directly within AI assistant applications.\n\nThe UI components are built using **React 18.3.1** and **styled-components 6.3.8**, with design tokens sourced from the `@apify/ui-library` package. Source: [src/web/package.json](src/web/package.json)\n\n## Architecture\n\n### Component Location and Structure\n\nUI widgets reside in `src/web/src/widgets/` and leverage shared components from `src/web/src/components/ui/`. The component library follows a consistent pattern where all styled components import the `theme` object from `@apify/ui-library` to ensure design consistency across the application. Source: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Widget Rendering Pipeline\n\nThe following diagram illustrates how UI components integrate with the MCP server:\n\n```mermaid\ngraph TD\n    A[MCP Client Request] --> B[Server Handler]\n    B --> C{Server Mode}\n    C -->|APPS| D[Widget Registry]\n    C -->|DEFAULT| E[Standard Response]\n    D --> F[Read Widget JS Bundle]\n    F --> G[Wrap in HTML Template]\n    G --> H[Return HTML via Resource]\n    H --> I[MCP Apps Renderer]\n    I --> J[React Components Mount]\n```\n\nSource: [src/resources/resource_service.ts](src/resources/resource_service.ts)\n\n### Bundle Optimization Strategy\n\nThe widget bundles must remain self-contained while minimizing payload size. The system uses direct module imports from `@apify/ui-library/dist/src/...` instead of top-level imports to avoid pulling in heavy transitive dependencies. Source: [res/web-widget-bundle-size.md](res/web-widget-bundle-size.md)\n\n**Bundle size improvements achieved:**\n\n| Widget | Before | After | Reduction |\n|--------|--------|-------|-----------|\n| actor-run-widget | ~1.86 MB | ~1.16 MB | 37.6% |\n| actor-detail-widget | ~1.86 MB | ~1.52 MB | 18.3% |\n| search-actors-widget | ~1.87 MB | ~1.53 MB | 18.2% |\n\n## Design System Compliance\n\nAll UI components must adhere to strict design system rules defined in `DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md`. These rules ensure visual consistency and maintainability across all widgets. Source: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Design Tokens\n\nComponents **must** use `theme.*` tokens exclusively for all styling values. Hardcoded values are strictly forbidden.\n\n```typescript\n// ❌ FORBIDDEN\ncolor: '#1976d2'\npadding: '8px'\nborder-radius: '4px'\n\n// ✅ REQUIRED\ncolor: ${theme.color.primary.action}\npadding: ${theme.space.space8}\nborder-radius: ${theme.radius.radius2}\n```\n\n**Available token categories:**\n\n| Category | Examples | Purpose |\n|----------|----------|---------|\n| Colors | `theme.color.primary.action`, `theme.color.neutral.textMuted` | Brand colors and semantic variants |\n| Spacing | `theme.space.space8`, `theme.space.space16`, `theme.space.space40` | Padding, margins, gaps |\n| Border Radius | `theme.radius.radius2`, `theme.radius.radius3` | Component corners |\n| Shadows | `theme.shadow1`, `theme.shadow3`, `theme.shadowActive` | Elevation and depth |\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Component Import Pattern\n\nAll shared UI components should be imported from `@apify/ui-library`. Components must never be duplicated locally or imported from arbitrary relative paths.\n\n```typescript\n// ✅ Correct\nimport { Button, Badge, Chip, Text, Heading } from '@apify/ui-library';\n\n// ❌ Never create duplicate implementations\n```\n\n## Component Patterns\n\n### Styled Components Structure\n\nThe project follows a standardized component structure to ensure consistency across all UI elements. Source: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n**Component file organization:**\n\n```typescript\n// 1. Imports (grouped)\nimport { forwardRef } from 'react';\nimport styled from 'styled-components';\nimport { theme } from '@apify/ui-library';\n\n// 2. Constants & Types\nexport const COMPONENT_VARIANTS = { ... } as const;\ntype ComponentVariants = ValueOf<typeof COMPONENT_VARIANTS>;\n\n// 3. Styled Components\nconst StyledWrapper = styled.div`...`;\n\n// 4. Component Implementation\nexport const Component = forwardRef<HTMLElement, Props>((props, ref) => {\n    // implementation\n});\n\n// 5. Display Name\nComponent.displayName = 'Component';\n```\n\n### Transient Props Convention\n\nComponent props that should not be passed to the underlying DOM element must use the `$` prefix:\n\n```typescript\nconst StyledButton = styled.button<{ $variant?: string }>`\n    background: ${({ $variant }) => \n        $variant === 'primary' \n            ? theme.color.primary.action \n            : theme.color.neutral.background\n    };\n`;\n```\n\n**Common transient props:** `$variant`, `$isActive`, `$size`\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n### Typography Components\n\nTypography must use the `Text` and `Heading` components from `@apify/ui-library` rather than direct styling:\n\n```typescript\n// ✅ Correct\nimport { Text, Heading } from '@apify/ui-library';\n\n<Text type=\"body\" size=\"regular\" weight=\"normal\">Content here</Text>\n<Heading type=\"titleL\">Title here</Heading>\n\n// ❌ Never style text elements directly\n// ❌ Never use typography tokens\n```\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Spacing System\n\nThe design system defines a consistent spacing scale that must be used for all layout measurements:\n\n| Token | Usage | Example |\n|-------|-------|---------|\n| `space4` | Inline elements, icon gaps | `gap: ${theme.space.space4}` |\n| `space8` | Button padding, small gaps | `padding: ${theme.space.space8}` |\n| `space12` | Component internal spacing | `padding: ${theme.space.space12}` |\n| `space16` | Standard component padding | `padding: ${theme.space.space16}` |\n| `space24` | Section margins | `margin: ${theme.space.space24}` |\n| `space32` | Section separators | `margin: ${theme.space.space32}` |\n| `space40`, `space64`, `space80` | Large layouts | Container margins |\n\n**Rule:** Never use arbitrary values like `gap: 10px` — always round to the nearest design token.\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Common Pitfalls\n\n### Token Misuse\n\nAvoid mixing hardcoded values with design tokens in the same property:\n\n```typescript\n// ❌ WRONG\npadding: ${theme.space.space16} 10px;\n\n// ✅ CORRECT\npadding: ${theme.space.space16} ${theme.space.space10};\n```\n\n### Non-existent Token Properties\n\nAlways verify token property names exist in the theme object:\n\n```typescript\n// ❌ WRONG - These properties don't exist\ntheme.color.neutral.textLight\ntheme.color.primary.main\n\n// ✅ CORRECT - Use actual property names\ntheme.color.neutral.textMuted\ntheme.color.primary.action\n```\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Widget Output Schemas\n\nUI components receive data through structured output schemas that define the expected data format:\n\n### Actor Details Widget Schema\n\n```typescript\nexport const actorDetailsWidgetOutputSchema = {\n    type: 'object',\n    properties: {\n        actorDetails: {\n            type: 'object',\n            properties: {\n                actorInfo: { \n                    type: 'object', \n                    description: 'Widget-formatted Actor info (tier-aware pricing, widget display fields).' \n                },\n                actorCard: { \n                    type: 'string', \n                    description: 'Rendered Actor card markdown for widget display.' \n                },\n                readme: { \n                    type: 'string', \n                    description: 'Formatted Actor README for widget display.' \n                },\n            },\n            required: ['actorInfo', 'actorCard', 'readme'],\n        },\n    },\n    required: ['actorDetails'],\n};\n```\n\nSource: [src/tools/structured_output_schemas.ts](src/tools/structured_output_schemas.ts)\n\n### Actor Search Widget Schema\n\n```typescript\nexport const actorSearchOutputSchema = {\n    type: 'object',\n    properties: {\n        actors: {\n            type: 'array',\n            items: actorInfoSchema,\n            description: 'List of Actor cards matching the search query',\n        },\n        query: { type: 'string', description: 'The search query used' },\n        count: { type: 'number', description: 'Number of Actors returned' },\n        instructions: { type: 'string', description: 'Additional instructions for the LLM.' },\n    },\n    required: ['actors', 'query', 'count'],\n};\n```\n\nSource: [src/tools/structured_output_schemas.ts](src/tools/structured_output_schemas.ts)\n\n## Widget Configuration\n\n### Server Mode Detection\n\nThe UI components library operates differently based on the server mode:\n\n| Mode | Behavior | Widget Tools Available |\n|------|----------|------------------------|\n| `DEFAULT` | Standard MCP response | No widget tools exposed |\n| `APPS` | Widget rendering enabled | `search-actors-widget`, `fetch-actor-details-widget`, `actor-run-widget` |\n\nSource: [src/utils/server-instructions/index.ts](src/utils/server-instructions/index.ts)\n\n### Resource URI Scheme\n\nWidgets are accessed via the `ui://widget/` URI scheme in APPS mode:\n\n```\nui://widget/search-actors.html\nui://widget/actor-detail.html\nui://widget/actor-run.html\n```\n\nSource: [src/resources/resource_service.ts](src/resources/resource_service.ts)\n\n## Development Workflow\n\n### Pre-Work Checklist\n\nBefore any UI component work, developers should:\n\n1. **Check MCP availability** — Search for `mcp__storybook__*` and `mcp__figma__*` tools\n2. **Load design context** — Call `mcp__storybook__get-ui-building-instructions` if available\n3. **Read existing patterns** — Find 1-3 similar components in `src/web/src/**/*{keyword}*.{tsx,ts}`\n4. **Use Grep for patterns** — Search for `theme\\.color\\.|theme\\.space\\.|theme\\.radius\\.`\n\n### Verification Protocol\n\nBefore submitting UI changes, verify:\n\n| Check | Command/Method | Expected Result |\n|-------|----------------|-----------------|\n| Color audit | Regex `['\"]#[0-9a-fA-F]{3,8}['\"]` | Zero matches |\n| Spacing audit | Regex `['\"][0-9]+px['\"]` | Zero matches |\n| Import check | All styled-components import `theme` | 100% compliance |\n| Pattern match | Compare to 1-3 similar components | Consistent structure |\n\nSource: [DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md](DESIGN_SYSTEM_AGENT_INSTRUCTIONS.md)\n\n## Bundle Optimization Guidelines\n\n### Import Optimization\n\nThe `@apify/ui-library` package uses a barrel export pattern. Direct module imports significantly reduce bundle size:\n\n```typescript\n// ❌ Heavy - pulls entire library\nimport { Button } from '@apify/ui-library';\n\n// ✅ Optimized - only includes Button\nimport { Button } from '@apify/ui-library/dist/src/primitives/Button';\n```\n\n### Cost Centers\n\n| Component/Feature | Bundle Impact | Notes |\n|-------------------|---------------|-------|\n| Floating UI | High | Heavy transitive dependency |\n| Markdown rendering | High | Special cost center - measure impact on changes |\n| Convenience components | Medium | Prefer narrow imports |\n| Primitive components | Low | Direct module imports sufficient |\n\nSource: [res/web-widget-bundle-size.md](res/web-widget-bundle-size.md)\n\n## Dependencies\n\n### Core UI Dependencies\n\n| Package | Version | Purpose |\n|---------|---------|---------|\n| `react` | ^18.3.1 | UI framework |\n| `react-dom` | ^18.3.1 | React DOM rendering |\n| `styled-components` | ^6.3.8 | CSS-in-JS styling |\n| `@apify/ui-library` | ^1.124.0 | Design system tokens and primitives |\n| `@apify/ui-icons` | ^1.27.2 | Icon components |\n\n### Build Dependencies\n\n| Package | Version | Purpose |\n|---------|---------|---------|\n| `esbuild` | ^0.28.0 | Fast bundler for widgets |\n| `typescript` | ^5.6.3 | Type safety |\n| `tailwindcss` | ^3.4.17 | Utility CSS (used sparingly) |\n\nSource: [src/web/package.json](src/web/package.json)\n\n---\n\n<a id='development-setup'></a>\n\n## Development Setup\n\n<details>\n<summary>Relevant source files</summary>\n\nThe following source files were used to generate this page:\n\n- [DEVELOPMENT.md](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n- [CONTRIBUTING.md](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n- [README.md](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n- [manifest.json](https://github.com/apify/apify-mcp-server/blob/main/manifest.json)\n- [src/dev_server.ts](https://github.com/apify/apify-mcp-server/blob/main/src/dev_server.ts)\n</details>\n\n# Development Setup\n\nThis guide covers everything needed to set up a local development environment for the Apify MCP Server project.\n\n## Prerequisites\n\n### System Requirements\n\n| Requirement | Minimum Version | Notes |\n|-------------|-----------------|-------|\n| Node.js | 20.0.0+ | Required runtime |\n| pnpm | 11+ | Package manager |\n| Claude Desktop | 0.2.16+ | For desktop integration |\n\n**Supported Platforms:** macOS (darwin), Windows (win32), Linux (linux)\n\nSource: [manifest.json:15-24](https://github.com/apify/apify-mcp-server/blob/main/manifest.json)\n\n### Repository Architecture\n\nThe project uses a monorepo structure with the following key directories:\n\n```\napify-mcp-server/\n├── src/                    # Main MCP server source code\n│   ├── mcp/               # MCP protocol implementation\n│   └── web/               # React widgets for MCP Apps UI\n├── tests/\n│   ├── unit/              # Unit tests\n│   └── integration/       # Integration tests\n└── res/                   # Resource documentation\n```\n\nSource: [DEVELOPMENT.md:50-57](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Installation\n\n### 1. Enable Corepack\n\nThe project uses pnpm 11+ as specified in `package.json#packageManager`. Corepack (bundled with Node 16+) automatically manages the pnpm version:\n\n```bash\ncorepack enable\n```\n\nThis is a one-time setup that makes pnpm available system-wide.\n\n### 2. Install Dependencies\n\nInstall all project dependencies in a single command:\n\n```bash\npnpm install\n```\n\nThis command installs dependencies for both the root workspace and the `src/web` workspace package simultaneously.\n\n> **Note:** The `devEngines.packageManager` is pinned with `onFail: \"error\"`, which means running `npm install` or `yarn install` will fail. This ensures lockfile consistency.\n\nSource: [DEVELOPMENT.md:41-45](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Environment Configuration\n\n### APIFY_TOKEN Setup\n\nThe `APIFY_TOKEN` is required for most server operations.\n\n#### For Claude Code\n\nCreate or edit `.claude/settings.local.json`:\n\n```json\n{\n  \"env\": {\n    \"APIFY_TOKEN\": \"<YOUR_APIFY_API_TOKEN>\"\n  }\n}\n```\n\nRestart Claude Code for the changes to take effect. The token is automatically picked up by both Claude Code MCP servers (defined in `.mcp.json`) and mcpc.\n\n#### For Local Development\n\nCreate an environment file `.env` in the project root:\n\n```text\nAPIFY_TOKEN=\"your-apify-token\"\n```\n\nSource: [DEVELOPMENT.md:14-24](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n### Environment Variables Reference\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `APIFY_TOKEN` | Yes | Apify API authentication token |\n| `APIFY_META_ORIGIN` | No | Meta origin for tracking (e.g., `STANDBY`) |\n| `UI_MODE` | No | Enable UI mode for widget rendering (`true`/`false`) |\n\n## Building the Project\n\n### Production Build\n\nTo build the MCP server for production:\n\n```bash\npnpm run build\n```\n\nThis compiles the TypeScript source and produces output in the `dist/` directory.\n\nSource: [DEVELOPMENT.md:64-68](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n### Development Server\n\nFor active development with hot-reload capabilities, the project includes a development server at `src/dev_server.ts`. This server provides:\n\n- Automatic recompilation on file changes\n- Debugging endpoints for MCP protocol inspection\n- Live widget preview at `http://localhost:3001`\n\n## Running the Server\n\n### HTTP Streamable Mode\n\nRun the server as an HTTP server using Apify CLI:\n\n```bash\nexport APIFY_TOKEN=\"your-apify-token\"\nexport APIFY_META_ORIGIN=STANDBY\napify run -p\n```\n\nThe server will be exposed at `http://localhost:3001`.\n\nSource: [README.md:28-34](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n### Standard I/O (stdio) Mode\n\nFor use with the MCP Inspector or local clients:\n\n```bash\nexport APIFY_TOKEN=\"your-apify-token\"\nnpx @modelcontextprotocol/inspector node ./dist/stdio.js\n```\n\nThe Inspector will display a URL for browser-based debugging.\n\nSource: [README.md:40-46](https://github.com/apify/apify-mcp-server/blob/main/README.md)\n\n## Testing\n\n### Testing Layers\n\nThe project implements a multi-layer testing strategy:\n\n| Layer | Command | Coverage |\n|-------|---------|----------|\n| Unit Tests | `pnpm run test:unit` | Individual modules in isolation |\n| Integration Tests | `pnpm run test:integration` | Full server over all transports against real Apify API |\n| Interactive Verification | `mcpc @stdio tools-call ...` | End-to-end during development |\n| LLM Evaluations | CI only | Multiple models via OpenRouter |\n\nSource: [DEVELOPMENT.md:26-36](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n### Unit Tests\n\nUnit tests verify individual modules without external dependencies:\n\n```bash\npnpm run test:unit\n```\n\nNo credentials are required for unit tests.\n\n### Integration Tests\n\nIntegration tests verify the complete MCP server functionality:\n\n```bash\npnpm run test:integration\n```\n\n**Requirements:**\n- Valid `APIFY_TOKEN` environment variable\n- Compiled production build (`pnpm run build`)\n\n### Interactive Probing with mcpc\n\nFor manual verification during development:\n\n```bash\nmcpc @stdio tools-call ...\n```\n\n### LLM Evaluations\n\nLLM evaluations run in CI and require the `validated` label on the PR:\n\n```bash\n# Trigger eval workflow\n# 1. Apply the 'validated' label to your PR\n\n# Environment variables required in CI:\nPHOENIX_*        # Phoenix evaluation platform credentials\nOPENROUTER_*     # OpenRouter API credentials\n```\n\nEvaluations run automatically:\n- When `validated` label is applied to a PR\n- On every merge to the `master` branch\n\nResults are posted to Phoenix for analysis.\n\nSource: [DEVELOPMENT.md:35-38](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Development Workflow\n\n### Mermaid: Development Workflow\n\n```mermaid\ngraph TD\n    A[Clone Repository] --> B[Enable corepack]\n    B --> C[pnpm install]\n    C --> D[Configure APIFY_TOKEN]\n    D --> E{Development Mode}\n    \n    E -->|HTTP Stream| F[apify run -p]\n    E -->|stdio| G[node ./dist/stdio.js]\n    E -->|Widget Dev| H[src/web dev server]\n    \n    F --> I[Debug with MCP Inspector]\n    G --> I\n    H --> J[Browser Preview: localhost:3001]\n    \n    I --> K{Testing}\n    K -->|Unit| L[pnpm run test:unit]\n    K -->|Integration| M[pnpm run test:integration]\n    K -->|Manual| N[mcpc probing]\n    \n    L --> O[Validate & Submit PR]\n    M --> O\n    N --> O\n```\n\n### Branch Naming\n\nAll feature branches must follow the format:\n\n```\n<type>/<short-description>\n```\n\nWhere `<type>` matches conventional commit types:\n\n| Type | Use Case |\n|------|----------|\n| `feat` | New features |\n| `fix` | Bug fixes |\n| `chore` | Maintenance tasks |\n| `refactor` | Code refactoring |\n| `docs` | Documentation updates |\n\n**Examples:**\n- `feat/add-dataset-tool`\n- `fix/connection-timeout`\n- `chore/update-dependencies`\n\nSource: [CONTRIBUTING.md:8-13](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n\n### Commit Messages\n\nAll commits and PR titles must follow the **Conventional Commits** format:\n\n```\n<type>(<scope>)!: <description>\n```\n\n| Component | Required | Description |\n|-----------|----------|-------------|\n| type | Yes | feat, fix, chore, refactor, docs, etc. |\n| scope | Yes | The affected component/module |\n| `!` | No | Indicates breaking change |\n| description | Yes | Brief summary of changes |\n\n**Examples:**\n```\nfeat: Add new tool for fetching actor details\nfeat!: Migrate to new MCP SDK version\nfix: Handle connection errors gracefully\nchore: Update dependencies\n```\n\nSource: [CONTRIBUTING.md:17-35](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n\n## UI Widget Development\n\n### Widget Architecture\n\nThe MCP Apps (ChatGPT Apps) UI widgets are built as a separate React project within `src/web/`. Widgets are rendered based on tool output—modifying widget data requires changing the corresponding tool's return value.\n\n### UI Mode\n\nWidget rendering requires the server to run in UI mode:\n\n**Via Query Parameter:**\n```\n/mcp?ui=true\n```\n\n**Via Environment Variable:**\n```bash\nexport UI_MODE=true\n```\n\n**Via CLI Flag:**\n```bash\nnpx @apify/actors-mcp-server --ui true\n```\n\n### Widget Preview\n\nPreview widgets during development:\n\n```bash\n# Actor Search Widget\n# Open: http://localhost:3001/index-actor-search.html\n\n# Actor Run Widget  \n# Open: http://localhost:3001/index-actor-run.html\n```\n\nSource: [DEVELOPMENT.md:58-62](https://github.com/apify/apify-mcp-server/blob/main/DEVELOPMENT.md)\n\n## Code Quality Standards\n\n### Naming Conventions\n\n| Element | Convention | Example |\n|---------|------------|---------|\n| Types/Interfaces | PascalCase | `ActorDetails`, `ToolConfig` |\n| Variables/Functions | camelCase | `actorName`, `fetchActorDetails()` |\n| Constants | SCREAMING_SNAKE_CASE | `MAX_RETRIES`, `WIDGET_REGISTRY` |\n| Zod Validators | Suffix with `Validator` | `ActorValidator` |\n\n### String Formatting\n\n**Single-line strings:** Use single quotes\n```typescript\nconst message = 'Operation completed';\n```\n\n**Multi-line strings:** Use `dedent` for LLM-facing content\n```typescript\nimport dedent from 'dedent';\n\nconst description = dedent`\n    Line 1\n    Line 2\n`;\n```\n\n**Avoid:**\n- `[].join('\\n')` for multiline strings\n- Hardcoded hex colors or pixel values in UI code\n\nSource: [CONTRIBUTING.md:56-75](https://github.com/apify/apify-mcp-server/blob/main/CONTRIBUTING.md)\n\n## Troubleshooting\n\n### Common Issues\n\n| Issue | Solution |\n|-------|----------|\n| `pnpm install` fails | Ensure Node.js 20+ is installed |\n| Wrong pnpm version | Run `corepack enable` |\n| Tests fail with \"Token required\" | Set `APIFY_TOKEN` environment variable |\n| Widgets not rendering | Verify `UI_MODE=true` is set |\n\n### Node Version Management\n\nThe `.nvmrc` file pins the development tooling Node version (currently 24). This is intentionally higher than the published floor to support modern tooling features.\n\n```bash\n# Check current Node version\nnode --version\n\n# Switch to project-required version (requires nvm)\nnvm use\n```\n\n### Verifying Installation\n\nRun the following commands to verify your setup:\n\n```bash\n# Verify pnpm version\npnpm --version  # Should be 11+\n\n# Verify Node version\nnode --version  # Should be 20+\n\n# Run unit tests\npnpm run test:unit\n\n# Build project\npnpm run build\n```\n\nIf all commands succeed, your development environment is properly configured.\n\n---\n\n---\n\n## Doramagic Pitfall Log\n\nProject: apify/apify-mcp-server\n\nSummary: Found 22 potential pitfall items; 5 are high/blocking. Highest priority: installation - 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode.\n\n## 1. installation · 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：fix: Allow calling MCP server actors in normal (one-shot) mode\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_be82315ed0f441ba9d942931d846d78c | https://github.com/apify/apify-mcp-server/issues/857 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 2. configuration · 来源证据：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8ec6ff22f24a4bb18b439177f4a8c270 | https://github.com/apify/apify-mcp-server/issues/892 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 3. security_permissions · 来源证据：Do not include the rag web browser when ?payment=x402\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Do not include the rag web browser when ?payment=x402\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_23bafe4901554148896241f0a1e183b0 | https://github.com/apify/apify-mcp-server/issues/875 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 4. security_permissions · 来源证据：Perf: `search-actors` tools returns huuuge `inputFields` object\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Perf: `search-actors` tools returns huuuge `inputFields` object\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_af51cb3cbcb3479fbbdf27cedef734aa | https://github.com/apify/apify-mcp-server/issues/888 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 5. security_permissions · 来源证据：feat(telemetry): track tool result size in bytes\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat(telemetry): track tool result size in bytes\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_9c2ef77c88914458910ae67d9f903931 | https://github.com/apify/apify-mcp-server/issues/838 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 6. identity · 仓库名和安装名不一致\n\n- Severity: medium\n- Evidence strength: runtime_trace\n- Finding: 仓库名 `apify-mcp-server` 与安装入口 `@apify/actors-mcp-server` 不完全一致。\n- User impact: 用户照着仓库名搜索包或照着包名找仓库时容易走错入口。\n- Suggested check: 在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。\n- Reproduction command: `npx @apify/actors-mcp-server`\n- Guardrail action: 页面必须同时展示 repo 名和真实安装入口，避免用户搜索错包。\n- Evidence: identity.distribution | github_repo:911256711 | https://github.com/apify/apify-mcp-server | repo=apify-mcp-server; install=@apify/actors-mcp-server\n\n## 7. installation · 来源证据：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_9c05c17621e3443dad6175f21db31a34 | https://github.com/apify/apify-mcp-server/issues/894 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 8. installation · 来源证据：feat: Add structured output to remaining storage tools\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: Add structured output to remaining storage tools\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_c9b7c39f3e8f43e88ee52c2c8ae94b01 | https://github.com/apify/apify-mcp-server/issues/884 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 9. installation · 来源证据：feat: migrate direct actor tools to canonical RunResponse shape\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: migrate direct actor tools to canonical RunResponse shape\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6b304ff2763849fe9b4678cc7bf9f5b2 | https://github.com/apify/apify-mcp-server/issues/852 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 10. installation · 来源证据：test: Consolidate duplicated MCP server test fixtures\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：test: Consolidate duplicated MCP server test fixtures\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_5a7a24d9e8ce42468a7775a54dfa8ca6 | https://github.com/apify/apify-mcp-server/issues/847 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 11. configuration · 来源证据：feat: Dataset tools correctness and coverage\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：feat: Dataset tools correctness and coverage\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_3fa86b498f66434a8f247c1b63fb56c9 | https://github.com/apify/apify-mcp-server/issues/784 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 12. capability · 能力判断依赖假设\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: README/documentation is current enough for a first validation pass.\n- User impact: 假设不成立时，用户拿不到承诺的能力。\n- Suggested check: 将假设转成下游验证清单。\n- Guardrail action: 假设必须转成验证项；没有验证结果前不能写成事实。\n- Evidence: capability.assumptions | github_repo:911256711 | https://github.com/apify/apify-mcp-server | README/documentation is current enough for a first validation pass.\n\n## 13. runtime · 来源证据：chore: Add mixpanel analytics for storage tools + error rates\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chore: Add mixpanel analytics for storage tools + error rates\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_03dbd8daa0c840d690bddb1d52e189c1 | https://github.com/apify/apify-mcp-server/issues/887 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 14. maintenance · 维护活跃度未知\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: 未记录 last_activity_observed。\n- User impact: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- Suggested check: 补 GitHub 最近 commit、release、issue/PR 响应信号。\n- Guardrail action: 维护活跃度未知时，推荐强度不能标为高信任。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | last_activity_observed missing\n\n## 15. security_permissions · 下游验证发现风险项\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 下游已经要求复核，不能在页面中弱化。\n- Suggested check: 进入安全/权限治理复核队列。\n- Guardrail action: 下游风险存在时必须保持 review/recommendation 降级。\n- Evidence: downstream_validation.risk_items | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium\n\n## 16. security_permissions · 存在评分风险\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 风险会影响是否适合普通用户安装。\n- Suggested check: 把风险写入边界卡，并确认是否需要人工复核。\n- Guardrail action: 评分风险必须进入边界卡，不能只作为内部分数。\n- Evidence: risks.scoring_risks | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium\n\n## 17. security_permissions · 来源证据：[Bug]: Inconsistent `search-actors` schema and results\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[Bug]: Inconsistent `search-actors` schema and results\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_364bc036f84b42e8b7be6534cb76381e | https://github.com/apify/apify-mcp-server/issues/889 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 18. security_permissions · 来源证据：design: Calibrate get-dataset-schema output detail\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：design: Calibrate get-dataset-schema output detail\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8b7a4266d8eb4298919b5cb2a58fa420 | https://github.com/apify/apify-mcp-server/issues/882 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 19. security_permissions · 来源证据：refactor: Extract storage tool helpers\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：refactor: Extract storage tool helpers\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_496f0061952341728e4222b961251325 | https://github.com/apify/apify-mcp-server/issues/890 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 20. security_permissions · 来源证据：tools/list response contains `type: \"unknown\"` in an input schema — rejected by ajv-based MCP clients (LibreChat)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：tools/list response contains `type: \"unknown\"` in an input schema — rejected by ajv-based MCP clients (LibreChat)\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_77fae88d35e2486d8125a2ecea9abdc7 | https://github.com/apify/apify-mcp-server/issues/738 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 21. maintenance · issue/PR 响应质量未知\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: issue_or_pr_quality=unknown。\n- User impact: 用户无法判断遇到问题后是否有人维护。\n- Suggested check: 抽样最近 issue/PR，判断是否长期无人处理。\n- Guardrail action: issue/PR 响应未知时，必须提示维护风险。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | issue_or_pr_quality=unknown\n\n## 22. maintenance · 发布节奏不明确\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: release_recency=unknown。\n- User impact: 安装命令和文档可能落后于代码，用户踩坑概率升高。\n- Suggested check: 确认最近 release/tag 和 README 安装命令是否一致。\n- Guardrail action: 发布节奏未知或过期时，安装说明必须标注可能漂移。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | release_recency=unknown\n\n<!-- canonical_name: apify/apify-mcp-server; human_manual_source: deepwiki_human_wiki -->\n",
      "summary": "DeepWiki/Human Wiki output with a Doramagic pitfall appendix.",
      "title": "Human Manual"
    },
    "pitfall_log": {
      "asset_id": "pitfall_log",
      "filename": "PITFALL_LOG.md",
      "markdown": "# Pitfall Log\n\nProject: apify/apify-mcp-server\n\nSummary: Found 22 potential pitfall items; 5 are high/blocking. Highest priority: installation - 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode.\n\n## 1. installation · 来源证据：fix: Allow calling MCP server actors in normal (one-shot) mode\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：fix: Allow calling MCP server actors in normal (one-shot) mode\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_be82315ed0f441ba9d942931d846d78c | https://github.com/apify/apify-mcp-server/issues/857 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 2. configuration · 来源证据：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Remove the flat-fields back-compat shim from `_meta.x402` once all consumers read `accepts[]`\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8ec6ff22f24a4bb18b439177f4a8c270 | https://github.com/apify/apify-mcp-server/issues/892 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 3. security_permissions · 来源证据：Do not include the rag web browser when ?payment=x402\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Do not include the rag web browser when ?payment=x402\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_23bafe4901554148896241f0a1e183b0 | https://github.com/apify/apify-mcp-server/issues/875 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 4. security_permissions · 来源证据：Perf: `search-actors` tools returns huuuge `inputFields` object\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Perf: `search-actors` tools returns huuuge `inputFields` object\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_af51cb3cbcb3479fbbdf27cedef734aa | https://github.com/apify/apify-mcp-server/issues/888 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 5. security_permissions · 来源证据：feat(telemetry): track tool result size in bytes\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat(telemetry): track tool result size in bytes\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_9c2ef77c88914458910ae67d9f903931 | https://github.com/apify/apify-mcp-server/issues/838 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 6. identity · 仓库名和安装名不一致\n\n- Severity: medium\n- Evidence strength: runtime_trace\n- Finding: 仓库名 `apify-mcp-server` 与安装入口 `@apify/actors-mcp-server` 不完全一致。\n- User impact: 用户照着仓库名搜索包或照着包名找仓库时容易走错入口。\n- Suggested check: 在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。\n- Reproduction command: `npx @apify/actors-mcp-server`\n- Guardrail action: 页面必须同时展示 repo 名和真实安装入口，避免用户搜索错包。\n- Evidence: identity.distribution | github_repo:911256711 | https://github.com/apify/apify-mcp-server | repo=apify-mcp-server; install=@apify/actors-mcp-server\n\n## 7. installation · 来源证据：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chore(core): collapse array indices in dataset fields to prevent nextStep schema bloat\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_9c05c17621e3443dad6175f21db31a34 | https://github.com/apify/apify-mcp-server/issues/894 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 8. installation · 来源证据：feat: Add structured output to remaining storage tools\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: Add structured output to remaining storage tools\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_c9b7c39f3e8f43e88ee52c2c8ae94b01 | https://github.com/apify/apify-mcp-server/issues/884 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 9. installation · 来源证据：feat: migrate direct actor tools to canonical RunResponse shape\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：feat: migrate direct actor tools to canonical RunResponse shape\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6b304ff2763849fe9b4678cc7bf9f5b2 | https://github.com/apify/apify-mcp-server/issues/852 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 10. installation · 来源证据：test: Consolidate duplicated MCP server test fixtures\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：test: Consolidate duplicated MCP server test fixtures\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_5a7a24d9e8ce42468a7775a54dfa8ca6 | https://github.com/apify/apify-mcp-server/issues/847 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 11. configuration · 来源证据：feat: Dataset tools correctness and coverage\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：feat: Dataset tools correctness and coverage\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_3fa86b498f66434a8f247c1b63fb56c9 | https://github.com/apify/apify-mcp-server/issues/784 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 12. capability · 能力判断依赖假设\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: README/documentation is current enough for a first validation pass.\n- User impact: 假设不成立时，用户拿不到承诺的能力。\n- Suggested check: 将假设转成下游验证清单。\n- Guardrail action: 假设必须转成验证项；没有验证结果前不能写成事实。\n- Evidence: capability.assumptions | github_repo:911256711 | https://github.com/apify/apify-mcp-server | README/documentation is current enough for a first validation pass.\n\n## 13. runtime · 来源证据：chore: Add mixpanel analytics for storage tools + error rates\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chore: Add mixpanel analytics for storage tools + error rates\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_03dbd8daa0c840d690bddb1d52e189c1 | https://github.com/apify/apify-mcp-server/issues/887 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 14. maintenance · 维护活跃度未知\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: 未记录 last_activity_observed。\n- User impact: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- Suggested check: 补 GitHub 最近 commit、release、issue/PR 响应信号。\n- Guardrail action: 维护活跃度未知时，推荐强度不能标为高信任。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | last_activity_observed missing\n\n## 15. security_permissions · 下游验证发现风险项\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 下游已经要求复核，不能在页面中弱化。\n- Suggested check: 进入安全/权限治理复核队列。\n- Guardrail action: 下游风险存在时必须保持 review/recommendation 降级。\n- Evidence: downstream_validation.risk_items | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium\n\n## 16. security_permissions · 存在评分风险\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 风险会影响是否适合普通用户安装。\n- Suggested check: 把风险写入边界卡，并确认是否需要人工复核。\n- Guardrail action: 评分风险必须进入边界卡，不能只作为内部分数。\n- Evidence: risks.scoring_risks | github_repo:911256711 | https://github.com/apify/apify-mcp-server | no_demo; severity=medium\n\n## 17. security_permissions · 来源证据：[Bug]: Inconsistent `search-actors` schema and results\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[Bug]: Inconsistent `search-actors` schema and results\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_364bc036f84b42e8b7be6534cb76381e | https://github.com/apify/apify-mcp-server/issues/889 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 18. security_permissions · 来源证据：design: Calibrate get-dataset-schema output detail\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：design: Calibrate get-dataset-schema output detail\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8b7a4266d8eb4298919b5cb2a58fa420 | https://github.com/apify/apify-mcp-server/issues/882 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 19. security_permissions · 来源证据：refactor: Extract storage tool helpers\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：refactor: Extract storage tool helpers\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_496f0061952341728e4222b961251325 | https://github.com/apify/apify-mcp-server/issues/890 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 20. security_permissions · 来源证据：tools/list response contains `type: \"unknown\"` in an input schema — rejected by ajv-based MCP clients (LibreChat)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：tools/list response contains `type: \"unknown\"` in an input schema — rejected by ajv-based MCP clients (LibreChat)\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_77fae88d35e2486d8125a2ecea9abdc7 | https://github.com/apify/apify-mcp-server/issues/738 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 21. maintenance · issue/PR 响应质量未知\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: issue_or_pr_quality=unknown。\n- User impact: 用户无法判断遇到问题后是否有人维护。\n- Suggested check: 抽样最近 issue/PR，判断是否长期无人处理。\n- Guardrail action: issue/PR 响应未知时，必须提示维护风险。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | issue_or_pr_quality=unknown\n\n## 22. maintenance · 发布节奏不明确\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: release_recency=unknown。\n- User impact: 安装命令和文档可能落后于代码，用户踩坑概率升高。\n- Suggested check: 确认最近 release/tag 和 README 安装命令是否一致。\n- Guardrail action: 发布节奏未知或过期时，安装说明必须标注可能漂移。\n- Evidence: evidence.maintainer_signals | github_repo:911256711 | https://github.com/apify/apify-mcp-server | release_recency=unknown\n",
      "summary": "Identity, installation, configuration, runtime, and safety pitfalls before user trial.",
      "title": "Pitfall Log"
    },
    "prompt_preview": {
      "asset_id": "prompt_preview",
      "filename": "PROMPT_PREVIEW.md",
      "markdown": "# apify-mcp-server - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for apify/apify-mcp-server.\n\nProject:\n- Name: apify-mcp-server\n- Repository: https://github.com/apify/apify-mcp-server\n- Summary: The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.\n- Host target: mcp_host\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. overview: Project Overview. Produce one small intermediate artifact and wait for confirmation.\n2. architecture-details: Core Architecture. Produce one small intermediate artifact and wait for confirmation.\n3. tool-system: Tool System. Produce one small intermediate artifact and wait for confirmation.\n4. actor-tools: Actor Tools. Produce one small intermediate artifact and wait for confirmation.\n5. payments-overview: Agentic Payments System. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/apify/apify-mcp-server\n- https://github.com/apify/apify-mcp-server#readme\n- .claude/skills/bug-triage/SKILL.md\n- .claude/skills/dig/SKILL.md\n- README.md\n- package.json\n- src/const.ts\n- src/mcp/server.ts\n- src/mcp/actors.ts\n- src/mcp/client.ts\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "summary": "不安装项目也能感受能力节奏的安全试用 Prompt。",
      "title": "Prompt Preview / 安装前试用 Prompt"
    },
    "quick_start": {
      "asset_id": "quick_start",
      "filename": "QUICK_START.md",
      "markdown": "# Quick Start\n\nProject: apify/apify-mcp-server\n\n## Official Entry Points\n\n### Node.js / npx · 官方安装入口\n\n```bash\nnpx @apify/actors-mcp-server\n```\n\nSource：https://github.com/apify/apify-mcp-server#readme\n\n## Sources\n\n- repo: https://github.com/apify/apify-mcp-server\n- docs: https://github.com/apify/apify-mcp-server#readme\n",
      "summary": "Entry points extracted from official README or installation documentation.",
      "title": "Quick Start"
    }
  },
  "validation_id": "dval_3c0090282d844cdcb2eaae0b56d117e6"
}
