Skip to content

Latest commit

 

History

History
103 lines (62 loc) · 2.29 KB

File metadata and controls

103 lines (62 loc) · 2.29 KB
title Mcp
description Mcp protocol schemas

{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}

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 @objectstack/mcp.

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

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

  • stdio
  • http
  • websocket