Descartes Java REPL and Deep Introspection For Your Java Apps

by widoriezebos

281 downloads
Not rated
GitHub

About

A Java-based Model Context Protocol (MCP) server that provides deep introspection, monitoring, debugging, and REPL capabilities for Java applications. Descartes enables AI assistants to interact with running Java processes through a comprehensive set of tools and resources.

Details

Author
widoriezebos
Downloads
281
Categories
Other, Developer Tools

- JShell REPL for interactive Java code execution
- Object Inspector for deep object introspection
- Process and system monitoring with real‑time metrics
- Thread analyzer with deadlock detection
- Memory analyzer (heap, GC, memory pools)
- Exception analysis and Log4j2 log integration

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Descartes Java REPL and Deep Introspection For Your Java Apps
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, build with mvn clean package, and run the example server with mvn exec:java. Connect an MCP client via the included TCP adapter (config/mcp/mcp-tcp-adapter.js) and configure it in your client’s JSON configuration. The server listens on port 9080 by default.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "descartes java repl and deep introspection for your java apps": {
            "morpheus": {
                "command": "node",
                "args": [
                    "/path/to/mcp/mcp-tcp-adapter.js"
                ],
                "env": {
                    "MCP_HOST": "localhost",
                    "MCP_PORT": "9080",
                    "MCP_DEBUG": "false",
                    "MCP_RECONNECT_MIN_DELAY": "500",
                    "MCP_RECONNECT_MAX_DELAY": "5000",
                    "MCP_HEALTH_CHECK_INTERVAL": "5000",
                    "MCP_LOG_RATE_LIMIT_WINDOW": "60000",
                    "MCP_LOG_RATE_LIMIT_MAX": "10"
                }
            }
        }
    }
}

McpServers

{
    "morpheus": {
        "command": "node",
        "args": [
            "/path/to/mcp/mcp-tcp-adapter.js"
        ],
        "env": {
            "MCP_HOST": "localhost",
            "MCP_PORT": "9080",
            "MCP_DEBUG": "false",
            "MCP_RECONNECT_MIN_DELAY": "500",
            "MCP_RECONNECT_MAX_DELAY": "5000",
            "MCP_HEALTH_CHECK_INTERVAL": "5000",
            "MCP_LOG_RATE_LIMIT_WINDOW": "60000",
            "MCP_LOG_RATE_LIMIT_MAX": "10"
        }
    }
}

Descartes MCP

A Java-based Model Context Protocol (MCP) server that provides deep introspection, monitoring, debugging, and REPL capabilities for Java applications. Descartes enables AI assistants to interact with running Java processes through a comprehensive set of tools and resources.

> ⚠️ SECURITY WARNING: This tool includes a Java REPL that allows arbitrary code execution. It should ONLY be used in development/debugging environments and NEVER exposed to untrusted networks or users. See Security Considerations for details.

Features

🛠️ Tools

- JShell REPL: Interactive Java code execution with session management - Object Inspector: Deep object introspection without code execution - Process Inspector: Process and thread information monitoring - System Monitoring: Real-time system metrics and resource usage - Thread Analyzer: Thread state analysis and deadlock detection - Memory Analyzer: Heap usage, garbage collection, and memory pool analysis - Exception Analysis: Stack trace analysis and root cause identification - Logging Integration: Log4j2 integration for log capture and analysis

📊 Resources

- Classpath Resource: Access to classpath information - System Properties: JVM and system property access - Metrics Resource: Application and JVM metrics - Thread Dumps: Detailed thread state snapshots - MBean Resource: JMX MBean access and monitoring - Application Context: Access to registered application objects

Requirements

- Java 16 or higher (compiled with Java 23 for optimal performance)
- Maven 3.6+
- Node.js (for the MCP TCP adapter)

Quick Start

1. Clone and Build

gh repo clone widoriezebos/descartes-mcp
cd descartes-mcp
mvn clean package

2. Run the Example Server

mvn exec:java

This starts the MCP server on port 9080 with all available tools and resources registered.

3. Connect with an MCP Client

The repository includes a robust TCP adapter client in /config/mcp/ for easy integration:

Using the Included TCP Adapter

1. Make the adapter executable (if needed):
- Linux/macOS: chmod +x config/mcp/mcp-tcp-adapter.js
- Windows: No action needed - Node.js handles execution
- Alternative: Run directly with Node.js: node config/mcp/mcp-tcp-adapter.js

2. Update the configuration file (config/mcp/mcpservers.json):

   "args": ["/absolute/path/to/descartes-mcp/config/mcp/mcp-tcp-adapter.js"]

3. Copy to Claude Desktop configuration:
- Copy mcpservers.json to your Claude Desktop config directory
- The adapter will handle all connection management automatically

4. Features of the TCP Adapter:
- Automatic reconnection with exponential backoff
- Message queuing during disconnections
- Health monitoring and stale connection recovery
- Never exits - handles all connection failures gracefully

See /config/mcp/README-adapter.md for detailed adapter documentation.

Build Commands

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.