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
- All resources must implement the
Resource
interface - Use Zod schemas for validation
- Follow the resource-based architecture pattern
- Maintain backward compatibility when updating schemas