Skip to main content

A simple Joern MCP Server.

Project description

Joern MCP Server

A simple MCP Server for Joern.

Project Introduction

This project is an MCP Server based on Joern, providing a series of features to help developers with code review and security analysis.

Environment Requirements

  • Python >= 3.10 (default 3.12) & uv
  • Joern

Installation Steps

  1. Clone the project locally:

    git clone https://github.com/sfncat/mcp-joern.git
    cd mcp-joern
    
  2. Install Python dependencies:

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

Project Structure

├── 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

Usage

  1. Start the Joern server:

    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. Copy env_example.txt to .env Modify the configuration information to match the joern server startup configuration

  3. Run the test connection: Modify the information in test_mcp_client.py to confirm the joern server is working properly

    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. Configure MCP server Configure the mcp server in cline, refer to sample_cline_mcp_settings.json.

  5. Use MCP server Ask questions to the large language model, refer to prompts_en.md

Development Notes

  • .env file is used to store environment variables
  • .gitignore file defines files to be ignored by Git version control
  • pyproject.toml defines the Python configuration for the project
  • MCP tool development
    • Implement in server_tools.sc, add definitions in server_tools.py, and add tests in test_mcp_client.py

Contribution Guidelines

Welcome to submit Issues and Pull Requests to help improve the project.

Welcome to add more tools.

References

https://github.com/flankerhqd/jebmcp

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mseep_joern_mcp-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mseep_joern_mcp-0.1.0-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file mseep_joern_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: mseep_joern_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for mseep_joern_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0c09edf8cd62e4c2212fb56a2cb576043de96706599fd2be95111c5c4a7a890
MD5 4d5ada0a6b44486dac894e41bf567507
BLAKE2b-256 24d3fd81b71d903029fb2a3ce71c78b74147f78ad01d961888368f7bbc2e36df

See more details on using hashes here.

File details

Details for the file mseep_joern_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mseep_joern_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d01f8f1f2b5241158ee8c2756507906e2387f5c9048fdba83438f8cc940f48ea
MD5 701a60afc25c4d9247d19aa71dc9c5ec
BLAKE2b-256 91d7763adae5063cf2f64617e4735a573fba2c23e5c33b6765d2d96b067e2dca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page