Skip to main content

MCP server for managing mainframe component dependencies and relationships

Project description

AWS Transform for mainframe (ATX) - Mainframe Dependency Manager

A comprehensive tool for managing mainframe component dependencies and relationships as part of AWS Transform for mainframe (ATX) initiatives. Can be used as both an MCP server and a Python library.

Overview

This tool extends the AWS Transform for mainframe (ATX) analysis workflow by providing advanced dependency analysis capabilities for mainframe applications. It works with the codebase and dependency graph JSON produced by the ATX analysis step to enable deeper insights and impact analysis.

ATX Integration Workflow

ATX Analysis → dependencies.json + codebase → ATX Mainframe Dependency Manager → Advanced Analysis
  1. ATX Analysis: Analyzes your mainframe codebase and produces dependencies.json
  2. ATX Mainframe Dependency Manager: Uses the same codebase and generated dependency graph for further analysis
  3. Advanced Analysis: Provides 18+ analysis tools for dependency tracking, impact assessment, and source code access

Features

  • Dependency Analysis: Analyze direct and recursive dependencies between mainframe components
  • Impact Assessment: Understand the impact of changes to specific components
  • Component Discovery: Find components by name, type, or file path
  • Orphan Detection: Identify unused components with no dependencies or dependents
  • Statistics and Reporting: Get comprehensive statistics about your mainframe codebase
  • Source Code Access: Read and analyze mainframe source code files
  • Dual Usage: Works as both MCP server and Python library

Prerequisites

  • ATX Analysis: Must be completed first to generate the dependency graph
  • Same Codebase: Use the identical codebase that was analyzed by ATX
  • Dependencies JSON: The dependencies.json file produced by ATX analysis

Installation

For MCP Server Usage

No installation needed! The MCP configuration with uvx will automatically download and run the package.

For Python Library Usage

pip install atx-mainframe-dependency-manager

Quick Start

Configuration

Set these environment variables to point to your ATX analysis outputs:

export ATX_MF_DEPENDENCIES_FILE="/path/to/atx-dependencies.json"
export ATX_MF_CODE_BASE="/path/to/mainframe/codebase"

As MCP Server

{
  "mcpServers": {
    "atx-mainframe-dependency-manager": {
      "command": "uvx",
      "args": ["atx-mainframe-dependency-manager"],
      "env": {
        "ATX_MF_DEPENDENCIES_FILE": "/path/to/atx-dependencies.json",
        "ATX_MF_CODE_BASE": "/path/to/mainframe/codebase"
      }
    }
  }
}

As Python Library

from atx_mainframe_dependency_manager import DependencyManager
import os

# Initialize and load dependencies
dm = DependencyManager()
dm.load_dependencies("/path/to/atx-dependencies.json")
os.environ['ATX_MF_CODE_BASE'] = "/path/to/mainframe/codebase"

# Analyze dependencies
component_info = dm.get_component_info("PAYROLL")
dependencies = dm.get_dependencies("PAYROLL")
stats = dm.get_statistics()

Sample Prompts

Once the MCP server is configured, you can use these prompts for mainframe modernization:

Migration Planning

  • "Which components have the fewest dependencies and could be migrated first?"
  • "Show me standalone programs that could be extracted as microservices"
  • "Find components that are only used by a single program"

Data Structure Analysis

  • "What are the input files and their copybooks layout for this JCL job?"
  • "Which copybooks define data structures that could become API contracts?"
  • "Show me all the data dependencies for the CUSTOMER-PROCESS program"

Risk Assessment

  • "Identify high-risk components with many dependents that need careful migration planning"
  • "Which programs have the most complex dependency chains?"
  • "Find circular dependencies that need refactoring before cloud migration"

Modernization Strategy

  • "Group related components that could form a microservice boundary"
  • "Show me batch JCL jobs that could be converted to serverless functions"
  • "What would be impacted if I modernize the CUSTOMER-MASTER program?"

Usage Examples

Basic Analysis

# Get component information
info = dm.get_component_info("PAYROLL")
print(f"Type: {info['type']}, Path: {info['path']}")

# Find dependencies and dependents
deps = dm.get_dependencies("PAYROLL")
dependents = dm.get_dependents("PAYROLL")

# Get recursive impact analysis
recursive_deps = dm.get_recursive_dependencies("PAYROLL")
recursive_dependents = dm.get_recursive_dependents("PAYROLL")

Component Discovery

# Find components by type
cobol_programs = dm.get_components_by_type("COB")
copybooks = dm.get_components_by_type("CPY")

# Find orphaned components
orphans = dm.get_orphaned_components()

# Search by file path
component = dm.find_component_by_path("/cobol/PAYROLL.cob")

# Get comprehensive statistics
stats = dm.get_statistics()
print(f"Total components: {stats['total_components']}")

Source Code Access

# Read source code content
source_code = dm.read_component_source("PAYROLL")

# Get source file information
source_info = dm.get_component_source_info("PAYROLL")

# Validate source code access
validation_results = dm.validate_source_access()

Analysis Tools Reference

Component Analysis

  • get_component_info - Get detailed component information
  • get_component_dependencies - Get direct dependencies
  • get_recursive_dependencies - Get complete dependency tree
  • get_component_dependents - Get components that depend on this one
  • get_recursive_dependents - Get complete impact tree

Discovery Tools

  • get_components_by_type - List components by type (COB, JCL, CPY, etc.)
  • find_component_by_path - Find components by file path
  • get_orphaned_components - Find unused components

Source Code Tools

  • read_component_source - Read actual source code content
  • get_component_source_info - Get source file accessibility details
  • list_component_directory - List files in component directories
  • validate_source_access - Check source file accessibility

System Analysis

  • get_dependency_statistics - Get comprehensive codebase statistics
  • get_configuration_info - Get current configuration status

Management Tools

  • load_dependencies - Load dependency data from ATX JSON file
  • add_component - Add new components (experimental)
  • add_dependency - Add new dependency relationships (experimental)
  • save_dependencies - Save current state to JSON file (experimental)

Note: Management tools marked as experimental are available but not fully tested. Use with caution in production environments.

ATX Dependencies JSON Format

The dependency graph JSON is produced by the ATX analysis step and follows this structure:

[
  {
    "name": "PAYROLL",
    "type": "COB", 
    "path": "/mainframe/cobol/PAYROLL.cob",
    "dependencies": [
      {
        "name": "EMPLOYEE",
        "dependencyType": "COPY"
      }
    ]
  }
]

Note: This JSON file is automatically generated by ATX analysis - you don't need to create it manually.

AWS Transform Integration

This tool is designed to work seamlessly with AWS Transform for mainframe (ATX) workflows:

  1. Run ATX Analysis on your mainframe codebase
  2. Use the same codebase and generated dependencies.json
  3. Launch this tool (as MCP server or library) for advanced dependency analysis
  4. Perform impact analysis before making changes
  5. Track dependencies throughout your transformation journey

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atx_mainframe_dependency_manager-0.1.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file atx_mainframe_dependency_manager-0.1.1.tar.gz.

File metadata

File hashes

Hashes for atx_mainframe_dependency_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a8225b8cf92c27aa49e1d8fdaf46dbb739c3f817038a3d39c50c055fc9f7ed57
MD5 c52be21b11eb34d5f7d23a8ed7cc9070
BLAKE2b-256 418fea12164469b0394549b231de05602ffe437c7dc4d8927ec8f39335297c29

See more details on using hashes here.

File details

Details for the file atx_mainframe_dependency_manager-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for atx_mainframe_dependency_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d93179a7a70716f374ef6f4382fc756926f887384fcfb80c9adb03c2281444a
MD5 97cbaea8ee82c3df2fd6955d2afadfef
BLAKE2b-256 0831bd7a03d8e35d4b801e0b21a4c14d61119860fb843f0d704f9c21705ee8fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page