mcap-protocol

MCAP: A Research Hypothesis for AI-Driven Legacy Modernization

(By Sami Balasundaram)

Abstract 🧠

Legacy COBOL systems, critical to enterprise operations, face modernization challenges due to undocumented business logic, retiring developers, and high costs. This paper proposes the Mainframe Context Aware Protocol (MCAP), a hypothetical framework extending Anthropic’s Model Context Protocol (MCP) and Google’s Agent2Agent (A2A) protocol to enable secure, context-aware COBOL-to-Java modernization. MCAP orchestrates multi-agent workflows, preserves business logic, and ensures compliance. Through a conceptual architecture, design principles, and a claims processing use case, we explore MCAP’s potential. Research questions and a development roadmap are outlined, inviting collaboration to validate this approach.

1. Introduction 🚀

Legacy COBOL systems power critical enterprise functions, processing $3 trillion in daily transactions and 95% of ATM operations (IBM Research, 2023). However, a shrinking developer pool, undocumented logic, and $1.52 trillion in U.S. technical debt (RTInsights, 2023) hinder modernization. Traditional methods struggle to preserve institutional knowledge, leading to high failure rates (Ars Technica, 2023).

Large Language Models (LLMs) show promise, with tools like IBM’s watsonx Code Assistant (CROZ, 2024) and CloudFrame’s CodeNavigator (CloudFrame, 2024) achieving functional equivalence in COBOL-to-Java conversion. Yet, LLMs lack secure access to mainframe context, risking logic corruption. This paper proposes the Mainframe Context Aware Protocol (MCAP), extending Anthropic’s MCP (Anthropic, 2024) and Google’s A2A protocol (Google Cloud, 2025), to enable AI-driven modernization.

2. The Legacy Modernization Challenge 🎯

COBOL systems face:

LLMs require a protocol to access mainframe context securely, preserving logic and ensuring compliance.

3. Protocol Foundations 🔬

3.1 Model Context Protocol (MCP)

MCP, an open standard by Anthropic, uses JSON-RPC 2.0 to connect AI agents to tools and data (Anthropic, 2024). It offers:

3.2 Agent2Agent (A2A) Protocol

A2A, an open-source protocol announced by Google at Cloud Next 2025, enables AI agents from different vendors and frameworks to collaborate (Google Developers, 2025). Backed by over 50 partners (e.g., Salesforce, SAP), A2A uses HTTP and JSON-based “Agent Cards” for:

4. MCAP: A Hypothetical Framework 🏗️

MCAP extends MCP and A2A for mainframe modernization, orchestrating secure, context-aware AI workflows.

4.1 Architecture Components

  1. Secure Legacy Interface:
    • Read-only access to sanitized COBOL extracts.
    • Compliance with GDPR and PCI-DSS via data redaction.
    • Versioned snapshots for consistent analysis.
  2. Context Preservation Engine:
    • Maps semantic relationships in COBOL programs.
    • Identifies business rule clusters.
    • Captures knowledge from code patterns.
  3. Multi-Agent Orchestration:
    • Analysis Agent: Extracts code structures.
    • Domain Agent: Interprets business logic.
    • Security Agent: Ensures compliance.
    • Generation Agent: Produces Java code.
    • Review Agent: Coordinates human validation.
  4. Human-AI Collaboration Interface:
    • SME validation workflows.
    • Visualizations of AI interpretations.
    • Audit trails for compliance.

4.2 Design Principles

| Principle | Implementation Hypothesis | Benefit | |———–|————————–|———| | Context Fidelity | Maintain semantic relationships | Preserve business logic | | Incremental Safety | Modular transformation with checkpoints | Reduce risk | | Collaborative Intelligence | Human-AI validation | Combine AI efficiency with expertise | | Protocol Extensibility | Built on MCP/A2A standards | Leverage existing infrastructure | | Audit Transparency | Traceability from source to output | Meet compliance needs |

5. Conceptual Application: Claims Processing 📊

Consider an insurance company’s COBOL-based claims system.

5.1 Workflow

  1. Context Discovery:
    • MCP agents access COBOL code and schemas.
    • Context engine maps dependencies.
    • Example COBOL snippet:
      IF CLAIM-TYPE = 'AUTO' AND DAMAGE-AMOUNT > 25000
         IF POLICY-YEARS < 3
            PERFORM HIGH-RISK-REVIEW
         ELSE
            IF CUSTOMER-CLAIMS-COUNT > 2
               PERFORM FRAUD-CHECK
            END-IF
         END-IF
      END-IF
      
    • LLM Output: “Risk assessment for auto claims over $25,000 based on policy tenure and claim history.”
  2. Multi-Agent Analysis:
    • Analysis Agent: Extracts control flows.
    • Domain Agent: Interprets rules using MCP-provided schemas (e.g., CLAIM-TYPE: STRING).
    • Security Agent: Flags compliance issues.
  3. Human Validation:
    • SMEs review AI interpretations via visualizations.
    • Approval workflows capture feedback.
  4. Modernization:
    • Generation Agent produces Java:
      @Component
      public class ClaimRiskAssessment {
          public ReviewDecision assessAutoClaimRisk(Claim claim, Policy policy, Customer customer) {
              if (claim.getType() == ClaimType.AUTO && claim.getDamageAmount() > 25000) {
                  if (policy.getYearsActive() < 3) {
                      return ReviewDecision.HIGH_RISK_REVIEW;
                  } else if (customer.getClaimCount() > 2) {
                      return ReviewDecision.FRAUD_CHECK;
                  }
              }
              return ReviewDecision.STANDARD_PROCESSING;
          }
      }
      
    • Review Agent validates equivalence.
  5. A2A Collaboration:
    • A2A delegates optimization to a specialized agent:
      {
        "AgentCard": {
          "id": "CodeOptimizerAgent",
          "capabilities": ["java_optimization"],
          "task_types": ["optimize_code"],
          "endpoint": "https://optimizer-agent.example.com/api"
        }
      }
      

5.2 Hypothetical Benefits

6. Research Questions 🔗

7. Research and Development Path 🛠️

  1. Proof of Concept: Test MCP extensions on small COBOL samples.
  2. Protocol Specification: Define MCAP standards and security frameworks.
  3. Community Validation: Open-source MCAP for industry feedback.

8. Market Context 📈

9. Conclusion and Call for Collaboration 🤝

MCAP offers a visionary approach to legacy modernisation, leveraging MCP and A2A to preserve context and ensure safety. We invite enterprise architects, AI researchers, and legacy experts to collaborate on validating this hypothesis. Share your insights on LinkedIn or contact us to explore this research direction.

References 💡