codebadger
by Lekssays
Overview
A containerized Model Context Protocol (MCP) server providing static code analysis using Joern's Code Property Graph (CPG) technology.
Installation
python main.py &Environment Variables
- MCP_HOST
- MCP_PORT
- MCP_LOG_LEVEL
- JOERN_BINARY_PATH
- JOERN_JAVA_OPTS
- JOERN_SERVER_HOST
- JOERN_SERVER_PORT
- JOERN_SERVER_AUTH_USERNAME
- JOERN_SERVER_AUTH_PASSWORD
- JOERN_CONTAINER_NAME
- CPG_GENERATION_TIMEOUT
- MAX_REPO_SIZE_MB
- QUERY_TIMEOUT
- QUERY_CACHE_ENABLED
- QUERY_CACHE_TTL
- WORKSPACE_ROOT
- CLEANUP_ON_SHUTDOWN
Security Notes
The server has critical security vulnerabilities. Specifically, tools like `get_method_source` and `get_code_snippet` construct file paths using user-provided `filename` parameters without sufficient path traversal validation. This allows an attacker to use `../` sequences in the `filename` to escape the intended codebase directory and potentially read arbitrary files from the host filesystem (since the Python server runs on the host and mounts the playground directory). The `find_bounds_checks` tool also interpolates user-provided `filename` directly into a Scala query, which could lead to path traversal vulnerabilities if Joern's internal file resolution doesn't fully sanitize it. The `run_cpgql_query` tool explicitly allows execution of arbitrary CPGQL queries, posing a risk of system information disclosure or manipulation within the sandboxed (but powerful) Joern environment, despite some basic input validation. The default server configuration listens on `0.0.0.0` (all network interfaces) and maps a wide range of ports (2000-2999) from the Docker container to the host, increasing the network attack surface.
Similar Servers
ls-mcp
Command-line tool for discovering, analyzing, and reporting on Model Context Protocol (MCP) server configurations in a local development environment.
mcp-reference
A reference processing tool for Markdown documents, providing automated reference extraction, citation renumbering, bibliography generation, and related literature recommendation functions, integrated via Model Context Protocol (MCP) into Trae IDE.
firemcp
Enables AI agents and LLMs to securely interact with Firestore databases through a Model Context Protocol (MCP) server, offering complete CRUD and query operations.
gemini-daily-mcp-compressed
Provides a token-optimized API server for integrating Google Gemini CLI with applications like Claude, focusing on reducing tool schema overhead for cost efficiency.