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 → Graph DB → MCP Server
Knowledge base for AI-driven ISO 26262 ASIL-D unit test generation with 100% MC/DC + C0 + C1 coverage.
Architecture
Java/Xtend Sources
│
▼
┌─────────────┐ ┌──────────────────┐
│ Java Parser │ │ Xtend Parser │
│ (java-parser│ │ (pattern-based │
│ npm, CST) │ │ + CFG analyzer) │
└──────┬──────┘ └────────┬─────────┘
│ │
▼ ▼
┌──────────────────────────────────┐
│ Graph Builder │
│ AST → Classes, Methods, │
│ Fields, CFG Nodes/Edges, │
│ Call Graph, MC/DC Conditions │
└──────────────┬───────────────────┘
│
▼
┌──────────────────────────────────┐
│ SQLite Graph DB │
│ files / classes / methods / │
│ cfg_nodes / cfg_edges / │
│ call_edges / mcdc_conditions │
└──────────────┬───────────────────┘
│
▼
┌──────────────────────────────────┐
│ MCP Server │
│ 14 tools exposed via stdio │
│ Compatible with: │
│ • GitHub Copilot │
│ • Claude Desktop │
│ • Any MCP client │
└──────────────────────────────────┘Related MCP server: Orihime
Quick Start
Option A: Node.js (local)
# Install
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 statusOption B: Docker
# Build image
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 (parse all files)
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) |
| Start MCP server on stdio |
Sync Options
codeparse sync \
--force \ # Re-parse all files
--include "**/*.java,**/*.xtend" \ # Custom patterns
--exclude "**/generated/**" \ # Extra exclusions
--verbose # Per-file progressMCP Integration
GitHub Copilot (.vscode/mcp.json)
{
"servers": {
"codeparse": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/src/mcp/server.js"]
}
}
}Or via Docker:
{
"servers": {
"codeparse": {
"type": "stdio",
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "${workspaceFolder}:/project:ro",
"-v", "codeparse-data:/data",
"codeparse-mcp:latest", "serve"
]
}
}
}Claude Desktop (claude_desktop_config.json)
See config/claude-desktop-mcp.json for the full example.
MCP Tools
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 |
Control Flow Graph
Tool | Description |
| CFG nodes + edges for a method (C0/C1 coverage) |
MC/DC (ISO 26262 ASIL-D)
Tool | Description |
| MC/DC conditions, truth tables, independence pairs for a 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) |
UT Generation
Tool | Description |
| Primary tool — full context for AI UT generation: class + methods + CFG + MC/DC + mock targets |
| Import dependencies for a file |
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 nodes and edges
MC/DC: boolean condition decomposition, truth tables, independence pairs
Call graph: method invocations with line numbers
ASIL level detection from
@ASIL_Dannotations or/** @ASIL D */Javadoc
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)
MC/DC analysis on boolean expressions
Extension method detection
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
methods → method signatures + CFG stats + MC/DC summary
fields → class fields
cfg_nodes → CFG nodes per method (ENTRY, STATEMENT, BRANCH, LOOP, RETURN, ...)
cfg_edges → CFG edges (sequential, true_branch, false_branch, exception, loop_back)
call_edges → caller → callee relationships
dependencies → file-level import and type dependencies
mcdc_conditions → expanded MC/DC conditions with truth tables and independence pairs
parse_errors → per-file error logExample: AI UT Generation Workflow
1. User asks Copilot/Claude: "Generate unit tests for com.safety.BrakeController"
2. AI calls: get_ut_context { qualifiedName: "com.safety.BrakeController" }
3. Response includes:
- Class metadata + ASIL-D level
- All 12 methods with parameters and signatures
- CFG for each method (C0/C1 coverage map)
- MC/DC conditions with independence pairs (ASIL-D 100% target)
- Mock targets (callees to stub)
- Estimated minimum 47 test cases needed
4. AI generates JUnit 5 test class covering:
- All statement paths (C0)
- All branch pairs (C1)
- All MC/DC independence pairs
- ASIL-D annotation on each testConfiguration (.codeparse.json)
{
"projectRoot": "/path/to/project",
"dbPath": "/path/to/.codeparse/graph.db",
"include": ["**/*.java", "**/*.xtend"],
"exclude": [
"**/node_modules/**",
"**/build/**",
"**/target/**",
"**/.gradle/**",
"**/generated/**"
]
}Incremental Sync
Files are 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
This means sync is safe to run on every save or in CI without performance penalty.
Extending: Add More Languages
Add a parser in
src/parser/<lang>-parser.jsimplementingparse<Lang>(source, path)Return
{ packageName, imports, classes }matching the existing schemaAdd the extension to
includeglobs in configRegister in
src/graph/builder.jssyncProjectswitch
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
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