cdk project ast parsing and aws service extraction
Parses AWS CDK TypeScript/JavaScript projects by traversing the abstract syntax tree to identify all AWS service constructs instantiated in the infrastructure code. Uses static analysis rather than runtime execution to extract service declarations, construct parameters, and resource configurations without requiring deployment or AWS credentials. Maps CDK construct hierarchy to concrete AWS service types (EC2, Lambda, RDS, etc.) for downstream cost analysis.
Unique: Implements MCP-native CDK analysis server that integrates directly with the Model Context Protocol transport layer, allowing AI assistants to query CDK projects without separate CLI invocations. Uses TypeScript compiler API for accurate construct resolution rather than regex-based pattern matching.
vs alternatives: Provides real-time CDK analysis through MCP protocol integration, enabling AI-assisted cost exploration in chat interfaces, whereas standalone CDK cost plugins require manual CLI execution and lack bidirectional AI context.
aws pricing data aggregation from multiple sources
Fetches and normalizes AWS pricing information from both AWS Pricing API (bulk JSON pricing data) and AWS pricing webpages (HTML scraping for real-time rates). Maintains a unified pricing schema that maps service names, instance types, regions, and pricing dimensions to current rates. Handles pricing updates and regional variations by querying authoritative AWS sources and caching results to minimize API calls.
Unique: Implements dual-source pricing aggregation (AWS Pricing API + HTML scraping) within MCP server architecture, allowing clients to request pricing without managing API credentials or scraping logic. Normalizes heterogeneous pricing data formats into unified schema for cost calculation.
vs alternatives: Combines official AWS Pricing API with fallback web scraping for resilience, whereas standalone pricing tools often rely on single source; MCP integration allows AI assistants to query pricing in real-time during cost analysis conversations.
service-to-pricing-dimension mapping and cost calculation
Maps extracted CDK services to their corresponding AWS pricing dimensions (compute hours, storage GB, data transfer, API calls, etc.) and calculates estimated monthly costs based on resource configurations. Implements service-specific pricing logic (e.g., Lambda pricing by invocations + memory-duration, EC2 by instance-hours + data transfer) and aggregates costs across all services in a stack. Handles regional pricing variations and pricing model selection (on-demand vs reserved vs spot).
Unique: Implements service-specific pricing calculators as pluggable modules within MCP server, allowing extensibility for new AWS services without modifying core logic. Maps CDK construct parameters directly to pricing dimensions, enabling accurate cost estimates from infrastructure code.
vs alternatives: Provides service-aware cost calculation (not just raw pricing lookup) integrated into MCP protocol, enabling AI assistants to reason about cost trade-offs during infrastructure design, whereas AWS Cost Explorer requires deployed resources and historical data.
mcp tool interface for cost analysis queries
Exposes cost analysis capabilities as MCP tools (function definitions) that AI assistants can call via the Model Context Protocol. Defines tool schemas for analyzing CDK projects, retrieving pricing, and calculating costs, with structured input/output contracts. Handles tool invocation from MCP clients, executes analysis pipelines, and returns results in MCP-compliant JSON format. Enables bidirectional context flow where AI assistants can iteratively refine cost analysis based on conversation context.
Unique: Implements MCP server architecture that exposes cost analysis as standardized tools, enabling any MCP-compatible AI assistant to invoke analysis without custom integrations. Uses MCP's resource and tool schemas to define precise contracts for cost analysis queries.
vs alternatives: Native MCP integration allows seamless cost analysis in AI chat interfaces without plugins or API wrappers, whereas AWS Cost Explorer and third-party tools require separate UI navigation and manual data entry.
cdk project file discovery and validation
Automatically discovers CDK project structure by scanning for cdk.json configuration files, tsconfig.json, and stack definition files. Validates project structure against CDK conventions (lib/ directory for constructs, bin/ for entry points) and checks for required dependencies (aws-cdk-lib, constructs). Provides error reporting for misconfigured projects and suggests fixes. Handles monorepo structures with multiple CDK projects.
Unique: Implements convention-based project discovery that recognizes CDK project patterns without requiring explicit configuration, reducing setup friction for users. Provides structured validation errors that guide users toward correct project structure.
vs alternatives: Automatic CDK project detection within MCP server eliminates need for users to manually specify project paths or configurations, whereas standalone tools often require explicit project configuration.
cost analysis result caching and invalidation
Caches cost analysis results (service inventory, pricing data, cost calculations) with configurable TTL to avoid redundant computation and API calls. Implements cache invalidation strategies: TTL-based expiration for pricing data (updates hourly), file-based invalidation when CDK source files change, and manual cache clearing. Tracks cache hit/miss rates and provides cache statistics for performance monitoring.
Unique: Implements multi-layer caching strategy (service inventory cache, pricing cache, cost calculation cache) with independent TTLs and invalidation triggers, optimizing for both freshness and performance. File-based invalidation detects CDK code changes without explicit cache clearing.
vs alternatives: Intelligent cache invalidation based on file changes and configurable TTLs provides better freshness guarantees than simple time-based caching, while reducing API calls compared to always-fresh pricing lookups.
cost sensitivity analysis and what-if scenarios
Calculates cost sensitivity to resource parameter changes (e.g., 'what if I double the Lambda memory?' or 'what if I use reserved instances?'). Implements parameterized cost calculations that accept modified resource configurations and compute delta costs. Supports scenario comparison (on-demand vs reserved vs spot pricing) and identifies cost-driving resources. Enables AI assistants to reason about cost trade-offs during infrastructure design.
Unique: Implements parameterized cost calculation engine that accepts resource modifications and computes delta costs, enabling exploratory cost analysis without re-parsing CDK code. Integrates with AI assistant reasoning to support natural-language what-if queries.
vs alternatives: Enables interactive cost exploration through AI conversations (e.g., 'what if I use t3.large instead of t3.xlarge?'), whereas AWS Cost Explorer requires deployed resources and historical data, and standalone cost calculators lack AI-driven reasoning.
multi-region cost comparison and optimization recommendations
Analyzes cost differences across AWS regions for the same CDK infrastructure by querying regional pricing variations. Identifies regions with lowest cost and highlights services with significant regional price differences. Generates optimization recommendations (e.g., 'move RDS to us-east-1 to save 15%'). Handles region-specific service availability (some services not available in all regions).
Unique: Implements regional cost comparison by querying pricing data for all specified regions and computing cost deltas, enabling region selection optimization. Integrates service availability checks to warn about region-specific limitations.
vs alternatives: Provides automated regional cost comparison integrated into cost analysis workflow, whereas AWS Pricing API requires manual region-by-region queries and AWS Cost Explorer cannot analyze hypothetical multi-region deployments.
+1 more capabilities