Skip to main content

Model Context Protocol (MCP)

The Model Context Protocol (MCP) provides a standardized way to define, validate, and interact with AI model contexts across the Zopio codebase. It enables seamless communication between different parts of the application and AI models by providing a consistent interface for context management.

Key Features

  • Standardized Resource Format: Consistent structure for all AI context resources
  • Schema Validation: Type-safe validation using Zod schemas
  • Server/Client Architecture: Flexible architecture for hosting and consuming resources
  • Built-in Resource Types: Pre-defined schemas for common resource types (packages, components, APIs, models)
  • Utility Functions: Helper functions for working with MCP resources

Core Components

Protocol

The core protocol implementation provides the foundation for resource validation and creation:

Server

The MCP server hosts resources that can be consumed by clients:

Client

The MCP client consumes resources from servers:

Resource Schemas

MCP provides pre-defined schemas for common resource types:

Package Schema

Component Schema

API Schema

Model Schema

Integration with AI Features

MCP can be integrated with AI features to provide context for AI models:

Installation

Development Guidelines

  1. All resources must implement the Resource interface
  2. Use Zod schemas for validation
  3. Follow the resource-based architecture pattern
  4. Maintain backward compatibility when updating schemas