---
topic: architecture
author: Crashtech Editorial
published: Nov 17, 2026 · read: 3 min
---

How Pinterest Built a Production MCP Ecosystem: Central Registry and Governance

Discover how Pinterest scales Model Context Protocol servers in production: centralized tool registries, two-layer authentication, and rate limiting.

– –

When the Model Context Protocol (MCP) emerged, individual engineers at Pinterest immediately adopted it. Developers plugged local SQLite or GitHub MCP servers into desktop coding tools like Cursor and Claude Code, boosting personal engineering velocity.

However, moving MCP from individual desktop experimentation into an enterprise platform powering thousands of engineers created massive systemic challenges:

  1. The Shadow Server Explosion: Developers wrote dozens of unvetted, duplicate MCP servers connecting to internal production databases with personal credentials.
  2. Security and Access Governance: If an AI coding agent executes an MCP tool call to query user analytics, how does the system verify that the requesting human possesses legitimate access rights?
  3. Operational Visibility: Central infrastructure teams were blind to tool usage, token costs, latency spikes, and potential data leakage.

To solve these challenges, Pinterest engineered an enterprise-grade Production MCP Ecosystem: a unified architecture featuring a Central Tool Registry, Two-Layer Authentication, and Managed Gateway Infrastructure.


The Chaos of Ungoverned MCP Adoption

Without central governance, enterprise agent adoption quickly degenerates into an unmanageable mesh of unvetted scripts:

[ Engineer A Laptop ] ──(Raw DB Password)──► Production MySQL
[ Engineer B Laptop ] ──(Hardcoded Token)──► Ad Bidding API
[ CI Runner Agent ]   ──(No Audit Trail)──► Internal Jira Cluster

When credentials leak or an agent encounters a bug that hammers a service with a runaway recursive loop, security and operations teams have zero visibility or ability to revoke access.

Pinterest Production MCP Architecture: Scale & Governance


1. The Central MCP Gateway and Tool Registry

Pinterest decoupled agents from backend microservices by introducing an MCP Gateway Service:

  • Central Catalog: All official MCP servers are published to a company-wide registry. The registry enforces schema reviews, automated vulnerability scans, and versioning contracts.
  • Dynamic Policy Routing: When an agent boots, it connects to a single unified gateway URL (mcp.pinterest.internal). The gateway inspects the developer’s permissions and returns only the subset of tools that the developer is authorized to invoke.

2. Two-Layer Authentication

The most critical architectural breakthrough in Pinterest’s ecosystem is Two-Layer Authentication. An MCP tool invocation must establish two distinct cryptographic identities:

  1. The User Identity (Human Principal): The individual developer running the agent (authenticated via Okta SSO and OAuth 2.0 PKCE tokens).
  2. The Agent Runtime Identity (Machine Principal): The specific agent client or CI pipeline (authenticated via SPIFFE/mTLS certificates).
[ Developer Agent ]
       │
       ├── Bearer Token: User Session (Okta OAuth)
       └── Client Certificate: Workstation Identity (mTLS)
       ▼
[ Pinterest MCP Gateway ]
       │ Validates user permissions against LDAP / OPA
       ▼
[ Internal Service Call: User Analytics Svc ]

When an agent invokes query_pin_metrics(pin_id), the backend service evaluates authorization based on the human user’s access control tier. A junior frontend engineer cannot use an AI agent to bypass data access controls that apply to their normal user account.


3. Centralized Auditing, Rate Limiting, and PII Redaction

By routing all agent tool invocations through the central gateway, Pinterest unlocked comprehensive operational governance:

  • Comprehensive Audit Trail: Every tool call, parameter payload, execution latency, and return status is recorded in an immutable security audit log.
  • Automated PII Redaction: The gateway scans outgoing tool responses with regex and entity classifiers, redacting sensitive user information (credit card numbers, email addresses, phone numbers) before returning context to external model APIs.
  • Circuit Breaking and Throttling: If an autonomous agent enters an infinite retry loop, the gateway trips a circuit breaker, protecting downstream backend databases from denial-of-service outages.

Key Lessons for Enterprise AI Platform Teams

  1. Don’t Let MCP Run Wild: Desktop MCP servers connecting directly to internal networks create massive security blind spots. Enforce a gateway proxy early.
  2. Bind Agents to Human Identities: AI agents must inherit the exact authorization boundaries of the human running them; never provision generic god-mode API keys for agents.
  3. Audit Context Payloads: Models do not need raw database dumps. Sanitize and compress context at the gateway layer to protect user privacy and minimize LLM token costs.
Advertisement

/* Comments */