Your Actor should never see my credentials: the security case for MCP connectors
Description and use
The article explains how to use Apify MCP connectors to keep service tokens out of actor code, preventing credential leakage. Connectors store OAuth tokens on the platform; actors receive only a connector ID and communicate with a proxy that enforces least‑privilege tool access. This enables publishing and sharing actors safely.
Problem
Passing service tokens as Actor inputs leaks credentials through logs, shared inputs, and third‑party code.
Outcome
Credentials never leave the platform; Actors can be published, shared, and run untrusted code without credential leakage.
Workflow
- Authorize third‑party service in Apify Console (OAuth)
- Configure Actor input schema to declare required mcpConnector and mcpServers rules
- Run Actor with connector ID instead of raw token
- Actor talks to Apify MCP proxy using APIFY_TOKEN
- Proxy enforces declared tool permissions and returns only allowed tools
Evidence
The practical consequence: you can publish the Actor's source, share its runs, and paste its input JSON into a forum. There is nothing in any of those artifacts worth stealing.
Verified in a real run log. My Actor's schema used the declaration above. When it called list_tools() through the proxy, it saw exactly 7 tools...
- Record date: 2026-09-21T16:30:11.498Z