Skip to content

cryostatio/cryostat-mcp

Repository files navigation

Cryostat MCP

Model Context Protocol (MCP) servers for Cryostat.

Project Structure

This is a multi-module Maven project containing two MCP server implementations:

1. cryostat-mcp (Single Instance)

A stdio-based MCP server that connects to a single Cryostat instance. Ideal for:

  • Local development with a single Cryostat instance
  • Direct integration with MCP clients like Claude Desktop
  • Simple single-instance deployments

Documentation: See cryostat-mcp-core/README.md

2. cryostat-mcp-k8s-mux (Kubernetes Multi-Instance)

An HTTP-based MCP server that acts as a multiplexing proxy for multiple Cryostat instances in a Kubernetes cluster. Features:

  • Automatic discovery of Cryostat Custom Resources
  • Namespace-based routing to appropriate Cryostat instances
  • Credential forwarding for secure access
  • Real-time CR change detection via Kubernetes Watch API

Documentation: See cryostat-mcp-k8s-mux/README.md

Quick Start

Building the Entire Project

Build all modules:

./mvnw clean install

Build specific module:

# Single-instance MCP
./mvnw clean install -pl cryostat-mcp

# Multi-instance MCP
./mvnw clean install -pl cryostat-mcp-k8s-mux

Choosing the Right MCP

Use Case Recommended MCP
Single Cryostat instance cryostat-mcp
Multiple Cryostat instances in Kubernetes cryostat-mcp-k8s-mux
Local development cryostat-mcp-single
Production Kubernetes deployment cryostat-mcp-k8s-mux
Claude Desktop integration cryostat-mcp-single
Remote HTTP access cryostat-mcp-k8s-mux

SEE ALSO

  • cryostat.io : the self-hosted Java application monitoring and profiling tool which this MCP connects to.

REQUIREMENTS

Build requirements:

  • git
  • JDK 21+
  • Maven v3+

BUILD

This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

BUILD THE MCP

The MCP server can be built as an all-in-one Java JAR using:

$ ./mvnw install

After this, the MCP can be run directly using java -jar target/cryostat-mcp-*-runner.jar. Additional configuration is required to hook up the MCP server to a particular Cryostat server instance.

RUN

The easiest way to use the MCP is to provide an MCP configuration to your choice of compatible tool. LLM-enhanced code editors and development environments usually provide some way for you as a user to add custom MCP tools. The project's mcp.json contains a template example you can use as a starting point.

Edit these environment variables to suit your Cryostat instance. You may need to replace the https://localhost:8443 in the REST_CLIENT and GRAPHQL_CLIENT variables with a different host and/or port. You may also need to adjust the CRYOSTAT_AUTH_VALUE - this default example is using HTTP Basic authentication where the credentials are user:pass. This should be adjusted to suit what your Cryostat instance requires: either a different Basic base64-encoded credential, or a Bearer abcd1234 auth token.

{
    "QUARKUS_SMALLRYE_GRAPHQL_CLIENT_CRYOSTAT_URL": "https://localhost:8443/api/v4/graphql",
    "QUARKUS_REST_CLIENT_CRYOSTAT_URL": "https://localhost:8443",
    "CRYOSTAT_AUTH_VALUE": "Basic dXNlcjpwYXNz"
}

You should also consider enabling TLS verification. By default the example configuration disables TLS checks and will accept all certificates with no hostname verification, which is insecure. If your Cryostat instance presents a certificate with a correct hostname and signed by a trusted root CA then you should delete the following lines from your configuration.

{
    "QUARKUS_TLS_NOTLS_TRUST_ALL": "true",
    "QUARKUS_REST_CLIENT_CRYOSTAT_VERIFY_HOST": "false",
    "QUARKUS_REST_CLIENT_CRYOSTAT_TLS_CONFIGURATION_NAME": "notls"
}

About

Model Context Protocol (MCP) for connecting Cryostat to Large Language Models (LLMs)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages