What Is the Purpose of MCP in the OpenAI Plugin Architecture?

The Model Context Protocol (MCP) standardizes how OpenAI plugins expose structured, discoverable tool calls to LLM-driven agents, enabling schema-validated interactions across REST and GraphQL endpoints.

The Model Context Protocol (MCP) serves as the architectural foundation in the openai/plugins repository, transforming raw API endpoints into AI-friendly tools that agents can discover and invoke with guaranteed JSON schemas. According to the source code, MCP provides a unified protocol that handles everything from OAuth authentication to streaming HTTP transports, allowing plugins like Wix and Vercel to expose consistent interfaces for LLM consumption without requiring raw API keys for every interaction.

Standardizing Tool Definitions with JSON Schemas

At its core, MCP formalizes how plugins describe available operations. In plugins/vercel/skills/ai-sdk/SKILL.md, the protocol defines input and output schemas using JSON Schema conventions that the AI SDK can validate before executing any tool call. This standardization ensures that when an LLM generates a function call, the parameters match the expected structure, reducing hallucination errors and runtime failures.

The protocol acts as a read-only knowledge service, allowing agents to query internal plugin data—such as Vercel projects or Wix site states—through a controlled interface rather than direct database access.

Discovery, Fallback, and Knowledge Services

MCP operates as an intelligent discovery layer that bridges gaps in API coverage. As implemented in plugins/wix/skills/wix-app/SKILL.md, the protocol follows a "check API references first, use MCP only for gaps" policy. When a requested capability exists in reference documentation, the skill uses that definition; otherwise, it falls back to MCP discovery to locate the missing endpoint.

This architecture enables:

  • Selective exposure: Plugins can expose only safe, read-only operations through MCP while keeping destructive operations behind explicit API calls.
  • Dynamic capability detection: Agents query the MCP tool catalogue at runtime to determine available operations.
  • Graceful degradation: When mcpToolExists() returns false, implementations fall back to direct REST calls as shown in the Wix skill's fallback logic.

OAuth and Streaming HTTP Transport

Beyond schema definitions, MCP handles complex infrastructure concerns transparently. The Vercel plugin demonstrates in plugins/vercel/skills/vercel-api/SKILL.md that the MCP client automatically negotiates OAuth for remote MCP servers, eliminating the need for developers to manage token exchange manually.

Transport efficiency is addressed through Streamable HTTP instead of legacy Server-Sent Events (SSE). This streaming-HTTP transport reduces CPU load during long-running read operations, making it suitable for production deployments on serverless platforms like Vercel.

Declaring MCP Servers in Plugin Manifests

Plugins advertise their MCP capabilities through the manifest file located at .codex-plugin/plugin.json. In plugins/wix/.codex-plugin/plugin.json, the manifest includes a dedicated mcp object that declares the server endpoint:

{
  "name": "wix",
  "description": "Build and deploy Wix apps … includes … Wix MCP server for eCommerce, CMS, dashboard extensions",
  "mcp": {
    "server": "https://wix.mcp.example.com"
  }
}

This declaration informs the host that the skill supports tool-calling through MCP without requiring additional wiring or configuration files.

Implementing MCP Calls in Agent Skills

Creating an MCP Client

To consume MCP services, skills instantiate a client using the AI SDK. The Vercel skill in plugins/vercel/skills/ai-sdk/SKILL.md demonstrates the pattern:

import { createMCPClient } from "@ai-sdk/mcp";

const mcp = await createMCPClient({
  baseURL: "https://vercel.mcp.example.com",
  // OAuth is handled automatically
});

/* Example: get a list of Vercel projects */
const { result } = await mcp.call("listProjects", { maxResults: 5 });
console.log(result);

Workflow Integration with Discovery

The Wix plugin showcases MCP integration within automated workflows. According to plugins/wix/skills/wix-app/SKILL.md, skills can discover tools dynamically before invocation:

steps:
  - name: Discover API
    uses: mcp-discover
    with:
      query: "list products"
      maxResults: 5    # ← MCP will return the best‑matching tool

  - name: Call the discovered tool
    uses: mcp-call
    with:
      tool: "{{ discovery.result[0].name }}"
      args:
        siteId: "{{ siteId }}"
        limit: 10

Fallback Patterns for Missing Capabilities

When MCP does not expose a required method, implementations fall back to raw REST calls. The Wix skill implements this pattern to handle edge cases:

// Inside a Wix skill implementation
if (!mcpToolExists("createProduct")) {
  // No MCP entry → fall back to direct REST call
  const resp = await fetch(`https://www.wixapis.com/stores/v1/products`, {
    method: "POST",
    headers: { Authorization: `Bearer ${token}` },
    body: JSON.stringify(productPayload),
  });
  return await resp.json();
}

Summary

  • MCP standardizes tool definitions using JSON schemas that enable AI SDK validation, ensuring LLMs generate correct parameters for plugin operations as defined in plugins/vercel/skills/ai-sdk/SKILL.md.
  • MCP serves as a discovery layer that fills gaps when reference documentation lacks specific API descriptions, following a "MCP only for gaps" policy in skills like Wix.
  • Automatic OAuth and streaming HTTP reduce infrastructure complexity, with the MCP client handling authentication and using Streamable HTTP for efficient long-running reads according to plugins/vercel/skills/vercel-api/SKILL.md.
  • Plugin manifests declare MCP servers via the mcp.server field in .codex-plugin/plugin.json, exposing capabilities without additional wiring.
  • Fallback patterns allow skills to degrade gracefully to direct REST calls when MCP tools are unavailable, maintaining functionality across all scenarios.

Frequently Asked Questions

What does MCP stand for in OpenAI plugins?

MCP stands for Model Context Protocol. It is the standardized protocol that allows plugins to expose structured tool definitions to LLM agents, enabling discoverable and schema-validated API interactions across different services like Vercel and Wix.

How does MCP handle authentication for remote servers?

According to the source code in plugins/vercel/skills/vercel-api/SKILL.md, the MCP client automatically negotiates OAuth for remote MCP servers. Developers do not need to implement manual token exchange flows when connecting to MCP endpoints like those deployed on Vercel.

When should a skill use MCP versus direct API calls?

The Wix plugin demonstrates a discovery-first workflow where skills should check API references first and use MCP only for gaps. If a tool exists in the MCP catalogue, use mcp.call(); otherwise, fall back to direct REST calls when mcpToolExists() returns false or when dealing with destructive operations not exposed through the read-only MCP interface.

What transport protocol does MCP use for communication?

MCP uses Streamable HTTP transport instead of legacy Server-Sent Events (SSE). This reduces CPU load for long-running read operations and is the recommended transport for MCP servers deployed on serverless platforms, as documented in the Vercel plugin skills.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →