Core utilities and types for the Context-Pods MCP (Model Context Protocol) development suite.
npm install @context-pods/core
- Error Handling: Custom error classes for different failure scenarios
- Logging: Simple, configurable logger with multiple log levels
- Type Definitions: TypeScript types for pods, templates, and MCP components
- Schema Validation: Zod schemas for validating configurations and manifests
import { ConfigurationError, TemplateError } from '@context-pods/core';
// Throw a configuration error
throw new ConfigurationError('Invalid pod name', { name: 'my pod' });
// Throw a template error
throw new TemplateError('Template not found', { template: 'unknown' });
import { Logger, LogLevel } from '@context-pods/core';
// Create a logger
const logger = new Logger({
level: LogLevel.DEBUG,
prefix: '[MyPod]',
});
// Log messages
logger.debug('Debug message');
logger.info('Info message');
logger.warn('Warning message');
logger.error('Error message');
// Create a child logger
const childLogger = logger.child('Component');
childLogger.info('From child logger');
import { PodConfigSchema } from '@context-pods/core';
// Validate pod configuration
const config = {
name: 'my-pod',
description: 'My awesome pod',
template: 'basic',
};
const result = PodConfigSchema.safeParse(config);
if (result.success) {
console.log('Valid configuration:', result.data);
} else {
console.error('Invalid configuration:', result.error);
}
See the TypeScript definitions for detailed API documentation.
-
Error Classes:
ConfigurationError
,TemplateError
,ValidationError
- Logger: Configurable logging with multiple levels
-
Schemas: Zod schemas for validation (
PodConfigSchema
,TemplateManifestSchema
, etc.) - Types: TypeScript types for all MCP components
- Template Engine: Template processing and variable substitution
- Template Selector: Intelligent template selection based on context
-
@context-pods/cli
- Command-line interface -
@context-pods/create
- npx runner for quick starts -
@context-pods/server
- MCP server implementation -
@context-pods/testing
- Testing framework
MIT