convez.ai
MCP ServerDevOps & InfraestruturaAvançado
akhilsinghcodes

JIDRA - Backend de Contexto Java para LLMs

akhilsinghcodes/jidra

Indexação de grafos Java com redução de 87-95% em tokens para LLM

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que indexa grafos de chamadas em codebases Java, valida contra beans Spring em tempo de execução, e gera contexto estruturado e mínimo para análise por LLMs. Reduz tokens em 87-95% mantendo cobertura total da lógica de negócio.

Instalação

$npx convez-ai akhilsinghcodes/jidra

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 mês
Versão
—
Issues abertas
0
Contribuidores
2

Casos de uso

  • Análise de codebase Java com Claude mantendo context reduzido
  • Rastreamento de fluxos de chamadas e dependências em projetos Spring Boot
  • Diagnóstico de erros em lógica de negócio complexa com IA

Veredito

JIDRA é uma solução robusta para times que trabalham com codebases Java grandes e precisam economizar tokens ao usar LLMs para análise. A validação contra Spring Actuator e a redução comprovada de contexto (87-95%) o tornam production-ready, mas exige conhecimento técnico de Java, Spring e Docker para máximo aproveitamento.

README

A tradução para o português deste README ainda está na fila.

JIDRA: Enterprise Java Context Backend for LLM Workflows

License: MIT Python 3.9+ Production Ready

JIDRA reduces LLM token costs by 87-95% while maintaining 100% business logic coverage.

Overview

JIDRA is a structured context backend that extracts Java call graphs, validates them against runtime Spring beans, and generates minimal, noise-free context for LLM analysis.

Real Results

Traditional Approach:  10,811 input tokens (raw source)
JIDRA Approach:          869 input tokens (structured graph)
Result:               ✅ 95.9% reduction + equal output quality

Key Features

  • ✅ Static Java Call Graph Extraction - AST-based parsing
  • ✅ Spring Actuator Validation - Remove 71-78% phantom edges with runtime bean confirmation
  • ✅ 87-95% Token Reduction - Proven on real Claude API calls
  • ✅ Zero False Negatives - 100% business logic coverage
  • ✅ Docker Integration - Auto-managed Spring Boot validation
  • ✅ Interactive Visualization - Vis.js-based graph explorer
  • ✅ MCP Integration - Direct Claude integration via tools

Quick Start

Installation

# Clone repository
git clone https://github.com/akhilsinghcodes/jidra.git
cd jidra

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

Basic Usage

# Index a Java codebase
jidra index --codebase /path/to/java/project --output ./results

# Validate with Spring Actuator
jidra validate --codebase /path/to/java/project --port 8080

# Generate minimal context for LLM
jidra context --graph results/graph.jsonl --method "com.example.MyClass#method"

# Visualize the call graph
jidra graph-view --graph results/graph.jsonl --output graph.html

Architecture

Core Components

ModulePurpose
extractor.pyJava AST parsing (38 KB)
cli.pyCommand-line interface (66 KB)
actuator_client.pyDocker + Spring Actuator integration
graph_validator.pySpring bean validation
flow_stitcher.pyRecursive business flow extraction
graph_visualizer.pyInteractive HTML visualization
mcp_server.pyClaude MCP server
llm_client.pyLiteLLM integration

Data Flow

Java repo
  ↓
Extraction (AST parsing)
  ↓
graph.jsonl (static call graph)
  ↓
Spring Actuator Validation (Docker)
  ↓
graph_validated.jsonl (71-78% cleaner)
  ↓
Context Generation
  ↓
87-95% smaller context for LLM

CLI Commands

jidra index

Build a static call graph from Java source.

jidra index --codebase /path/to/repo --output ./results

Output:

  • graph.jsonl - Full call graph
  • graph_test.jsonl - Test code graph

jidra validate

Validate graph against Spring Actuator beans (requires Docker).

jidra validate --codebase /path/to/repo --port 8080 --timeout 300

Output:

  • graph_validated.jsonl - Filtered, verified graph
  • validation_report.json - Metrics and statistics

jidra context

Extract minimal method context for LLM analysis.

jidra context --graph graph.jsonl --method "com.example.MyClass#myMethod" --max-chars 5000

jidra flow

Trace and extract business flow.

jidra flow --graph graph.jsonl --method "com.example.MyClass#myMethod" --depth 3

jidra graph-view

Generate interactive visualization.

jidra graph-view --graph graph.jsonl --output graph.html

MCP Integration (Claude)

Use JIDRA with Claude via Model Context Protocol:

# MCP tools available
- jidra_get_method_context      # Get local method scope
- jidra_get_flow                # Get full stitched flow  
- jidra_get_agent_flow          # Get compact agent view
- jidra_get_method_source       # Retrieve source code
- jidra_get_call_chain          # Find paths between methods

Configuration

Edit src/jidra/config.yaml:

llm_profiles:
  default:
    provider: litellm
    model: claude-opus-4-7
    max_tokens: 4096
    temperature: 0.7

Project Structure

jidra/
├── src/jidra/                  # Main package
│   ├── models.py               # Data models
│   ├── cli.py                  # CLI interface
│   ├── engine.py               # Reasoning backend
│   ├── extractor.py            # Java parser
│   ├── graph_validator.py      # Validation
│   ├── actuator_client.py      # Docker integration
│   └── ... (18 more modules)
├── tests/                       # Test suite
├── docs/                        # Documentation
├── examples/                    # Usage examples
├── .github/workflows/           # CI/CD
├── setup.py                     # Package metadata
├── requirements.txt             # Dependencies
├── README.md                    # This file
├── LICENSE                      # MIT License
└── .gitignore                   # Git ignore

Requirements

  • Python: 3.9+
  • Java: 11+ (for parsing)
  • Docker: Required for Spring Actuator validation
  • Dependencies: See requirements.txt

Use Cases

1. Cost Reduction

# Reduce LLM token usage by 87-95%
# Example: 1,000 methods/month
# Traditional: $15/month → JIDRA: $0.15/month

2. LLM-Powered Code Analysis

# Generate graph
jidra index --codebase .

# Extract context
jidra context --graph graph.jsonl --method "Controller#handler"

# Feed to Claude for analysis

3. Enterprise Validation

# Ensure graph matches runtime
jidra validate --codebase . --port 8080

# Result: Only real, confirmed bean calls remain

Proven Results

Token Reduction (Real Claude API)

ProjectTypeTraditionalGraphReduction
searchProprietary10,81186995.9%
Spring PetclinicPublic2,736-5,304320-38387.4%

Safety Metrics

  • Business Logic Coverage: 100% (all business calls captured)
  • False Negatives: 0% (no missing logic)
  • False Positives Removed: 71-78% (via Spring Actuator)
  • Output Quality: Identical across approaches

Installation

From Source

git clone https://github.com/your-username/jidra.git
cd jidra
pip install -e .

From PyPI

pip install jidra

Testing

# Run test suite
pytest tests/

# Run with coverage
pytest --cov=src/jidra tests/

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -am 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - See LICENSE file for details.

Support

Citation

If you use JIDRA in your research or production systems, please cite:

@software{jidra2026,
  title = {JIDRA: Enterprise Java Context Backend for LLM Workflows},
  author = {JIDRA Contributors},
  year = {2026},
  url = {https://github.com/your-username/jidra}
}

JIDRA: Reduce LLM token costs by 87-95%. Production-ready. Open-source.

Ver o original no GitHub

Bom para

Relacionados