mcp — Engineering Performance
9 engineers all time · Mar 2025 – Sep 2026 · built 2026-09-10 · GitHub
Performance snapshot
Today's rolling 90-day reading for mcp, compared with the start of the series. Pick a window to move that comparison point.
Avg. perf / dev / mo
+11.3%
1.42 → 1.58 ETV
Active engineers
+20.0%
5.0 → 6.0
Features
+1.8pp
15.1% → 16.9%
vs. AWS
1.9x
3.4x → 1.9x · +90% above
mcp vs. AWS
Per-engineer ETV for mcp against AWS as a whole. Both lines are 90-day rolling averages scaled to a 30-day month, so they share one axis and can be read against each other at any point. Pick a window to zoom the chart to it.
Performance Composition
Each month's output split by type of work: Features (new value), Maintenance (sustaining systems), Tests, Docs, and Fixes (rework). The yellow line is output per engineer, so when it rises each engineer is delivering more, whatever the team size did. Unit: Engineering Throughput Value (ETV).
Engineering capacity
Effective engineers behind mcp, against its pre-AI baseline. Each subject has its own: mcp's is 1.42 ETV / dev / mo, its first reading in Q2 2025. Per-engineer ETV divided by that gives a capacity multiple, and that multiple applied to the engineers active in the trailing 90 days turns it into engineer-equivalents. The line is the real headcount, so the gap between line and area is what the leverage is worth. Because each baseline is its own, every subject opens at 1.0x on its first day: multiples measure improvement and are not comparable between subjects.
Knowledge concentration
How dependent is this repo on a small number of engineers? Higher top-1 share = higher key-person risk.
Scott Schreckengaust owns 49.6 % of commits.
Behind the numbers
Written summary of the work completed each month.
No monthly reports available yet.
Top engineers
Most impactful commits
Top 10 by ETV in the all-time window.
- 16.5ETVfeat(healthomics): remote transport & multi-tenant credentials (#4269) * feat(transport): add HTTP/SSE transport selection and credential-resolution seam (Phase 1) Phase 1 of remote-transport-multi-tenant. Purely additive: with no new configuration the server behaves exactly as today (stdio + default credential chain + identical tool signatures). - Transport selection (stdio/streamable-http/sse) via CLI flags and env vars with CLI-over-env precedence and case-sensitive normalization. - Network bind configuration (host/port/path) with loopback defaults (127.0.0.1:8000/mcp) and host/port validation. - Secure-by-default: single warning before binding to a non-loopback host; no inbound auth performed in Phase 1. - CredentialResolver seam + DefaultCredentialResolver in utils/aws_utils.py; all tool sessions/clients routed through the active resolver. - Docs (README) and Dockerfile network transport support via env vars. - Property and unit tests for config, transport, exposure, credential seam routing, resolution failure, and tool-surface preservation. * feat(multi-tenant): add request-scoped credential resolution, identity middleware, and inbound mechanisms (Phase 2) Adds Phase 2 multi-tenant credential resolution on the Phase 1 seam: - RequestScopedCredentialResolver deriving fresh per-request credentials from a contextvars-carried CredentialContext (no fallback, no process-level reuse) - ASGI IdentityMiddleware that sets/resets the context around dispatch and rejects unauthenticated requests with 401 before any tool or AWS call - Inbound mechanisms with deterministic precedence sigv4 > jwt > explicit: forwarded-SigV4, JWT-to-STS AssumeRole with ABAC session tags, explicit headers - Multi-tenant config parsing (--multi-tenant/--inbound-auth), incompatible with stdio; fail-closed startup guard when no mechanism is enabled - Per-identity, bounded partition cache keyed by (identity_key, region) - Credential material never logged (redacted CredentialContext repr) Review hardening: bounded partition cache; pyright-visible get_partition.cache_clear via a callable Protocol; startup rejection of multi-tenant with zero mechanisms. Docs: README multi-tenant section and CHANGELOG entry. * feat(healthomics): add multi-tenant identity resolution with JWT and SigV4 support (Phase 3) - Add role resolver mechanism with static and DynamoDB registry sources for per-request credential resolution - Implement JWT exchange mechanism with external ID enforcement and backward compatibility - Add multi-tenant server wiring with request-scoped credential isolation and identity propagation - Introduce inbound authentication mechanisms (SigV4, JWT, explicit) with fixed precedence ordering - Add comprehensive security property tests covering tenant isolation, secret leakage prevention, freshness validation, and registry consistency - Update MCP_INSPECTOR_SETUP.md with transport modes and multi-tenant configuration documentation - Add conftest fixtures for multi-tenant test infrastructure and DynamoDB mock registry - Validate credential material is never logged and request identities are properly propagated across AWS service calls * docs(healthomics): clarify multi-tenant security model and fronting layer requirements - Expand security documentation to clarify that multi-tenant mode adds per-request identity without changing inbound authentication responsibility - Explain that the server trusts forwarded credentials and does not validate SigV4 signatures or verify JWT signatures cryptographically - Clarify the difference between non-loopback binding (expected in orchestrated deployments) and unsafe unauthenticated exposure - Document that non-loopback binding requires external access control at the fronting layer, not within the server process - Update AgentCore Runtime references to remove "(Phase 2)" notation and reflect production-ready multi-tenant support - Refactor role resolver to implement deterministic precedence order for inbound mechanisms (sigv4 > jwt > explicit) - Add detailed precedence documentation for mechanism selection when multiple are enabled - Clarify that SigV4 mechanism requires trusted headers forwarded by fronting layer and fails closed if absent - Document JWT mechanism expectations around token exchange, role assumption, and fronting layer signature verification responsibility * feat(integration): add remote-deployment integration test harness * fix(pricing): build pricing client per request for multi-tenant isolation PricingCache cached the AWS Pricing client on the class, so in multi-tenant mode the first cost-analysis caller's request-scoped credentials were frozen into the client and reused for every subsequent caller -- violating the documented per-request credential isolation guarantee ('no process-level or prior-request session is ever reused'). Build the pricing client per call instead (it is only built on a price cache miss). The public, non-tenant-specific price *values* remain cached, so overhead is negligible while each request's AWS calls stay scoped to that request's identity. Remove the now-unused _pricing_client class attribute and the test lines that reset it. Also correct integration/README.md: AgentCore container port 8080 -> 8000 (the fixed MCP port), document the injected server env accurately (MCP_INBOUND_AUTH jwt|explicit, injected AWS_REGION, and the entrypoint's stateless/DNS-rebinding/ header-forwarding adaptations), and clarify the sts:AssumeRole/TagSession IAM row for jwt vs --inbound explicit. * docs(changelog): release pending items as v0.0.41; add remote MCP integration harness as Unreleased * security(integration): keep provisioning capability out of deployed artifacts The integration harness can create AWS infra and shells out via subprocess, so it must never be reachable from a deployed MCP server. Harden isolation: - Slim the harness AgentCore image: copy only the runtime entrypoint and shared header constants into the container, not the deploy/ provisioning modules (agentcore, apigateway, cli, iam, cognito, registry, common) or the test suites. A compromise of the running server can no longer reach infra-provisioning code. - Add a fail-closed opt-in guard to the deploy CLI: provision/teardown/e2e refuse to run unless RUN_REMOTE_INTEGRATION_TESTS is truthy, so provisioning cannot be triggered incidentally by an automated or compromised context. - Add an offline regression test asserting the image Dockerfile never bundles the provisioning/test modules and the entrypoint imports only integration.harness.headers. - Document the isolation posture and the CLI opt-in requirement in the README. Note: the published wheel already excludes integration/ (packages=['awslabs']) and the production ./Dockerfile ships only the installed venv, so pip/uvx and the production image were already free of the harness; this closes the test-image and source-run gaps. * ci: exclude integration test artifacts from Trivy and Bandit - Skip integration/ Dockerfiles in Trivy workflow (not needed in CI) - Add integration/ to bandit exclude_dirs to prevent false positives from deployment/provisioning code breaking the build * test: add edge-case tests for transport, mechanisms, and multi-tenant config Cover previously uncovered branches in PR-changed source files: - transport.py: normalize whitespace-only, select None/valid mode - mechanisms/explicit.py: malformed header decode exception path - mechanisms/jwt_exchange.py: STS client creation, malformed token claims - mechanisms/role_resolver.py: parse_registry_source edge cases, DynamoDB client - config.py: hostname validation edges, multi-tenant invalid value, inbound mechanisms - utils/aws_utils.py: FieldInfo coercion, partition cache hit/miss/eviction, client wrappers * test: stop tests reaching real AWS, narrow tool-surface guard Fix an effective hang in the test suite. generate_run_timeline and the run-analysis manifest parsers compute per-task cost, which reaches PricingCache.get_price -> _fetch_price_from_api and issued a real AWS Pricing API request. The autouse mock_environment fixture supplies dummy credentials, so resolution succeeded and the call proceeded to the network rather than failing fast. get_price caches only successful lookups, so a failed fetch was retried for every task, and the property-based timeline tests generate up to 500 tasks per Hypothesis example. Add an opt-in stub_pricing_lookup fixture in conftest.py and apply it to the affected modules. get_price is the single seam every network-bound pricing path funnels through, so stubbing it keeps the real cost arithmetic exercised while guaranteeing no AWS call leaves the process. Kept opt-in so test_pricing_cache.py and test_cost_analyzer.py retain control of PricingCache. Also stub get_run_manifest_logs_internal in two troubleshooting tests that left it unmocked and passed only because the real CloudWatch Logs call failed and degraded gracefully. Replace the frozen tool-surface snapshot with assertions on the invariant the credential-resolver seam could actually break: every AWS-calling tool exposes aws_profile and aws_region as optional nullable strings defaulting to None, never required, with the set of static/local tools lacking them asserted exactly. The 3818-line baseline compared full equality, so it failed on any unrelated tool change anywhere in the server (it broke on the workflow_type filter added upstream for Ready2Run discovery). Measured with AWS_ENDPOINT_URL=http://127.0.0.1:1 to prove isolation: - test_run_timeline_output.py: did not finish in 600s -> 46 tests in 1.5s - full suite: 107.67s -> 57.11s, slowest test 29.58s -> 2.00s * fix(test): resolve pyright errors in transport/multi-tenant edge tests CI runs pyright over the package and reported 12 errors in this file. Fixes, none of which reduce branch coverage (still 98% on the PR-changed sources): - Drop the two tests passing None to parameters typed str (ServerConfig.transport and _is_valid_hostname). Both were outside the declared contract; the empty and whitespace-only cases already exercise the same branches, and normalize(None) is still covered directly since it accepts Optional[str]. - Use a real pydantic FieldInfo via Field(default=None) instead of a bare object() for the FastMCP coercion tests. Field() is annotated as returning Any so it type-checks, and it is what the defensive coercion actually guards against. - Remove the redundant mock.__class__ assignments. MagicMock(spec=...) already satisfies the isinstance() check that _get_partition branches on. - Replace set_credential_context(None) with the real token-based API: reset_credential_context(token) for teardown, and _credential_context.set(None) where the test needs to assert the no-identity precondition explicitly. Verified locally: pyright 0 errors across the package, ruff check/format clean, bandit medium/high 0, full suite 2794 passed offline. * fix(healthomics): rename integration Dockerfile to avoid touching trivy.yml Renaming integration/deploy/image/Dockerfile to mcp.Dockerfile means the trivy workflow's `find . -name Dockerfile` no longer matches it, so the integration harness image is naturally excluded from Dockerfile-detection without editing .github/workflows/trivy.yml. That keeps this PR from touching a workflow file, which otherwise requires a maintainer to re-approve CI on every push. * fix(healthomics): port transport/multi-tenant serving and the integration harness to mcp SDK v2 main's mcp SDK v2 migration (#4452) moved host/port/streamable_http_path/sse_path off FastMCP.settings and onto run()/streamable_http_app()/sse_app() keyword arguments, renamed FastMCP -> MCPServer, and renamed a few other v1 names this branch's new code depended on before the merge conflict in server.py could be resolved cleanly: - transport.py: TransportSelector no longer mutates mcp.settings; it passes host/port/path straight through as mcp.run() keyword arguments. - server.py: _run_multi_tenant calls streamable_http_app()/sse_app() with host/path kwargs instead of mutating settings; _serve_asgi_app takes the resolved config for host/port (log_level is still read from mcp.settings, which v2 keeps). - tests/test_transport.py, tests/test_transport_exposure.py, tests/test_server_multitenant_wiring.py: updated to assert against the new run()/streamable_http_app()/sse_app() call kwargs instead of settings attributes. - tests/test_tool_surface.py: tool.inputSchema -> tool.input_schema (v2 alias-read asymmetry, same class of fix the mainline migration applied elsewhere). - integration/deploy/image/entrypoint.py: stateless_http/transport_security also moved off settings in v2; replaced the settings-mutation harness glue with a wrapper around mcp.streamable_http_app()/sse_app() that injects them as defaults (covers both the single-tenant mcp.run() path and the multi-tenant direct-call path without touching server-package source). - integration/harness/mcp_client.py: mcp.client.streamable_http.streamablehttp_client -> streamable_http_client, which now takes an httpx2.AsyncClient (for headers/timeout) instead of headers=/timeout= kwargs, and yields a 2-tuple instead of a 3-tuple. - integration/tests/test_unauthenticated_rejected.py: httpx -> httpx2 (v1's httpx is no longer a transitive dependency under mcp[cli]>=2.0.0). tests/ (2794 passed), integration/harness_tests/ (150 passed, offline), ruff, and pyright are all clean on the merged tree.Mark Schreiber · f6f1a566 · 2026-08-31
- 14.2ETVfeat(aws-healthomics-mcp): genomics file search (#1501) * feat: add core data models for genomics file search - Add GenomicsFileType enum with comprehensive file format support - Implement GenomicsFile, GenomicsFileResult, and FileGroup dataclasses - Add SearchConfig and request/response models for API integration - Support for sequence, alignment, variant, annotation, and index files - Include BWA index collections and various genomics file formats Addresses requirements 7.1-7.6 and 5.1-5.2 * feat(search): implement pattern matching and scoring engine - Add PatternMatcher class with exact, substring, and fuzzy matching algorithms - Add ScoringEngine with weighted scoring based on pattern match quality, file type relevance, associated files, and storage accessibility - Support matching against file paths and tags with configurable weights - Implement FASTQ pair detection with R1/R2 pattern matching - Apply storage accessibility penalties for archived files (Glacier, Deep Archive) - Include comprehensive scoring explanations for transparency Addresses requirements 1.2, 1.3, 2.1-2.4, and 3.5 from genomics file search spec * feat: implement file association detection system - Add FileAssociationEngine with genomics-specific patterns for BAM/BAI, FASTQ pairs, FASTA indexes, and BWA collections - Add FileTypeDetector with comprehensive extension mapping for all genomics file types including compressed variants - Support file grouping logic based on naming conventions (R1/R2, _1/_2, etc.) - Include score bonus calculation for files with associations - Handle BWA index collections as grouped file sets - Add file type filtering and category classification - Update search module exports to include new classes Implements requirements 3.1-3.5 and 7.1-7.6 from genomics file search specification * feat: implement S3 search engine with configuration management - Add S3SearchEngine class with async bucket scanning capabilities - Implement S3 object listing with prefix filtering and pagination - Add tag-based filtering for S3 objects with pattern matching - Extract comprehensive file metadata (size, storage class, last modified) - Add environment-based configuration management for S3 bucket paths - Implement bucket access validation with proper error handling - Support concurrent searches with configurable limits BREAKING CHANGE: New environment variables required for S3 search: - GENOMICS_SEARCH_S3_BUCKETS: comma-separated S3 bucket paths - GENOMICS_SEARCH_MAX_CONCURRENT: max concurrent searches (optional) - GENOMICS_SEARCH_TIMEOUT_SECONDS: search timeout (optional) - GENOMICS_SEARCH_ENABLE_HEALTHOMICS: enable HealthOmics search (optional) refactor: consolidate S3 utilities and eliminate code duplication - Move S3 path parsing and validation to s3_utils.py - Enhance validate_s3_uri() with comprehensive bucket name validation - Remove duplicate S3 validation logic from config_utils.py - Improve separation of concerns across utility modules * feat:(search) adds a search interface to the healthomics sequence and reference stores * feat(genomics-search): implement search orchestrator and MCP tool handler - Add GenomicsSearchOrchestrator class for coordinating parallel searches across S3 and HealthOmics - Implement search_genomics_files MCP tool with comprehensive parameter validation - Add get_supported_file_types helper tool for file type information - Integrate genomics file search tools into MCP server registration - Support parallel searches with timeout protection and error handling - Implement result deduplication, file association, and relevance scoring - Add structured JSON responses with metadata and search statistics Resolves requirements 1.1, 2.2, 3.4, 5.1, 5.2, 5.3, 5.4, 6.2, 6.3 * feat(search): adds result ranking and response assembly * docs: add genomics file search capabilities to README and CHANGELOG - Add comprehensive documentation for new SearchGenomicsFiles tool - Document multi-storage search across S3, HealthOmics sequence/reference stores - Include pattern matching, file association, and relevance scoring features - Add configuration instructions for GENOMICS_SEARCH_S3_BUCKETS environment variable - Update IAM permissions for S3 and HealthOmics read access - Add usage examples for common genomics file discovery scenarios - Update all MCP client configuration examples with new environment variable * Fix SearchGenomicsFiles tool: regex patterns, S3 client calls, and file associations - Fixed regex patterns in file_association_engine.py: * Removed invalid $ symbols from replacement patterns * Fixed backreference syntax for file association matching * Patterns now correctly associate BAM/BAI, CRAM/CRAI, FASTQ pairs, etc. - Fixed S3 client method calls in s3_search_engine.py: * Fixed head_bucket() call to use proper keyword arguments * Fixed list_objects_v2() call to use **params expansion * Fixed get_object_tagging() call to use lambda wrapper * All boto3 calls now work correctly with run_in_executor - Fixed pattern matching in S3 search: * Updated _matches_search_terms to use correct PatternMatcher methods * Changed from non-existent calculate_*_score to match_file_path/match_tags * Search terms now properly match against file paths and tags - Fixed logger.level comparison error in result_ranker.py: * Removed invalid comparison between method object and integer * Simplified debug logging to let logger.debug handle level filtering - Added enhanced_response field to GenomicsFileSearchResponse model: * Fixed Pydantic model to allow enhanced_response attribute * Updated orchestrator to pass enhanced_response in constructor - Optimized file type filtering for associations: * Added smart filtering to include related index files (CRAI for CRAM, etc.) * Maintains performance while enabling proper file associations * Added _is_related_index_file method to determine file relationships - Added comprehensive MCP Inspector setup documentation: * Complete guide for running MCP Inspector with HealthOmics server * Multiple setup methods (source code, published package, config file) * Environment variable configuration and troubleshooting guide The SearchGenomicsFiles tool now successfully: - Searches S3 buckets for genomics files - Associates primary files with their index files (CRAM + CRAI, BAM + BAI, etc.) - Returns properly structured results with relevance scoring - Handles file type filtering while preserving associations * perf(s3-search): optimize S3 API calls with lazy loading, caching, and batching - Implement lazy tag loading to only retrieve S3 object tags when needed for pattern matching - Add batch tag retrieval with configurable batch sizes and parallel processing - Implement smart filtering strategy with multi-phase approach (list → filter → batch → convert) - Add configurable result caching with TTL to eliminate repeated S3 calls - Add tag-level caching to avoid duplicate tag retrievals across searches - Add configuration option to disable S3 tag search entirely - Reduce S3 API calls by 60-90% for typical genomics file searches - Improve search performance by 5-10x through intelligent caching and batching - Add comprehensive configuration options for performance tuning BREAKING CHANGE: None - all optimizations are backward compatible with existing configurations * Fix genomics file search for HealthOmics reference stores This commit addresses multiple issues with the genomics file search tool when searching HealthOmics reference stores: ## Issues Fixed: 1. **Missing Server-Side Filtering** - Added hybrid server-side + client-side filtering strategy - Uses AWS HealthOmics ListReferences API filter parameter - Falls back to client-side pattern matching when needed 2. **Incorrect boto3 Parameter Passing** - Fixed 'only accepts keyword arguments' errors - Updated all boto3 calls to use proper keyword argument unpacking 3. **Incorrect URI Format** - Replaced S3 access point URIs with proper HealthOmics URIs - Format: omics://account_id.storage.region.amazonaws.com/store_id/reference/ref_id/source 4. **Missing Associated Index Files** - Enhanced file association engine to detect HealthOmics reference/index pairs - Automatically groups reference source files with their index files - Improves relevance scores due to complete file set bonus 5. **Poor Pattern Matching and Scoring** - Enhanced scoring engine to check metadata fields for pattern matches - Exact name matches in metadata now receive high relevance scores - Removed unwanted # characters from file paths 6. **Incorrect File Sizes** - Added GetReferenceMetadata API calls to retrieve actual file sizes - Shows accurate sizes for both source and index files - Graceful error handling if metadata retrieval fails ## Files Modified: - healthomics_search_engine.py: Core search logic, URI generation, file sizes - file_association_engine.py: HealthOmics-specific file associations - genomics_search_orchestrator.py: Extract HealthOmics associated files - scoring_engine.py: Enhanced pattern matching with metadata - aws_utils.py: Added get_account_id() function ## Expected Results: - Efficient server-side filtering with client-side fallback - Proper HealthOmics URIs in results - Associated index files grouped with reference files - Accurate file sizes (e.g., 3.2 GB source, 160 KB index) - High relevance scores for exact name matches - Improved search performance and accuracy * feat(search): enhance HealthOmics sequence and reference store search functionality - Fix file type detection to properly map BAM, CRAM, and UBAM file types - Add enhanced metadata retrieval using get-read-set-metadata API for accurate file sizes and S3 URIs - Implement tag support using list-tags-for-resource API for both read sets and references - Expand searchable fields to include sequence store names and descriptions - Add status filtering to exclude non-ACTIVE resources (UPLOAD_FAILED, DELETING, DELETED) - Enhance file association engine to automatically include BAM/CRAM index files as associated files - Add multi-source read set support for paired-end FASTQ files (source1, source2, etc.) - Improve search term matching to report all matching terms instead of just the best match - Add comprehensive metadata inheritance for all associated files These improvements provide accurate file type filtering, complete metadata, proper file associations, and comprehensive search results for genomics workflows. * feat: performance improvements and minor fixes * feat: implement efficient storage-level pagination for genomics file search - Add pagination foundation models (StoragePaginationRequest, StoragePaginationResponse, GlobalContinuationToken) - Implement S3 storage-level pagination with native continuation tokens and buffer management - Add HealthOmics pagination for sequence/reference stores with rate limiting and API batching - Update search orchestrator for coordinated multi-storage pagination with ranking-aware results - Add performance optimizations including cursor-based pagination, caching strategies, and metrics - Support configurable buffer sizes and automatic optimization based on search complexity - Maintain backward compatibility with offset-based pagination - Add comprehensive pagination metrics and monitoring capabilities Closes task 8 and all subtasks (8.1-8.5) from genomics-file-search specification * fix: correct the associate of bwa files and fix pyright type errors * feat(tests): implement comprehensive testing framework with MCP Field annotation support - Add MCPToolTestWrapper utility to handle MCP Field annotations in tests - Create working integration tests for genomics file search functionality - Fix constants test expectations (DEFAULT_MAX_RESULTS: 10 -> 100) - Add comprehensive test documentation and quick reference guides - Implement test utilities for pattern matching, pagination, and scoring - Add genomics test data fixtures and integration framework - Remove broken integration test files and replace with working versions - Achieve 532 passing tests with 100% success rate BREAKING CHANGE: Integration tests now require MCPToolTestWrapper for MCP tool testing Resolves Field annotation issues that caused FieldInfo object errors in tests. Provides complete testing framework documentation and best practices. * fix(tests): repair healthomics search engine tests - Fix SearchConfig parameters to match updated model definition - Fix GenomicsFile constructor parameters (remove size_human_readable, file_info) - Fix method signatures for _convert_read_set_to_genomics_file and _convert_reference_to_genomics_file - Fix _matches_search_terms_metadata method call signature - Fix StoragePaginationResponse attribute names (continuation_token -> next_continuation_token) - Fix import paths for get_region and get_account_id mocking - Fix mock data structures for read set metadata (files as dict, not list) - Fix source_system assertions (sequence_store, reference_store) - Add missing GenomicsFileType import - All 25 healthomics search engine tests now pass - Coverage improved from 6% to 61% for healthomics_search_engine.py * test(s3): add comprehensive tests for S3SearchEngine - Improve test coverage from 9% to 58% for s3_search_engine.py - Add 23 comprehensive test cases covering all major functionality - Test S3 bucket search operations with pagination and timeout handling - Test object listing, tagging, and file type detection - Test caching mechanisms for both tags and search results - Test search term matching and file type filtering - Test bucket access validation and error handling - Test cache statistics and cleanup operations - Increase overall project coverage significantly Major test coverage areas: - Initialization and configuration (from_environment) - Bucket search operations (search_buckets, search_buckets_paginated) - S3 object operations (list_objects, get_tags) - File type detection and filtering - Search term matching against paths and tags - Caching mechanisms and statistics - Error handling for AWS service calls * fix(tests): fix failing healthomics search engine tests - Add missing mocks for _get_account_id and _get_region methods - Fix test_convert_read_set_to_genomics_file by mocking AWS utility methods - Fix test_convert_reference_to_genomics_file by mocking AWS utility methods - All 25 healthomics search engine tests now pass - Coverage improved from 57% to 61% for healthomics_search_engine.py - Prevents real AWS API calls during testing * test(result-ranker): achieve 100% test coverage for ResultRanker - Improve test coverage from 14% to 100% for result_ranker.py - Add 17 comprehensive test cases covering all functionality - Test result ranking by relevance score with various scenarios - Test pagination with edge cases (invalid offsets, max_results) - Test ranking statistics calculation and score distribution - Test complete workflow integration (rank -> paginate -> statistics) - Use pytest.approx for proper floating point comparisons - Increase overall project coverage from 71% to 72% - All 597 tests now passing Major test coverage areas: - Result ranking by relevance score (descending order) - Pagination with offset and max_results validation - Ranking statistics with score distribution buckets - Edge cases: empty lists, single results, identical scores - Error handling: invalid parameters, extreme values - Full workflow integration testing * test(json-response-builder): achieve 100% test coverage for JsonResponseBuilder - Improve test coverage from 15% to 100% for json_response_builder.py - Add 19 comprehensive test cases covering all functionality - Test JSON response building with complex nested structures - Test result serialization with file associations and metadata - Test performance metrics calculation and response metadata - Test file type detection, extension parsing, and storage categorization - Test association type detection (BWA index, paired reads, variant index) - Test edge cases: empty results, zero duration, compressed files - Use comprehensive fixtures for realistic test scenarios - Increase overall project coverage from 72% to 74% - All 616 tests now passing Major test coverage areas: - Complete JSON response building with optional parameters - GenomicsFile and GenomicsFileResult serialization - Performance metrics and search statistics - File association type detection and categorization - File size formatting and human-readable conversions - Storage tier categorization and file metadata extraction - Complex workflow integration with multiple file types - Edge case handling and error scenarios * test(config-utils): achieve 100% test coverage for config utilities - Improve test coverage from 15% to 100% for config_utils.py - Add 45 comprehensive test cases covering all functionality - Test environment variable parsing with validation and defaults - Test S3 bucket path validation and normalization - Test boolean value parsing with multiple true/false representations - Test integer value parsing with error handling and bounds checking - Test complete configuration building and integration workflow - Test bucket access permission validation - Test edge cases: invalid values, missing env vars, negative numbers - Use proper environment variable cleanup between tests - Increase overall project coverage from 74% to 77% - All 661 tests now passing Major test coverage areas: - Environment variable parsing and validation - S3 bucket path configuration and validation - Boolean configuration parsing (true/false variations) - Integer configuration with bounds checking - Cache TTL configuration (allowing zero for disabled caching) - Complete SearchConfig object construction - Bucket access permission validation workflow - Error handling for invalid configurations - Integration testing with realistic scenarios * feat(s3-utils): optimize bucket validation and achieve 99% coverage * feat(genomics-search-orchestrator): achieve 49% test coverage with comprehensive tests * perf(genomics-search-orchestrator): optimize test performance by 94% * feat(healthomics-search-engine): improve test coverage from 61% to 69% * fix: clean up files and reformats some files failing lints * security: fix bandit security issues - Replace MD5 hash with usedforsecurity=False for cache keys * MD5 is used for non-security cache key generation only * Explicitly mark as not for security purposes to satisfy bandit - Replace random with secrets for cache cleanup timing * Use secrets.randbelow() instead of random.randint() * Provides cryptographically secure random for better practices - Add secrets import to genomics_search_orchestrator.py Security improvements: - Resolves 2 HIGH severity bandit issues (B324 - weak MD5 hash) - Resolves 2 LOW severity bandit issues (B311 - insecure random) - All bandit security tests now pass with 0 issues - No functional changes to cache behavior - All existing tests continue to pass * fix(tests): mock AWS account/region methods to prevent credential access - Add mocks for _get_account_id() and _get_region() in conversion tests - Prevents tests from attempting to access real AWS credentials - Fixes 'Unable to locate credentials' errors in test output - Improves test performance by avoiding real AWS API calls - Tests now run in 0.36s instead of 4+ seconds Affected tests: - test_convert_read_set_to_genomics_file_with_minimal_data - test_convert_reference_to_genomics_file_with_minimal_data All 47 HealthOmics search engine tests now pass cleanly without attempting to access AWS services or credentials. * fix: fix pyright issues * feat: improve test coverage * feat: increases coverage of pagination logic, filtering, fallbacks and term matching tests * fix: mock aws credentials * feat: improve test coverage of exception handling, continuation token logi, filtering and edge cases * fix: pyright type error fixed * feat: more test coverage to stop codecov nagging me * feat: improvements to branch coverage * fix(search): enforce S3 bucket access validation in orchestrator - Make S3SearchEngine constructor private to prevent direct instantiation - Update GenomicsSearchOrchestrator to use S3SearchEngine.from_environment() - Add graceful failure handling when S3 buckets are inaccessible - Ensure bucket access validation occurs during initialization - Add _create_for_testing() factory method for unit tests - Update all tests to use proper constructor patterns This fixes the issue where comma-separated S3 URIs would fail silently when some buckets were inaccessible, and ensures HealthOmics search continues to work even when S3 search fails. Fixes: Comma-separated S3 URIs not working due to missing bucket validation Fixes: Silent failures when S3 buckets are inaccessible * refactor: rename config_utils to search_config and reorganize models - Rename config_utils.py to search_config.py for better clarity of purpose - Split models.py into organized modules under models/ package: - core.py: Core workflow and run models - s3.py: S3-specific file models and utilities - search.py: Search-specific models and requests - Update all import statements across codebase - Update test files to match new module structure - Maintain 100% backward compatibility - All 930 tests passing with 93% coverage * feat: comprehensive test coverage improvements and code quality enhancements - Improve test coverage from 93% to 97% (4,352 statements, 138 missed) - Add 17 new tests covering previously uncovered functions and error paths - Fix get_partition cache isolation issue in tests by adding setup_method - Add comprehensive tests for S3 models (get_presigned_url, validation edge cases, FASTQ pair detection) - Add tests for run_analysis instance type analysis and error handling - Add tests for S3 search engine (invalid tokens, buffer overflow, exception handling) - Add tests for HealthOmics search engine (fallback filtering, error handling) - Add tests for genomics search orchestrator (cache cleanup, timeout handling, coordination logic) - Replace magic numbers with centralized constants in consts.py - Add AWS partition detection with memoization for ARN construction - Enhance cache management with TTL-based cleanup and size limits - Add MCP timeout and search documentation to README - Remove line number references from test docstrings for maintainability - Fix duplicate fixture definitions and type errors - Ensure all linting, formatting, type checking, and security checks pass Total test count: 975 tests (up from 958) Coverage improvement: +4 percentage points All quality gates passing: Ruff, Pyright, Bandit, Pytest * chore: removes unescessary package-lock * perf: optimize file association engine with pre-compiled regex patterns - Pre-compile all 30+ regex patterns during initialization to avoid repeated compilation overhead - Add extension-based pattern lookup table to filter relevant patterns per file type - Implement _get_relevant_pattern_indices() to reduce regex checks from 30+ to only relevant patterns - Refactor file extension constants to centralized consts.py to eliminate duplication - Add comprehensive test coverage (14 new tests) for optimization features - Add performance benchmark test demonstrating 110k+ files/second throughput Performance improvements: - Eliminates repeated regex compilation on every file - Reduces pattern matching attempts through extension-based filtering - Maintains full backward compatibility and correctness Test results: - 49 tests passing - 95% code coverage - 0.005s to process 500 files (0.01ms per file average) Addresses reviewer feedback about expensive regex compilation with large file sets.Mark Schreiber · d54a139f · 2025-11-10
- 6.5ETVtest(ecs-mcp-server): Upgrade test coverage for ECS MCP Server + update clients (#560) * test(ecs-mcp-server): Upgrade test coverage for ECS MCP Server * address comments + fix bandit * remove ecs_client & cloudformation_client * extra cov * add cov + cache aws clients for reuse --------- Co-authored-by: Matthew Goodman <mtgoo@amazon.com> Co-authored-by: Alain Krok <alkrok@amazon.com>Matthew Goodman · 34a8000a · 2025-06-16
- 5.8ETVfix: (ecs-mcp-server) update troubleshooting API parameters, add integration testing, app_name validation (#1200) * fix: update troubleshooting API parameters, add integration testing, update app_name validation - Replace app_name parameter with cluster_name/service_name for better ECS resource targeting - Extract common utilities to troubleshooting_tools/utils.py module - Update all troubleshooting tools to use new parameter structure - Add comprehensive integration testing framework (mcp-inspector) with validation scenarios - Update app_name validation for length and maintain only lowercase chars on creation * fix(ecs-mcp-server): addressed rev1 comments Renamed troubleshooting API parameters: - cluster_name → ecs_cluster_name - service_name → ecs_service_name - task_id → ecs_task_id - stack_id/stack_name → cfn_stack_name Update parameter validation, transformers, documentation, examples, and tests to reflect the new naming convention. Make fetch_network_configuration require ecs_cluster_name parameter and remove unused find_clusters import. Improve consistency across parameter descriptions by capitalizing resource names (ECS Cluster, ECS Service, ECS Task, CloudWatch Logs, etc.) Removed "assessment" and "image_issues" when validation fails. * fix(ecs-mcp-server): boost cov --------- Co-authored-by: Matthew Goodman <mtgoo@amazon.com>Matthew Goodman · 3684ab0a · 2025-09-05
- 5.5ETVfeat: Adds an AWS HealthOmics MCP server (#598) * feat: initial generation of the server * feat: Adds intitial design docs * initial implementations * feat/ adds supported regions tool and clarifies types * feat: use MCP style error handling * feat: improved exception handling * update current progress * feat: remove generate_parameter_template tool from helper tools - Remove generate_parameter_template function from helper_tools.py - Remove tool registration from server.py - Remove extract_wdl_inputs and related functions from wdl_utils.py - Update server instructions to remove GenerateParameterTemplate reference - Update design document to remove generate_parameter_template section - Clean up unused imports in wdl_utils.py This simplifies the helper tools by removing parameter template generation functionality while keeping workflow validation and packaging tools. * fix: adjusts model to more closely reflect HealthOmics model * refactor: seperate log access into different tools * refactor: adds startFromHead capability to log retrieval tools and uses this in diagnose_run_failure * test(healthomics): add comprehensive unit tests for log functions - Add unit tests for get_run_logs, get_run_manifest_logs, get_run_engine_logs, and get_task_logs - Add unit tests for diagnose_run_failure function - Refactor diagnose_run_failure to use centralized log functions from workflow_analysis - Add start_from_head parameter to all log functions with default True - Update diagnose_run_failure to use start_from_head=False for recent logs - Fix UTC timezone handling in log timestamp conversion - Improve error handling with specific ClientError and BotoCoreError handling - Add comprehensive test fixtures and mocking in conftest.py - Update test_server.py to properly verify all registered tools - Update server instructions to document all available tools - Achieve 89% test coverage for troubleshooting module - All 33 unit tests passing with proper parameter validation and error scenarios * docs(healthomics): update design document to reflect current implementation - Update architecture and directory structure - Document all 19 implemented tools - Add recent log function improvements - Include current test coverage metrics - Add implementation details for error handling - Update security considerations and future enhancements * test(healthomics): add unit tests for get_supported_regions - Add test cases for successful SSM region retrieval - Test fallback to hardcoded regions when SSM is empty - Add error handling tests for BotoCoreError and ClientError - Test unexpected error handling and context error reporting - Verify region list sorting and response structure * test(healthomics): add unit tests for package_workflow tool - Add comprehensive test suite for package_workflow functionality - Cover basic workflow packaging, additional files, and error cases - Test special characters and large file handling - Ensure proper ZIP structure and content validation - Verify error handling and context reporting * test(healthomics): add comprehensive unit tests for workflow execution tools - Add tests for get_run tool covering success, minimal response, and error cases - Add tests for list_runs tool with filtering, pagination, and error handling - Test various AWS error scenarios (BotoCoreError, ClientError, unexpected errors) - Verify proper timestamp handling including None values - Test parameter validation and edge cases - Ensure proper error reporting through MCP context * fix(healthomics): improve error handling and timestamp processing in workflow execution - Add specific ClientError handling for better error reporting - Improve timestamp field handling to check for None values - Refactor field handling for better maintainability - Fix potential AttributeError when calling isoformat() on None values * test(healthomics): add comprehensive unit tests for workflow management tools - Add tests for list_workflows tool covering success, empty response, and pagination - Add tests for get_workflow tool with and without export type - Test various AWS error scenarios (BotoCoreError, unexpected errors) - Verify proper timestamp handling including None values - Test parameter validation and edge cases - Ensure proper error reporting through MCP context * test(healthomics): add comprehensive unit tests for models and fix validation - Add tests for all enum classes (WorkflowType, StorageType, CacheBehavior, etc.) - Add tests for all model classes with full and minimal field scenarios - Test model validation including edge cases and error conditions - Test model serialization and JSON serialization - Fix StorageRequest validation to properly check STATIC storage requirements - Improve enum membership testing for Python 3.10 compatibility - Add comprehensive validation error testing * fix(tests): resolve failing test suite issues - Add missing mock_boto_client fixture to conftest.py - Fix incorrect mock patching paths in workflow_management tests - Handle both string and datetime objects in creationTime processing - Update test assertions to match actual code behavior for nextToken - Correct error message assertions in exception handling tests Resolves 5 failing tests, bringing total to 106 passing tests with 62% coverage. * feat!: remove validate_workflow tool BREAKING CHANGE: The ValidateWorkflow tool has been completely removed from the MCP server. - Remove validate_workflow function from helper_tools.py - Remove ValidateWorkflow tool registration from server.py - Remove unused workflow type constants from consts.py - Delete wdl_utils.py module (no longer needed) - Remove related imports and error message constants This simplifies the codebase by removing workflow validation functionality that was not core to the HealthOmics service integration. * fix(workflow): correct get_workflow parameter template handling - Change export_type parameter to export_definition boolean - Remove incorrect PARAMETER_TEMPLATE export type (not supported by AWS API) - Parameter template is always included in standard get_workflow response - Update all test cases to use new export_definition parameter - Remove invalid export type validation test - Clean up unused constants and error messages The parameter template is a standard field in the boto3 get_workflow response, not an export type. Only DEFINITION can be exported via the export parameter. * fix(workflow): clarify get_workflow export_definition behavior - Update parameter description to clarify it returns a presigned URL - Update function docstring to explain presigned URL behavior - Fix test to use realistic presigned URL format instead of workflow content - Add test case for workflow retrieval without export definition - Improve test assertions to verify presigned URL characteristics The export_definition parameter provides a presigned URL for downloading the workflow definition ZIP file, not the actual workflow content. * feat(workflow): add statusMessage field to get_workflow response - Include statusMessage field from AWS API response when present - Add conditional handling to only include statusMessage if it exists - Add test case specifically for workflows with status messages - Update existing test to verify statusMessage is properly included - Enhance test coverage for different workflow states (ACTIVE, FAILED) The statusMessage field provides additional context about workflow status, especially useful for failed workflows or workflows in transition states. * fix(workflow): correct export parameter type in get_workflow - Change export parameter from string to list as required by AWS API - Update from 'DEFINITION' to ['DEFINITION'] to match API specification - Fix test assertion to expect list parameter in API call - Resolves parameter validation error in MCP Inspector The AWS HealthOmics get_workflow API expects the export parameter to be a list of export types, not a single string value. * fix(typing): corrects type hint * test: add comprehensive tests for CreateWorkflow, CreateWorkflowVersion, StartRun, and ListRunTasks - Add 18 new test cases covering success, error, and edge case scenarios - Test CreateWorkflow with minimal and full parameters, base64 validation, and error handling - Test CreateWorkflowVersion with static/dynamic storage, capacity validation, and error scenarios - Test StartRun with different storage types, cache configuration, and parameter validation - Test ListRunTasks with pagination, filtering, and error handling - Fix test parameter passing to match function signatures with Field annotations - Update test assertions to match actual AWS API parameter names (workflowId vs id) - Improve test coverage significantly: - workflow_execution.py: 48% → 75% coverage - workflow_management.py: 55% → 93% coverage - Overall project: 64% → 79% coverage All 125 tests now pass, providing robust validation for the core workflow management and execution functionality. * feat(workflow-execution): implement client-side date filtering for ListRuns - Add client-side filtering for created_after and created_before parameters - Remove boto3 client date filter parameters (not supported by AWS API) - Add parse_iso_datetime helper function for datetime parsing - Add filter_runs_by_creation_time helper function for filtering logic - Use larger batch size (100) when filtering to reduce API calls - Add comprehensive test coverage for date filtering functionality - Add 9 new test cases covering various filtering scenarios - Maintain backward compatibility for existing functionality - All 134 tests passing with 79% overall coverage * feat(workflow-execution): add roleArn and runOutputUri to GetRun response - Add roleArn field to GetRun tool response for IAM role information - Add runOutputUri field to GetRun tool response for run output location - Update all GetRun tests to include the new required fields - Enhance GetRun docstring to document all returned fields - Maintain backward compatibility for existing response fields - All 134 tests passing with no regressions * refactor(s3-utils): remove unused functions and improve validation - Remove unused functions: parse_s3_uri, upload_to_s3, download_from_s3 - Enhance ensure_s3_uri_ends_with_slash to validate s3:// prefix - Add comprehensive test coverage for ensure_s3_uri_ends_with_slash function - Add 6 new test cases covering valid and invalid URI scenarios - Improve s3_utils.py coverage from 33% to 100% - Improve overall test coverage from 79% to 81% - All 140 tests passing with no regressions * feat(troubleshooting): enhance diagnose_run_failure with manifest logs and comprehensive task analysis - Add run manifest log retrieval using get_run_manifest_logs function - Implement pagination to collect ALL failed tasks (not just first 10) - Increase task log limits from 50 to 100 for better diagnostics - Add comprehensive response structure with counts and metadata - Enhance error handling for datetime fields (support both objects and strings) - Add 5 new troubleshooting recommendations for better guidance - Improve summary information with intelligent log availability detection Enhanced response now includes: - runUuid for log stream identification - manifestLogs with workflow summary and resource metrics - engineLogCount, manifestLogCount, failedTaskCount for quick assessment - Enhanced task details with logCount per task - Comprehensive summary with hasManifestLogs/hasEngineLogs flags - Additional timing and workflow metadata Test coverage improvements: - Add 4 new test cases covering edge cases and error scenarios - Update existing tests to verify new functionality - Maintain 93% coverage for troubleshooting module - All 143 tests passing * fix(troubleshooting): resolve DiagnoseRunFailure Pydantic Field and log stream issues This commit fixes critical issues in the DiagnoseRunFailure tool that were causing: 1. 'FieldInfo' object has no attribute 'replace' errors 2. ResourceNotFoundException when retrieving CloudWatch logs ## Root Cause Analysis - Log retrieval functions defined with Pydantic Field decorators were being called internally, passing Field objects instead of actual parameter values - Incorrect CloudWatch log stream naming patterns prevented log retrieval - Datetime handling code attempted operations on Field objects instead of datetime values ## Changes Made ### workflow_analysis.py - Added internal wrapper functions without Pydantic Field decorators: * get_run_engine_logs_internal() * get_run_manifest_logs_internal() * get_task_logs_internal() - Fixed CloudWatch log stream naming patterns: * Engine logs: run/{run_id}/engine (was: engine/run/{run_id}) * Task logs: run/{run_id}/task/{task_id} (was: task/run/{run_id}/{task_id}) - Enhanced datetime string handling with type checking before .replace() calls - Fixed missing imports for datetime, timezone, and ClientError ### troubleshooting.py - Updated imports to use internal wrapper functions instead of MCP tool functions - Added safe_datetime_to_iso() helper function for robust datetime conversion - Modified all log retrieval calls to use internal functions without ctx parameter ### test_troubleshooting.py - Updated all test mocks to use new internal function names - Removed ctx parameter from function call assertions - Fixed double-replacement issues in function names - Restored ctx=mock_context parameter to diagnose_run_failure test calls ## Impact - DiagnoseRunFailure tool now works correctly with real AWS HealthOmics run IDs - All 143 tests passing with proper log retrieval functionality - Eliminates Pydantic Field object errors and CloudWatch log access issues - Maintains backward compatibility for existing MCP tool interfaces Resolves issues with run ID 5937949 and similar real-world diagnostic scenarios. * feat(troubleshooting): add time window scoping for log retrieval in DiagnoseRunFailure Enhance the DiagnoseRunFailure tool to restrict log searches to relevant time windows, improving performance and focusing on diagnostic-relevant logs. ## Key Features ### Time Window Calculation - Added calculate_log_time_window() helper function with configurable buffer (default: 5 minutes) - Supports both datetime objects and ISO format strings - Robust error handling for invalid inputs ### Enhanced Log Retrieval Scoping - **Engine Logs**: Scoped to run creation ± 5min to run stop ± 5min - **Manifest Logs**: Same time window as engine logs (run lifecycle) - **Task Logs**: Attempts task-specific timing via get_run_task() API, falls back to run timing ### Intelligent Task-Specific Timing - For each failed task, attempts to retrieve detailed task information - Uses task creation ± 5min to task stop ± 5min when available - Falls back to run time window if task-specific timing unavailable - Logs time window selection for debugging ## Implementation Details ### troubleshooting.py - Added datetime imports and time window calculation logic - Enhanced all log retrieval calls with start_time/end_time parameters - Added task-specific timing retrieval with fallback mechanism - Improved logging to show selected time windows ### test_troubleshooting.py - Updated test assertions to include new time parameters - Added mock for get_run_task() calls in task timing tests - Added dedicated TestTimeWindowCalculation class with 3 test methods - All existing functionality preserved with enhanced time scoping ## Benefits - **Performance**: Reduces log retrieval time by limiting search scope - **Relevance**: Focuses on logs most likely to contain diagnostic information - **Efficiency**: Reduces CloudWatch Logs API calls and data transfer - **Precision**: Task-specific timing provides more accurate log scoping ## Example Time Windows Run: 2024-01-01T10:00:00Z to 2024-01-01T10:30:00Z Log Window: 2024-01-01T09:55:00Z to 2024-01-01T10:35:00Z Task: 2024-01-01T10:05:00Z to 2024-01-01T10:25:00Z Task Log Window: 2024-01-01T10:00:00Z to 2024-01-01T10:30:00Z All 146 tests passing with enhanced functionality. * fix(workflow-analysis): add missing json import for manifest parsing - Add json import to fix 'name json is not defined' error - Required for parsing manifest log JSON objects in analyze_run function - Apply pre-commit formatting fixes * refactor(workflow-analysis): convert AnalyzeRun from @tool to @prompt - Move analysis functionality from tools/ to prompts/ directory - Create dedicated prompts/workflow_analysis.py module - Replace AnalyzeRun tool with analyze_healthomics_runs prompt - Update server.py to register prompt instead of tool - Remove duplicate helper functions from tools/workflow_analysis.py - Update server instructions to reflect prompt-based approach - Apply pre-commit formatting fixes Benefits: - Better alignment with MCP protocol semantics - Enables agent-side AI analysis for interactive experience - Cleaner separation of data retrieval vs AI processing - More appropriate use of MCP prompt capabilities - Allows follow-up questions and iterative analysis The prompt retrieves manifest data and provides structured analysis instructions, letting the consuming AI agent perform the actual analysis for a more interactive and flexible user experience. * fix(naming): standardize prompt naming to PascalCase for consistency - Change prompt name from 'optimize_healthomics_runs' to 'OptimizeHealthOmicsRuns' - Update server instructions to use PascalCase for prompt names - Update test expectations to match PascalCase convention - Maintain consistency with tool naming convention (PascalCase) - Fix function import reference in server.py - Apply pre-commit formatting fixes This ensures consistent naming across all MCP tools and prompts, following the established PascalCase convention used throughout the HealthOmics MCP server. * fix(prompt): remove ctx parameter from OptimizeHealthOmicsRuns prompt - Remove Context parameter from optimize_runs_prompt function signature - Update all helper functions to not require Context parameter - Remove Context import from prompts/workflow_analysis.py - Use direct logging instead of ctx.error() for error handling - Fix MCP Inspector display issue where ctx was shown as required parameter This resolves the issue where the MCP Inspector incorrectly showed the internal Context parameter as a required user input for the prompt. MCP prompts should only expose user-facing parameters, not internal framework parameters like Context. * fix(prompt): improve parameter handling and discoverability for AnalyzeHealthOmicsRunPerformance - Add flexible parameter handling for run_ids to accept JSON arrays, comma-separated strings, or single values - Rename prompt from OptimizeHealthOmicsRuns to AnalyzeHealthOmicsRunPerformance for better discoverability - Add comprehensive test coverage for parameter normalization - Update server instructions to better describe when to use the prompt - Improve prompt docstring with specific use cases for AI agents * fix(prompt): resolve JSON serialization error with datetime objects - Add comprehensive datetime-to-string conversion functions - Fix JSON serialization error when AWS API returns datetime objects - Add safe JSON serialization with custom datetime handler - Convert datetime objects in run responses (creationTime, startTime, stopTime) - Add recursive datetime conversion for nested data structures - Add comprehensive test coverage for datetime conversion functionality - Ensure all datetime objects are converted to ISO format strings before JSON serialization * feat(prompt) adds HealthOmics considerations to the prompt * test: improve troubleshooting.py test coverage to 92% - Add tests for safe_datetime_to_iso function with various input types - Add tests for calculate_log_time_window with edge cases and invalid inputs - Coverage improved from 84% to 92% * test: improve workflow_execution.py test coverage to 86% - Add tests for error conditions in start_run function - Add tests for invalid storage types, cache behaviors, and S3 URIs - Add tests for BotoCoreError and unexpected error handling - Add tests for get_omics_client failure scenarios - Fix duplicate function names - Coverage improved from 76% to 86% * test: improve workflow_analysis.py test coverage to 48% - Add tests for get_logs_client function with success and failure scenarios - Add tests for _get_logs_from_stream function with various parameters - Add tests for error handling in log retrieval functions - Remove duplicate class definitions - Coverage improved from 43% to 48% * fix: resolve failing workflow_analysis tests - Fix timestamp assertion issues by checking call parameters instead of exact values - Fix nextToken handling by using 'nextForwardToken' in mock response - Remove leftover code fragments causing syntax errors - All 183 tests now pass successfully * feat: increase maximum size of manifest log * test: increase workflow_analysis test coverage from 56% to 100% - Add comprehensive tests for get_logs_client() error handling - Add tests for internal wrapper functions (get_run_manifest_logs_internal, get_run_engine_logs_internal, get_task_logs_internal) - Add extensive tests for _get_run_manifest_logs_internal() function covering all error scenarios - Add error handling tests for get_run_manifest_logs, get_run_engine_logs, and get_task_logs - Add tests for BotoCoreError, ClientError, and generic exception handling - Add edge case tests for empty responses and missing event fields - Add invalid timestamp handling tests for all log functions - Increase total test count from 35 to 55 tests - All tests passing with 100% statement coverage achieved Covers missing lines: 40-42, 206-261, 332-346, 413-427, 499-502, 504-509, 561-580 * refactor: convert workflow analysis prompt to run analysis tool - Migrated optimize_runs_prompt from prompts/workflow_analysis.py to tools/run_analysis.py - Converted prompt to analyze_run_performance tool with proper MCP tool structure - Enhanced tool to generate comprehensive analysis reports instead of prompts - Updated server.py to register new tool and remove old prompt registration - Removed prompts directory as it's no longer needed - Updated test imports and server test expectations - Added new test file for run analysis tool functionality - All 214 tests passing with 75% overall coverage * test: add comprehensive unit tests for run analysis tool - Added 33 comprehensive unit tests for run_analysis.py module - Improved test coverage from 16% to 90% for run_analysis.py - Added tests for all major functions: - _json_serializer with datetime handling and error cases - _extract_task_metrics_from_manifest with complete, over/under-provisioned, and edge cases - _parse_manifest_for_analysis with valid data, empty events, and error handling - _generate_analysis_report with complete data, no runs, and exception handling - _get_run_analysis_data with success, missing UUID, and exception scenarios - analyze_run_performance with success, no data, exceptions, and run ID normalization - All tests use proper mocking for AWS services and async operations - Tests cover both positive and negative scenarios with comprehensive assertions - Overall project test coverage improved to 92% (236 tests passing) - Follows testing best practices with clear arrange/act/assert structure * fix: resolve all pyright type checking issues - Fixed type annotations for function parameters and return types - Added proper type hints for Dict[str, Any] variables to resolve assignment issues - Fixed datetime.isoformat() calls on potentially None values with proper null checks - Added type: ignore comments for intentional test validation error cases - Improved error handling in troubleshooting.py with null checks for task_id - Enhanced ClientError handling with safe dictionary access using .get() - All 27 pyright errors resolved, maintaining 92% test coverage with 236 passing tests - Code now passes strict type checking while preserving all functionality * fix: resolve final pyright type issue in test - Added type: ignore comment for ClientError test construction - All pyright type checking issues now resolved (0 errors) - All 236 tests passing with 92% coverage maintained * fix: adds docs required by all MCP servers * fix: corrects directory path Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * chore: add contact for HealthOmics mcp server * chore: add entry for HealthOmics mcp server * chore: add HealthOmics MCP categories and TOC * chore: bump version to 0.0.1 * feat: adds user_agent_extra information to boto3 client * fix: revert version bump Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * feat: improves the description of the parameters arg for the StartRun tool * chore: upgrade python packages Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * fix: fixes version string interpolation * feat: disambiguate tool names to avoid potential name collision issues in some clients that don't group by mcp server name --------- Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>Mark Schreiber · 753826a1 · 2025-07-01
- 4.9ETVfeat(aws-healthomics-server): ecr pull through cache support (#2332) * feat: Adds the following new tools: - **ListECRRepositories**: List ECR repositories with HealthOmics accessibility status - **CheckContainerAvailability**: Check if a container image is available in ECR and accessible by HealthOmics - **GrantHealthOmicsRepositoryAccess**: Grant HealthOmics access to an ECR repository by updating its policy - **ListPullThroughCacheRules**: List pull-through cache rules with HealthOmics usability status - **CreatePullThroughCacheForHealthOmics**: Create a pull-through cache rule configured for HealthOmics - **ValidateHealthOmicsECRConfig**: Validate ECR configuration for HealthOmics workflows * feat(aws-healthomics-mcp-server): Add ECR pull-through cache tools - Add ListECRRepositories tool to list ECR repositories with HealthOmics accessibility status - Add CheckContainerAvailability tool to verify container image availability in ECR - Add GrantHealthOmicsRepositoryAccess tool to update ECR repository policies - Add ListPullThroughCacheRules tool to list pull-through cache rules with HealthOmics usability status - Add CreatePullThroughCacheForHealthOmics tool to create pull-through cache rules - Add ValidateHealthOmicsECRConfig tool to validate ECR configuration for HealthOmics workflows - Extend ContainerAvailabilityResponse model with pull_through_initiated and pull_through_initiation_message fields - Add helper functions for pull-through cache rule evaluation and initiation - Add comprehensive test coverage for pull-through cache initiation - Update CHANGELOG.md with v0.0.22 release notes * Cleanup requirements comments * feat(aws-healthomics-mcp-server): Add CreateContainerRegistryMap tool - Add CreateContainerRegistryMap tool to generate container registry maps for HealthOmics workflows - Implement automatic discovery of HealthOmics-usable ECR pull-through cache rules - Support custom registry mappings and image-specific container overrides - Add comprehensive tool documentation and usage hints - Register new tool in MCP server with proper imports and descriptions - Update CHANGELOG.md with new tool documentation - Add unit tests for CreateContainerRegistryMap functionality - Enable workflows to use upstream registry images without modification by redirecting pulls to private ECR caches * tests - improved coverage of ECR additions - 96% coverage * feat(aws-healthomics-mcp-server): Add CloneContainerToECR tool - Add CloneContainerResponse model to represent container cloning results - Implement clone_container_to_ecr tool to copy container images from upstream registries to ECR - Support pull-through cache utilization when available for efficient image copying - Fall back to CodeBuild for image cloning when pull-through caches don't exist - Add container image reference parsing to handle various image format specifications - Implement registry detection and pull-through cache rule matching logic - Register new CloneContainerToECR tool in MCP server - Update CHANGELOG with new tool documentation - Enables users to efficiently clone public container images into ECR with HealthOmics accessibility * improve testing * update package with vulnerabilityMark Schreiber · 3d01c5ca · 2026-01-28
- 4.8ETVfeat(aws-healthomics): adds path support to tools which need to process large files (#2587) * feat: add file path and S3 URI content resolution for workflow tools Add content_resolver utility that enables MCP tools to accept local file paths and S3 URIs as alternatives to inline content. Integrate into linting, packaging, and workflow creation tools. Rename definition_zip_base64 to definition_source with backward-compatible deprecated alias. * refactor: use inclusive parameter names * chore: remove numeric references from properties/ features * test(healthomics): improve content resolver test robustness - Replace generic text strategy with custom _non_s3_text strategy for more targeted test data generation - Simplify test filtering logic by using hypothesis assume() instead of manual skip conditions - Reduce test complexity and improve clarity of test intent for non-S3 content passthrough validation * feat(healthomics): add output path and S3 URI support for timeline generation - Add output_path parameter to write SVG output to local file or S3 URI - Add expected_bucket_owner parameter for S3 bucket owner verification - Create new path_utils module with validate_local_path and validate_s3_uri_format functions - Extract path validation logic from content_resolver to reusable path_utils module - Add write_svg_to_local function to save SVG to local filesystem - Add write_svg_to_s3 function to save SVG to S3 with bucket owner verification - Update run_timeline to return JSON summary when output_path is provided - Add comprehensive tests for timeline output handling and path validation - Improve error handling for file I/O and S3 operations with proper exception catching - Enables complex workflows to avoid context window overflow by writing output to external storage * fix(healthomics): correct output format default and fix S3 utils test patches - Change output_format default from 'base64' to 'svg' for better usability - Expand output_format description with detailed guidance on when to use each format and base64 decoding requirements - Add missing optional parameters (region, output_path, expected_bucket_owner) to test function calls for consistency - Fix incorrect patch paths in S3 utils tests from aws_utils to s3_utils module - Improve test call formatting for readability with explicit parameter names * feat(healthomics): add output path and S3 bucket owner verification for package workflow - Add output_path parameter to package_workflow tool for writing ZIP to local or S3 destination - Add expected_bucket_owner parameter for S3 bucket owner verification during upload - Implement write_zip_to_local utility function with path sanitization and no-overwrite checks - Implement write_zip_to_s3 utility function with bucket validation and owner verification - Update package_workflow to return summary metadata when output_path is provided instead of base64 content - Add sentinel value _SENTINEL_DEFAULT_OWNER to default to caller's account ID for bucket verification - Add comprehensive error handling for file write operations (FileExistsError, OSError, ClientError, PermissionError) - Update test suite with new test_package_workflow_output.py and related test updates - Enables users to directly persist packaged workflows to storage without client-side decoding * fix: corrects changes after merge * fix: adds a guard to ensure the path is a regular file or directory and not a socket/ device etcMark Schreiber · 1c5ae6df · 2026-03-11
- 4.1ETVfeat(aws-healthomics-mcp-server): Adds cost estimations to optimize tool and a tool to produce SVG timelines (#2171) * feat(healthomics): Add analysis and visualization modules for workflow optimization - Add concurrent resource tracker to calculate peak and average CPU/memory usage across tasks - Add cost analyzer module to compute workflow execution costs with pricing data - Add instance recommender to suggest optimal compute instances based on resource requirements - Add pricing cache module to manage and cache AWS pricing information - Add task aggregator to consolidate and analyze task execution metrics - Add Gantt chart visualization generator stub for workflow timeline analysis - Add SVG builder utility stub for creating visualization components - Add analysis data model stubs to support cost and performance metrics - Add comprehensive test suite for all analysis modules - Update project dependencies in pyproject.toml and uv.lock - Enable cost analysis and performance optimization capabilities for healthomics workflows * feat(healthomics): Add timeline generation and cross-run task aggregation - Add get_price_with_error() method to PricingCache for error handling support - Implement aggregate_cross_run_tasks() in TaskAggregator for multi-run metrics analysis - Create new run_timeline.py tool for generating workflow timeline visualizations - Register generate_run_timeline tool in server for MCP exposure - Enhance gantt_generator.py with improved timeline rendering capabilities - Update svg_builder.py with additional visualization components - Add comprehensive test coverage for new analysis models and timeline generation - Improve error propagation in pricing lookups for better client feedback * refactor(healthomics): Remove concurrent resource tracker and consolidate analysis modules - Remove ConcurrentResourceTracker class and concurrent_tracker.py module - Remove concurrent_tracker imports from analysis __init__.py - Update CHANGELOG.md with v0.0.19 release notes for Run Timeline and Run Analysis tools - Update pricing_cache.py with improved caching logic - Refactor run_analysis.py and run_timeline.py tools for better integration - Update gantt_generator.py visualization with enhanced timeline rendering - Remove test_concurrent_tracker.py and update related test files - Consolidate concurrent resource tracking functionality into existing analysis modules for improved maintainability * fix(healthomics): Add input validation and improve task aggregation patterns - Add negative headroom validation in InstanceRecommender to raise ValueError for invalid inputs - Update WDL task name pattern to support non-numeric suffixes (e.g., "task-5-retry", "HaplotypeCallerGATK4-26-2527scattered") - Remove Optional type hints from headroom and detailed parameters in analyze_run_performance - Simplify headroom and detailed parameter handling by removing unnecessary null checks - Add max CPU and memory metrics to analysis report output for better resource visibility - Improve docstring documentation for supported workflow patterns (WDL, Nextflow, CWL) - These changes ensure more robust input validation and support for diverse task naming conventions across different workflow engines * improved code coverage * (fix): prevent pyright nag * refactor(healthomics): Replace SSM parameter store with boto3 session for region discovery - Replace SSM parameter store query with boto3 session.get_available_regions() for HealthOmics region discovery - Remove get_ssm_client() function from aws_utils.py as it is no longer needed - Add get_aws_session() and get_omics_service_name() helper functions for centralized session management - Add 'ap-northeast-2' (Asia Pacific Seoul) region to pricing cache region mapping - Update helper_tools.py to use boto3 session instead of SSM for region retrieval - Update fallback warning message to reference boto3 session instead of SSM parameter store - Update documentation comment in consts.py to clarify boto3 session as fallback source - Remove SSM client tests and update region resolution tests to reflect new implementation - Simplifies region discovery by leveraging boto3's built-in region availability data * Remove unescessary doc commentMark Schreiber · 582bb58e · 2026-01-15
- 3.9ETVchore: amazonlinux container images (#2033) * wip: amazonlinux container images Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * fix: aws-documentation amazonlinux Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * feat: remaining conversion to amazonlinux Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * fix: curl already installed Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * chore: update amazonlinux base image to latest sha256 Updated all Dockerfiles from sha256:3f6c5a2858113e9bb6710dfccdace7dc698e83f7a012240a1d07b3a46d273999 to sha256:e27a70c006c68f0d194cc9b9624714d6ed8d979a94f60f7d31392f4c8294155b Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: pip installation and calling via python Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * fix: update uv for python 3.13.11 Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * feature: upgrade uv to 0.9.24 for python 3.13.11 Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> * fix: ensurepip using python3 Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> --------- Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>Scott Schreckengaust · 55e3673d · 2026-01-15
- 3.9ETVfeat(aws-healthomics-mcp-server): add sequence and reference store tools (#2531) * feat(aws-healthomics-mcp-server): add sequence and reference store management tools - Add 15 new Sequence Store management tools including create, list, get, update operations for stores and read sets - Add import/export job management for read sets with batch support and job status tracking - Add read set activation and archival tools for lifecycle management - Add 10 new Reference Store management tools including create, list, get, update operations for stores and references - Add reference import job management with batch support and per-source status tracking - Add comprehensive store models and data structures for sequence and reference stores - Add full test coverage for all new store management tools and models - Update README with detailed documentation of all new tools and their capabilities - Update CHANGELOG with v0.0.27 release notes documenting new features - Add required IAM permissions to README for sequence and reference store operations * fixes implemented during MCP inspector testing * fix: resolves issues identified in copilot review * fix: move filetype filtering to server side filtering to remove paging inconsistency * test: Added 25 new tests covering parse_tags, parse_id_list, validate_definition_sources (Field objects, multiple/zero sources, base64 failure), validate_container_registry_params (Field objects, both-params error, invalid structure), and Field object handling for validate_readme_input and validate_repository_path_params * fix: add casts in test to keep pyright happyMark Schreiber · 5cbc6f9f · 2026-03-05