Skip to main content
Glama
Joern MCP Server
by sfncat

Joern MCP 서버

Joern을 위한 간단한 MCP 서버입니다.

프로젝트 소개

이 프로젝트는 Joern을 기반으로 한 MCP 서버로, 개발자의 코드 검토 및 보안 분석에 도움이 되는 다양한 기능을 제공합니다.

Related MCP server: codebadger

환경 요구 사항

  • Python >= 3.10(기본값 3.12) & uv

  • 조른

설치 단계

  1. 프로젝트를 로컬로 복제합니다.

    지엑스피1

  2. Python 종속성을 설치하세요:

    uv venv .venv
    source .venv/bin/activate
    uv sync

프로젝트 구조

├── server.py                       # MCP Server main program
├── test_mcp_client.py              # Test program for joern server and mcp tool
├── test_sc_tools.py                # Direct test program for sc tools
├── common_tools.py                 # Common utility functions
├── server_tools.py                 # Server utility functions
├── server_tools.sc                 # Scala implementation of server utility functions
├── server_tools_source.sc          # Scala implementation of server utility functions,use sourceCode to get the source code of method
├── requirements.txt                # Python dependency file
├── sample_cline_mcp_settings.json  # Sample cline mcp configuration file
└── env_example.txt                 # Environment variables example file

용법

  1. Joern 서버를 시작합니다.

    joern -J-Xmx40G --server --server-host 127.0.0.1 --server-port 16162 --server-auth-username user --server-auth-password password --import server_tools.sc
    Or
    joern -J-Xmx40G --server --server-host 127.0.0.1 --server-port 16162 --server-auth-username user --server-auth-password password --import server_tools_source.sc
  2. env_example.txt를 .env로 복사합니다. joern 서버 시작 구성과 일치하도록 구성 정보를 수정합니다.

  3. 테스트 연결을 실행합니다. test_mcp_client.py 의 정보를 수정하여 joern 서버가 제대로 작동하는지 확인합니다.

    uv run test_mcp_client.py
    Starting MCP server test...
    ==================================================
    Testing server connection...
    [04/16/25 20:38:54] INFO     Processing request of type CallToolRequest                                                                                                                     server.py:534
    Connection test result: Successfully connected to Joern MCP, joern server version is XXX
  4. MCP 서버 구성 cline에서 mcp 서버를 구성하려면 sample_cline_mcp_settings.json 을 참조하세요.

  5. MCP 서버를 사용하여 대규모 언어 모델에 질문을 던지고 prompts_en.md 를 참조하세요.

개발 노트

  • .env 파일은 환경 변수를 저장하는 데 사용됩니다.

  • .gitignore 파일은 Git 버전 제어에서 무시할 파일을 정의합니다.

  • pyproject.toml 프로젝트에 대한 Python 구성을 정의합니다.

  • MCP 도구 개발

    • server_tools.sc 에 구현하고, server_tools.py 에 정의를 추가하고, test_mcp_client.py 에 테스트를 추가합니다.

기여 지침

프로젝트 개선에 도움이 되는 이슈와 풀 리퀘스트를 제출해 주세요.

더 많은 도구를 추가해 보세요.

참고문헌

https://github.com/flankerhqd/jebmcp

https://docs.joern.io/server/

https://docs.joern.io/interpreter/

Available Tools

18 tools
check_connectionB

Check if the Joern MCP plugin is running

Inputs: no named parameters.

get_call_code_by_idA

Get the source code of a specific call node from the loaded CPG by the call id

@param id: The unique identifier of the call node, the id is a Long int string, like '111669149702L'
@return: The source code of the specified call

Inputs: code_id (required).

get_calls_in_method_by_method_full_nameC

Get the calls info by the method full name which the call is in the method

@param method_full_name: The full name of the method
@return: The calls info of the method

Inputs: method_full_name (required).

get_class_full_name_by_idB

Retrieves the fully name of a class by its ID

@param id: The unique identifier of the class (typeDecl), the id is a Long int string, like '111669149702L'
@return: The fully name of the class (e.g., com.android.nfc.NfcService$6)

Inputs: class_id (required).

get_class_methods_by_class_full_nameB

Get the methods of a class by its fully qualified name

@param class_full_name: The fully qualified name of the class
@return: List of full name, name, signature and id of methods in the class

Inputs: class_full_name (required).

get_derived_classes_by_class_full_nameB

Get the derived classes of a class

@param class_full_name: The fully qualified name of the class
@return: The derived classes info of the class, including the full name, name and id

Inputs: class_full_name (required).

get_helpB

Get help information from joern server

Inputs: no named parameters.

get_method_by_call_idC

Get the method info by the call id which the call is in the method

@param id: The id of the call
@return: The method info of the call

Inputs: call_id (required).

get_method_calleesB

Retrieves a list of methods info that are called by the specified method

@param method_full_name: The fully qualified name of the source method(e.g., com.android.nfc.NfcService$6.onReceive:void(android.content.Context,android.content.Intent)) @return: List of full name, name, signature and id of methods which call the source method

Inputs: method_full_name (required).

get_method_callersA

Retrieves a list of methods that call the specified method

@param method_full_name: The fully qualified name of the source method(e.g., com.android.nfc.NfcService$6.onReceive:void(android.content.Context,android.content.Intent))
@return: List of full name, name, signature and id of methods called by the source method

Inputs: method_full_name (required).

get_method_code_by_class_full_name_and_method_nameA

Get the code of a method by its class full name and method name, this tool is usually used when you don't know the full name of the method, but you know the full name of the class and the name of the method. If there are multiple methods with the same name in the class, the code of all methods will be returned.

@param class_full_name: The fully qualified name of the class, like 'com.android.nfc.NfcService'
@param method_name: The name of the method, like 'onReceive'
@return: List of full name, name, signature and id of methods in the class

Inputs: class_full_name (required), method_name (required).

get_method_code_by_full_nameA

Get the code of a method by its fully name, If you know the full name of the method, you can use this tool to get the method code directly. If you only know the full name of the class and the name of the method, you should use get_method_code_by_class_full_name_and_method_name @param method_full_name: The fully qualified name of the method (e.g., com.android.nfc.NfcService$6.onReceive:void(android.content.Context,android.content.Intent)) @return: The source code of the specified method

Inputs: method_full_name (required).

get_method_code_by_idC

Get the code of a method by its class full name and method name

@param class_full_name: The fully qualified name of the class
@param method_name: The name of the method
@return: List of full name, name, signature and id of methods in the class

Inputs: method_id (required).

get_method_full_name_by_idA

Retrieves the fully qualified name of a method by its ID

@param id: The unique identifier of the method, the id is a Long int string, like '111669149702L'
@return: The fully qualified name of the method (e.g., com.android.nfc.NfcService$6.onReceive:void(android.content.Context,android.content.Intent))

Inputs: method_id (required).

get_parent_classes_by_class_full_nameB

Get the parent classes of a class

@param class_full_name: The fully qualified name of the class
@return: The parent classes info of the class, including the full name, name and id

Inputs: class_full_name (required).

get_referenced_method_full_name_by_call_idC

Get the method info by the call id which the call is referenced the method

@param id: The id of the call
@return: The method info of the call

Inputs: call_id (required).

load_cpgB
Loads a CPG from a file if the cpg is not loaded or the cpg is not the same as the filepath.

Args:
    cpg_filepath (str): The path to the CPG file, the filepath is absolute path.

Returns:
    str: True if the CPG is loaded successfully, False otherwise.

Inputs: cpg_filepath (required).

pingA

Checks if the Joern server is running and responsive by querying its version

@return: The Joern server version if successful, 'Query Failed' if the server is not responding

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 18 tools

    Disambiguation3/5

    The tools have clear purposes but significant overlap exists. For example, get_method_code_by_full_name, get_method_code_by_class_full_name_and_method_name, and get_method_code_by_id all retrieve method code with different input parameters, which could confuse agents about which to use. However, descriptions help clarify the distinctions, preventing complete ambiguity.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern (e.g., get_call_code_by_id, get_method_by_call_id), with minor deviations like check_connection and ping (which are simpler verbs). The naming is generally predictable and readable, though not perfectly uniform across all tools.

    Tool Count4/5

    With 18 tools, the count is slightly high but reasonable for a code analysis server like Joern, which needs to handle various CPG queries. It covers multiple aspects (methods, classes, calls, loading), though it might feel a bit heavy compared to more focused servers.

    Completeness5/5

    The tool set provides comprehensive coverage for querying a CPG, including loading, checking connections, and retrieving details on calls, methods, and classes with full lifecycle support (e.g., get, list, derive, parent). No obvious gaps are present for its intended domain of static code analysis.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and LLMs to build Joern Code Property Graphs from repositories, paths, or snippets and query them over MCP for CPGQL queries, data-flow and taint tracing, program slicing, and vulnerability hunting across many languages. It scales to large analysis batches with per-CPG worker pools, memory-aware scheduling, and a Postgres/Redis backend.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      A containerized MCP server that enables AI agents and LLMs to build and query Joern Code Property Graphs from Git repositories, local paths, or pasted snippets, exposing CPGQL queries, data-flow and taint tracing, program slicing, and vulnerability hunting across many languages. It scales to large analysis batches with worker pools, memory-aware scheduling, and a Postgres/Redis backend.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      This MCP server builds Joern Code Property Graphs from a Git repository, local path, or pasted snippet and exposes them over MCP, letting AI agents run CPGQL queries, trace data flow and taint, slice programs, and hunt for vulnerabilities across many languages.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and LLMs to build Joern Code Property Graphs from repositories, local paths, or snippets and query them over MCP for program analysis, data-flow and taint tracing, program slicing, and vulnerability hunting across many languages.
      -