codeparse-mcp
Enables GitHub Copilot to generate unit tests with full MC/DC coverage for Java/Xtend code by providing code structure, control flow, and MC/DC conditions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codeparse-mcpget UT context for class MyService"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codeparse-mcp
Java/Xtend Code Parser → IR → Graph DB → MCP Server Knowledge base for AI-driven ISO 26262 ASIL-D unit test generation with 100% MC/DC + C0 + C1 coverage.
Architecture (v3)
Java/Xtend Sources
│
├── JavaParser AST Extractor (Java CLI, production)
│ └── Decision IR (JSON, camelCase)
│ │
├── Xtend AST Extractor (line-based POC)
│ └── Decision IR (JSON, camelCase)
│ │
├── Fallback JS Java Parser (java-parser npm CST)
│ └── Decision IR (JSON, camelCase)
│ │
└── Fallback JS Xtend Parser (pattern-based)
└── Decision IR (JSON, camelCase)
│
▼
┌─────────────────────┐
│ ir-ingest.js │
│ Validate IR schema │
│ Compute MC/DC │
│ (centralized, not │
│ duplicated per │
│ parser) │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ SQLite Graph DB │
│ (better-sqlite3) │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ MCP Server │
│ 20 tools via stdio │
│ Compatible with: │
│ • GitHub Copilot │
│ • Claude Desktop │
│ • Any MCP client │
└─────────────────────┘Key design: AI reads MCP only — never reads raw IR or source files directly. IR is an internal transport format.
Related MCP server: Orihime
Quick Start
Local
git clone <repo>
cd codeparse-mcp
npm install
# Initialize DB for your project
node src/cli/index.js init --root /path/to/your/project
# Parse all Java/Xtend files
node src/cli/index.js sync --root /path/to/your/project
# Check status
node src/cli/index.js statusDocker
docker build -t codeparse-mcp:latest .
# Init DB
docker run --rm \
-v /your/project:/project:ro \
-v codeparse-data:/data \
codeparse-mcp:latest init
# Sync
docker run --rm \
-v /your/project:/project:ro \
-v codeparse-data:/data \
codeparse-mcp:latest sync
# Status
docker run --rm \
-v /your/project:/project:ro \
-v codeparse-data:/data \
codeparse-mcp:latest status
# Or with docker compose
PROJECT_ROOT=/your/project docker compose run --rm codeparse syncCLI Commands
Command | Description |
| Initialize/reset graph database |
| Parse all files, sync changes only |
| Show graph stats and health |
| Sync a single file (incremental) |
| Import JUnit/JaCoCo results |
| Generate ISO 26262 evidence package |
Sync Options
codeparse sync \
--force # Re-parse all files
--include "**/*.java,**/*.xtend" # Custom patterns
--exclude "**/generated/**" # Extra exclusions
--verbose # Per-file progressImport Test Results
# Import JUnit XML + JaCoCo coverage
codeparse import-results \
--junit build/test-results/test # JUnit Surefire XML dir
--jacoco build/reports/jacoco/test/jacoco.xmlGenerate Evidence Package
codeparse evidence \
--asil D \
--class com.example.SafetyController \
--output evidence/Generates 10-file ISO 26262 evidence package:
Decision list, MC/DC matrix, test mapping, traceability matrix
Coverage gap analysis, audit summary, test specification
Requirements cross-reference, review checklist, compliance report
MCP Integration
GitHub Copilot (.vscode/mcp.json)
{
"servers": {
"codeparse": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/src/mcp/server.js"]
}
}
}Claude Desktop (claude_desktop_config.json)
See config/claude-desktop-mcp.json for full example.
MCP Tools (20 total)
Lifecycle
Tool | Description |
| Initialize/reset DB |
| Parse and sync all files |
| DB health and statistics |
| Sync a single file |
Class Queries
Tool | Description |
| Full class info (fields, hierarchy, annotations, ASIL) |
| Find classes by name pattern |
Method Queries
Tool | Description |
| All methods for a class |
| Find methods by name/signature |
| Full source context: code, fields, calls, decisions, parse quality |
Control Flow Graph
Tool | Description |
| CFG nodes + edges for a method (C0/C1 coverage) |
| All decisions with decomposed atomic conditions (decision-UID scoped) |
MC/DC (ISO 26262 ASIL-D)
Tool | Description |
| MC/DC conditions, truth tables, independence pairs per method |
| All MC/DC data for entire class |
Call Graph
Tool | Description |
| Methods called by a method (mock targets) |
| Methods that call a method (impact analysis) |
UT Generation (primary AI workflow)
Tool | Description |
| Primary tool — full context: class + methods + CFG + MC/DC + field accesses + boundary hints + mock targets in one call |
| Import dependencies for a file |
Evidence & Coverage (v2.5)
Tool | Description |
| Import JUnit XML + JaCoCo XML coverage data |
| Query line/branch/instruction coverage per class/method |
| Generate 10-file ISO 26262 evidence package |
What Gets Parsed
Java
Package and import declarations
Class/interface/enum/annotation declarations (nested included)
All modifiers, annotations, Javadoc
Method signatures, parameters, return types, throws
Field declarations with types and visibility
CFG: if/for/while/do/switch/try/catch/return/throw/break/continue nodes and edges
MC/DC: boolean condition decomposition via AST tree parser, truth tables, independence pairs
else ifkind detection (not plainif)Call graph: method invocations with line numbers
Field access tracking (reads and writes via
this./obj.)ASIL level detection from
@ASIL_Dannotations or/** @ASIL D */JavadocException types on CATCH/THROW CFG nodes
Ternary expressions (
cond ? a : b) as decisions
Xtend
Package, import, class declarations
def,override,dispatchmethodsval/varfields + Java-style fieldsAll visibility modifiers
CFG: if/for/while/do/switch/try/catch/return/throw (pattern-based) with loop body edges
MC/DC analysis on boolean expressions
Balanced-parenthesis condition extraction (handles nested parens)
Extension method detection
«IF»/«ELSEIF»template condition parsingTernary expressions with nested ternary support
ASIL annotation detection
Graph DB Schema
The SQLite database stores:
files → source file registry + SHA-256 for change detection
packages → Java package index
classes → class/interface/enum with full metadata + ASIL level
methods → method signatures + CFG stats + MC/DC summary + ASIL level
fields → class fields
cfg_nodes → CFG nodes per method (ENTRY, STATEMENT, BRANCH, LOOP, CATCH, THROW, ...)
cfg_edges → CFG edges (sequential, true_branch, false_branch, exception, loop_back)
call_edges → caller → callee relationships
field_accesses → per-method field read/write tracking (mock/state setup)
dependencies → file-level import and type dependencies
decisions → each branch point (if/while/for/ternary/etc.) with expression
conditions → atomic conditions decomposed from decisions (condition-UID scoped)
mcdc_conditions → expanded MC/DC with truth tables and independence pairs
mcdc_pairs → normalized per-condition independence pairs with test vectors
test_cases → test-to-target method traceability
test_results → JUnit execution results (from Surefire XML)
coverage_records → JaCoCo line/branch/instruction coverage
evidence_log → evidence package generation tracking
parse_errors → per-file error logEvidence Export Package (v2.5)
The export_evidence_plan MCP tool (or codeparse evidence CLI) generates 10 ISO 26262 evidence files:
File | Content |
| All decisions with UIDs, kind, expression, conditions |
| MC/DC independence pairs per condition |
| Test cases mapped to decisions/conditions |
| Requirements → decisions → tests |
| Uncovered branches/pairs analysis |
| Audit trail with timestamps |
| Generated test specification |
| ISO 26262 requirement cross-reference |
| Peer review checklist |
| ASIL-D compliance summary |
Incremental Sync
Files tracked by SHA-256 hash. On each sync:
New files → parsed and inserted
Changed files → deleted from DB (cascade) and re-parsed
Unchanged files → skipped (fast)
Call graph → second-pass resolution of caller→callee IDs
Content hash prevents re-parsing identical files on repeated runs
Safe to run on every save or in CI without performance penalty.
Extractor Chain (Auto-Fallback)
When parsing a file, the system tries in order:
Java AST Extractor (
extractors/java/) — Java CLI tool using JavaParser library, produces full IRXtend AST Extractor (
extractors/xtend/) — line-based POC, template_if/elseif/ternary supportFallback JS parser —
java-parser.js(CST via npm) orxtend-parser.js(pattern-based)
Extractors produce camelCase IR JSON. Fallback runs if Java is not available.
MC/DC pair computation is centralized in ir-ingest.js — not duplicated per parser.
Configuration (.codeparse.json)
{
"projectRoot": "/path/to/project",
"dbPath": "/path/to/.codeparse/graph.db",
"include": ["**/*.java", "**/*.xtend"],
"exclude": [
"**/node_modules/**",
"**/build/**",
"**/target/**",
"**/.gradle/**",
"**/generated/**"
]
}Environment variable override (for Docker): CODEPARSE_PROJECT_ROOT, CODEPARSE_DB_PATH.
Extending: Add More Languages
Add parser in
src/parser/<lang>-parser.jsexportingparse<Lang>(source, path)→{ packageName, imports, classes }Add AST extractor in
extractors/<lang>/producing camelCase IR JSONAdd extension to
includeglobs in configRegister parsing branch in
src/graph/builder.jssyncProjectswitchIR ingest in
src/graph/ir-ingest.jshandles MC/DC automatically
Known Gaps (P3)
No lambda/stream support —
.filter().map()logic invisible to CFGNo switch expressions (Java 17+
->arrow cases)No
dispatchmethod support in Xtend parserNo Xtend extension method resolution
No JML/pre-post condition parsing
No requirement/safety-goal traceability table in schema
Requirements
Node.js ≥ 20
Or Docker (no Node required on host)
SQLite (bundled via better-sqlite3)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/khuongtt/codeparse-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server