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:
- MCPServerRef — how a project references an external MCP
server (so an agent can mount its tools).
- 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
alwaysneverfirst_call
MCPServerRef
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Machine name (snake_case) |
| label | string | ✅ | Display label |
| transport | Enum<'stdio' | 'http' | 'websocket'> | ✅ | |
| endpoint | string | ✅ | Command (stdio) or URL (http/websocket) |
| secretRef | string | optional | |
| active | boolean | ✅ |
MCPToolBinding
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| server | string | ✅ | |
| toolName | string | ✅ | |
| aliasAs | string | optional | |
| approval | Enum<'always' | 'never' | 'first_call'> | ✅ |
MCPTransport
Allowed Values
stdiohttpwebsocket