# COBOL Support in Maguyva: Dependency Analysis for Legacy Modernization

Canonical source: https://maguyva.ai/languages/cobol

License: text under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/); code samples under [MIT-0](https://opensource.org/license/mit-0); the Maguyva name, logos, brand assets and other code are not covered. Details: [maguyva.ai/license](https://maguyva.ai/license).

Maguyva supports COBOL with AST parsing and symbol extraction so AI agents can map program structure, copybook usage, and dependency paths before modernization or refactoring work.

## Support snapshot

- Tier: AST and symbol support
- Programming
- Extensions: .cbl, .cob, .cpy
- Real AST parsing for syntax-aware search and structural context.
- Named symbols feed semantic lookup and cross-reference. Graph navigation is available when relationship extraction is enabled.
- This language contributes symbols and relationships to graph-aware search; supported edge types vary with its native constructs.
- AST parsing and symbol extraction are both available.

## Best fit

- Modernization teams working around COBOL systems that still run important business processes.
- Repositories or extracted codebases where copybooks, batch logic, and procedural flow need to be mapped before change.
- Agent-assisted discovery work where the first goal is understanding and documenting a legacy estate, not rewriting it blindly.

## Agent workflows

- Map program and copybook relationships before planning a modernization step.
- Identify which routines or data definitions are touched by a proposed change.
- Give engineers a safer starting point for documentation, migration, or refactor planning.

## Why COBOL is a meaningful fit for Maguyva

Anyone can claim AI support for modern app languages. COBOL is more useful because it forces the product to be honest about what it is good for. In legacy code, the value is not fast generation. It is discovery, dependency mapping, careful review, and modernization planning.

If Maguyva is useful in COBOL, it is because it helps engineers understand a system that still matters before they try to move it.

## What Maguyva actually extracts in COBOL

Maguyva covers `.cbl`, `.cob`, and `.cpy`, so copybooks can stay in the same search surface as programs. It also strips wrapper quotes and parentheses from call targets during relationship analysis, which matters in COBOL codebases where those wrappers are common enough to make naive text matching noisy.

For object-oriented COBOL, Maguyva extracts class inheritance. It also links method overrides when the parent and child classes are defined in the same source file. Class-qualified method names distinguish the overriding method from its parent, helping an agent inspect inherited behavior before changing a class.

## Useful MCP workflows for modernization discovery

The best entry points are discovery-oriented:

- `get_task_context` for prompts like "trace copybook usage in customer batch update flow."
- `text_pattern_search` for program names, copybook names, and stable batch entry points.
- `dependency_search` after you identify a shared routine or definition and need to see where it is used.

## When this page is useful

This page is for legacy-code discovery and modernization planning, not code generation. If your estate mixes COBOL with newer service layers, compare it with [Java](/languages/java) or [C#](/languages/csharp). If you only need the support matrix, use [compatibility](/docs/compatibility).

## Engine details

- COBOL support includes `.cbl`, `.cob`, and `.cpy`, so copybooks can stay in the same search surface as programs.
- Quoted call targets are normalized by stripping wrapper quotes and parentheses before relationship analysis.
- Object-oriented COBOL supports class inheritance. Method overrides use class-qualified names when parent and child classes are defined in the same source file.

## Useful MCP entry points

- `get_task_context`: Start here for discovery prompts like “trace copybook usage in customer batch update flow.”
- `text_pattern_search`: Use it for program names, copybook names, and batch entry points when terminology is stable.
- `dependency_search`: Use it after you identify a routine or shared definition and want to see where it is used.
