@postmcp/types
v0.1.37
Published
Unified TypeScript types and interfaces for the PostMCP ecosystem
Maintainers
Readme
@postmcp/types
PostMCP Shared Types - Unified TypeScript definitions and interfaces for the PostMCP ecosystem.
Overview
@postmcp/types contains shared type definitions, interfaces, and enums used across all PostMCP packages (@postmcp/core, @postmcp/cli, @postmcp/presets, and @postmcp/studio).
Installation
npm install -D @postmcp/types
# or
pnpm add -D @postmcp/typesCore Types Exported
1. AST & Operation Definitions
NormalizedSpec: The parsed OpenAPI representation containing title, version, servers, and operations.NormalizedOperation: Standardized operation definition with JSON Schema input/response schemas and risk tier.RiskTier:'READ_ONLY' | 'MUTATION' | 'CRITICAL'.
2. Token Diet & Optimization
TokenDietOptions: Configuration for null pruning, field masking, and Markdown table conversion.TokenDietResult: Output containing text, structured payload, token counts, and savings percentage.
3. Macro Pipelines
MacroDefinition: Composite multi-step tool definition.MacroStep: Individual execution step in a macro workflow.
4. Configuration & CLI
PostMcpCliConfig: Structure ofpostmcp.config.jsonworkspace configuration files.RunCommandOptions: Options forpostmcp run.StudioCommandOptions: Options forpostmcp studio.GenerateCommandOptions: Options forpostmcp generate.ExportCommandOptions: Options forpostmcp export.
Usage Example
import type { NormalizedSpec, RiskTier, TokenDietOptions } from '@postmcp/types';
function analyzeSafety(tier: RiskTier): boolean {
return tier === 'READ_ONLY';
}
const options: TokenDietOptions = {
convertToMarkdownTable: true,
maxTokens: 2500,
};License
MIT (c) PostMCP Contributors
