ObjectStackObjectStack

Mcp

Mcp protocol schemas

Model Context Protocol (MCP) — Reference & Binding Primitives

MCP itself is an external protocol defined by Anthropic

(https://modelcontextprotocol.io). The platform does NOT re-define

MCP's wire format, transport, or message shapes — that is the job

of the @modelcontextprotocol/sdk consumed by plugin-mcp-server.

This file defines only the two things the platform needs:

  1. MCPServerRef — how a project references an external MCP

server (so an agent can mount its tools).

  1. MCPToolBinding — how an MCP tool from a referenced server

is exposed as an ObjectStack AIToolDefinition (alias,

visibility, approval policy).

Everything else (transport details, capability negotiation,

resource/prompt shapes, streaming, sampling) is handled by the SDK

at runtime and does not need a metadata representation.

Source: packages/spec/src/ai/mcp.zod.ts

TypeScript Usage

import { MCPApprovalPolicy, MCPServerRef, MCPToolBinding, MCPTransport } from '@objectstack/spec/ai';
import type { MCPApprovalPolicy, MCPServerRef, MCPToolBinding, MCPTransport } from '@objectstack/spec/ai';

// Validate data
const result = MCPApprovalPolicy.parse(data);

MCPApprovalPolicy

Allowed Values

  • always
  • never
  • first_call

MCPServerRef

Properties

PropertyTypeRequiredDescription
namestringMachine name (snake_case)
labelstringDisplay label
transportEnum<'stdio' | 'http' | 'websocket'>
endpointstringCommand (stdio) or URL (http/websocket)
secretRefstringoptional
activeboolean

MCPToolBinding

Properties

PropertyTypeRequiredDescription
serverstring
toolNamestring
aliasAsstringoptional
approvalEnum<'always' | 'never' | 'first_call'>

MCPTransport

Allowed Values

  • stdio
  • http
  • websocket

On this page