Skip to content

fix: server card and server.json claim authentication is always required #1170

Description

@marekh19

ℹ️ Maintainers note: there was already discussion about changing the server.json authorization metadata to always required in #1174. The main issues is that the server.json spec does not support setting that authentication is required under some condition and we advertise in the server.json only the main mcp.apify.com URL that currently requires token. The MCP server might not require auth when the ?tools= is specified with tools that do not require auth like docs for example, but that is out of server.json scope currently.

Problem

getServerCard() (src/server_card.ts) emits authentication: { required: true, schemes: ['bearer', 'oauth2'] }. server.json emits remotes[0].headers[0].isRequired: true. Both unconditional — but the server does serve an anonymous surface.

Verified against production, no credentials:

Endpoint initialize tools/list
?tools=search-actors,fetch-actor-details,search-apify-docs,fetch-apify-docs 200 200 — returns those 4 tools
/ (default) 401 invalid_token

Documented too: https://docs.apify.com/integrations/mcp names the 4 tools usable without a token.

Why it matters

Discovery metadata is read before connecting. An agent that trusts required: true prompts for a token before anonymous exploration, or skips the server — friction on exactly the path we want frictionless.

Fix

Auth is conditional on the ?tools param, so neither true nor false is correct on its own. Options:

  • remotes[].headers[].isRequired: false plus a description naming the anonymous toolset (what the old hand-maintained apify.com card did).
  • Per-tool auth annotation.

test/unit/server-card.test.ts here and in the internal repo pins required === true — update alongside.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-aiIssues owned by the AI team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions