Enables static code analysis of GitHub repositories using Joern's Code Property Graph technology, supporting security analysis, code browsing, and dataflow analysis across multiple programming languages.
Provides static code analysis capabilities within VS Code through GitHub Copilot integration, enabling security analysis, taint flow detection, and code graph queries.
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., "@CodeBadger Toolkitfind taint flows in the current codebase"
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.
🦡 codebadger
A containerized Model Context Protocol (MCP) server providing static code analysis using Joern's Code Property Graph (CPG) technology with support for Java, C/C++, JavaScript, Python, Go, Kotlin, C#, Ghidra, Jimple, PHP, Ruby, and Swift.
Prerequisites
Before you begin, make sure you have:
Docker and Docker Compose installed
Python 3.10+ (Python 3.13 recommended)
pip (Python package manager)
To verify your setup:
Quick Start
1. Install Python Dependencies
2. Start the Docker Services (Joern)
This starts:
Joern Server: Static code analysis engine (runs CPG generation and queries)
Verify services are running:
3. Start the MCP Server
The MCP server will be available at http://localhost:4242.
4. Stop All Services
Cleanup Script
Use the provided cleanup script to reset your environment:
This will:
Stop and remove Docker containers
Kill orphaned Joern/MCP processes
Clear Python cache (
__pycache__,.pytest_cache)Optionally clear the playground directory (CPGs and cached codebases)
Integrations
GitHub Copilot Integration
Edit the MCP configuration file for VS Code (GitHub Copilot):
Path:
Example configuration:
Claude Code Integration
To integrate codebadger into Claude Desktop, edit:
Path:
Add the following:
Available Tools
Core Tools
Tool | Description |
| Generate a CPG for a codebase (from local path or GitHub URL) |
| Get status and existence of a CPG by |
| Execute raw CPGQL queries |
| Get CPGQL syntax documentation and examples |
Code Browsing Tools
Tool | Description |
| Get high-level codebase overview (files, methods, calls) |
| List source files in the codebase |
| Discover methods/functions with optional filtering |
| Find function call relationships |
| Get parameter information for a method |
| Retrieve method source code |
| Retrieve code snippets by file and line range |
| Build call graphs (incoming/outgoing) |
Semantic Analysis Tools
Tool | Description |
| Get control flow graph (nodes AND edges) for a method |
| Get struct/type definition with members |
| Detect potential macro calls using heuristics |
Taint Analysis Tools
Tool | Description |
| Locate external input points (getenv, malloc, read, etc.) |
| Locate dangerous sinks (memcpy, system, free, etc.) |
| Find dataflow paths (source→sink, source-only, or sink-only) |
| Track variable assignments and data dependencies |
Advanced Analysis Tools
Tool | Description |
| Build backward program slices from a call |
| Find bounds checks near buffer accesses |
Contributing & Tests
Thanks for contributing! Here's a quick guide to get started with running tests and contributing code.
Prerequisites
Python 3.10+ (3.13 is used in CI)
Docker and Docker Compose (for integration tests)
Local Development Setup
Create a virtual environment and install dependencies
Start Docker services (for integration tests)
Run unit tests
Run integration tests (requires Docker Compose running)
Run all tests
Cleanup after testing
Code Contributions
Please follow these guidelines when contributing:
Follow repository conventions
Write tests for behavioral changes
Ensure all tests pass before submitting PR
Include a clear changelog in your PR description
Update documentation if needed
Configuration
The MCP server can be configured via environment variables or config.yaml.
Environment Variables
Key settings (optional - defaults shown):
Config File
Create a config.yaml from config.example.yaml:
Then customize as needed.