ProDisco

harche/ProDisco

3.2

If you are the rightful owner of ProDisco and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

ProDisco is a Progressive Disclosure Kubernetes MCP Server that provides controlled Kubernetes access to MCP agents, following Anthropic's Progressive Disclosure pattern.

Tools
1
Resources
0
Prompts
0

ProDisco (Progressive Disclosure MCP Server)

ProDisco is a progressive-disclosure MCP server framework: you provide a list of TypeScript libraries, ProDisco indexes their APIs for discovery, and a sandbox executes code that uses only those libraries. It follows Anthropic's Progressive Disclosure pattern: the MCP server exposes search tools which surface library APIs, agents discover them to write code, execute it in a sandbox, and only the final console output returns to the agent.

Kubernetes/observability is just one example configuration (see examples/). You can equally build an MCP server around AWS/GCP SDKs, Postgres clients, internal TypeScript SDKs, etc.

Note: ProDisco prefers indexing APIs from TypeScript declaration files (.d.ts). If a library ships no .d.ts, ProDisco can fall back to indexing ESM JavaScript exports (best-effort; types default to any). CommonJS-only JavaScript packages without typings are not supported.

Demo use-cases (optional):

  • Kubernetes access via @kubernetes/client-node
  • Prometheus metrics via @prodisco/prometheus-client
  • Loki logs via @prodisco/loki-client
  • Analytics via simple-statistics

Watch the demo


Table of Contents


Why Progressive Disclosure?

Anthropic's latest guidance explains why MCP servers should progressively reveal capabilities instead of dumping every tool definition into the model context. When agents explore a filesystem of TypeScript modules, they only load what they need and process data inside the execution environment, then return a concise result to the chat. This keeps token usage low, improves latency, and avoids copying large intermediate payloads through the model (source).

ProDisco goes a step further: instead of exposing custom TypeScript modules, it provides a structured parameter search tool that dynamically extracts methods from upstream libraries using TypeScript AST parsing. This means:

  • Zero maintenance - Methods are extracted directly from library .d.ts files
  • Always current - Upgrading a dependency automatically exposes new methods
  • Type-safe - Full parameter types and return types included

Quick Start

Add to Claude Code

npm install
npm run build

# Example configs live in ./examples (see examples/README.md)
# Then add the MCP server
claude mcp add --transport stdio prodisco -- node dist/server.js --config examples/prodisco.postgres.yaml --install-missing

Remove if needed:

claude mcp remove prodisco

Environment Variables

VariableRequiredDescription
PRODISCO_CONFIG_PATHNoPath to the libraries config file (same as --config)
KUBECONFIGNo(If using @kubernetes/client-node) Path to kubeconfig (defaults to ~/.kube/config)
PROMETHEUS_URLNo(If using @prodisco/prometheus-client) Prometheus server URL
LOKI_URLNo(If using @prodisco/loki-client) Loki server URL

Important: Export environment variables before running claude mcp add. The --env flag may not reliably pass variables to the MCP server process.

Tip: If you're using a kind cluster for local testing, you can port-forward to Prometheus:

kubectl port-forward -n monitoring svc/prometheus-server 9090:80

Then set PROMETHEUS_URL="http://localhost:9090"

Development Setup

For local development:

git clone https://github.com/harche/ProDisco.git
cd ProDisco
npm install
npm run build
claude mcp add --transport stdio prodisco -- node dist/server.js
claude mcp remove prodisco # remove when you're done

Startup Options:

FlagDescription
--clear-cacheClear the scripts cache before starting
--config <path>Path to YAML/JSON config listing libraries to index/allow
--install-missingAuto-install missing libraries into .cache/deps (opt-in)
--transport <mode>Transport mode: stdio (default) or http
--host <host>HTTP host to bind to (default: 127.0.0.1)
--port <port>HTTP port (default: 3000, implies --transport http)
node dist/server.js --clear-cache

Dynamic Libraries Configuration

ProDisco can be started with a config file that determines which npm packages are:

  • Indexed by prodisco.searchTools
  • Allowed in the sandbox via require() (kept in lockstep with indexing)

Example prodisco.config.yaml:

libraries:
  - name: "@kubernetes/client-node"
    description: "Kubernetes API client"
  - name: "@prodisco/prometheus-client"
    description: "Prometheus queries + metric discovery"
  - name: "@prodisco/loki-client"
    description: "Loki LogQL querying"
  - name: "simple-statistics"
    description: "Statistics helpers"

Start with a config file:

node dist/server.js --config prodisco.config.yaml

Optional: auto-install missing packages into .cache/deps:

node dist/server.js --config prodisco.config.yaml --install-missing

Environment variables:

VariableDescription
PRODISCO_CONFIG_PATHPath to YAML/JSON config listing libraries
PRODISCO_INSTALL_MISSINGIf set to 1/true, auto-install missing libraries into .cache/deps

Build Docker Images From Config

If you want images that already contain the configured libraries (for deploying MCP and sandbox separately), you can build them directly from the same config file:

npm run docker:build:config -- --config prodisco.config.yaml

This builds:

  • prodisco/mcp-server:<configSha8> using the root Dockerfile
  • prodisco/sandbox-server:<configSha8> using packages/sandbox-server/Dockerfile

You can override image names/tags:

npm run docker:build:config -- --config prodisco.config.yaml --tag dev --mcp-image myorg/prodisco-mcp --sandbox-image myorg/prodisco-sandbox

HTTP Transport

ProDisco supports HTTP transport for network-based MCP connections, enabling remote access and containerized deployments.

Start in HTTP mode:

# HTTP mode on default port (3000)
node dist/server.js --transport http

# HTTP mode on custom port
node dist/server.js --port 8080

# HTTP mode on all interfaces (for network access)
node dist/server.js --host 0.0.0.0 --port 3000

Environment Variables:

VariableDefaultDescription
MCP_TRANSPORTstdioTransport mode (stdio or http)
MCP_HOST127.0.0.1HTTP host to bind to
MCP_PORT3000HTTP port to listen on

HTTP Endpoints:

EndpointMethodDescription
/healthGETHealth check, returns {"status":"ok"}
/mcpPOSTMCP JSON-RPC endpoint (Streamable HTTP)

Example: Connect with curl

# Health check
curl http://localhost:3000/health

# Initialize MCP session
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}'

# Use session ID from response header for subsequent requests
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -H "mcp-session-id: <session-id-from-init>" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

The HTTP transport uses the MCP SDK's StreamableHTTPServerTransport, which supports session management via mcp-session-id headers and Server-Sent Events (SSE) for streaming responses.


Available Tools

ProDisco exposes two tools:

prodisco.searchTools

Search and browse extracted API documentation for your startup-configured TypeScript libraries (from .d.ts). Use it to discover the correct method/type/function signatures before calling prodisco.runSandbox.

Document Types:

TypeDescription
methodClass methods / instance APIs extracted from configured libraries
typeTypeScript types (interfaces/classes/enums/type aliases)
functionStandalone exported functions
scriptCached sandbox scripts
allSearch everything above (default)

Examples:

// Search broadly by name (methods/types/functions/scripts)
// Replace the placeholders with terms relevant to your configured libraries.
{ methodName: "<search-term>" }

// Filter by document type (methods/types/functions/scripts)
{ methodName: "<search-term>", documentType: "method" }

// Find Loki query methods
{ documentType: "method", library: "@prodisco/loki-client", category: "query" }

// Find Prometheus methods
{ methodName: "executeRange", library: "@prodisco/prometheus-client" }

// Find analytics functions
{ documentType: "function", library: "simple-statistics" }

// Search cached scripts
{ documentType: "script", methodName: "deployment" }

// Get TypeScript type definitions (classes/interfaces/enums/type aliases)
{ methodName: "<type-or-class-name>", documentType: "type" }

// Exclude certain categories/libraries
{ methodName: "query", exclude: { categories: ["delete"], libraries: ["some-library"] } }

For comprehensive documentation, see .

prodisco.runSandbox

Execute TypeScript code in a sandboxed environment using the same configured library allowlist as prodisco.searchTools.

Execution Modes:

ModePurposeKey Parameters
execute (default)Blocking executioncode or cached, timeout
streamReal-time output streamingcode or cached, timeout
asyncBackground executioncode or cached, timeout
statusCheck async executionexecutionId, wait, outputOffset
cancelCancel running executionexecutionId
listList active executionsstates, limit

Sandbox Environment:

  • console - Captured output (log, error, warn, info)
  • require() - Restricted to configured npm packages (and their subpaths)
  • process.env - Environment variables

Examples:

// Execute code (default mode)
{
  code: `
    const k8s = require("@kubernetes/client-node");
    const kc = new k8s.KubeConfig();
    kc.loadFromDefault();

    const api = kc.makeApiClient(k8s.CoreV1Api);
    const pods = await api.listNamespacedPod("default");
    console.log(\`Found \${pods.body.items.length} pods\`);
  `
}

// Run a cached script
{ cached: "script-2025-01-01T12-00-00-abc123.ts" }

// Stream mode - real-time output
{ mode: "stream", code: "for(let i=0; i<5; i++) console.log(i)" }

// Async mode - start long-running task
{ mode: "async", code: "longRunningTask()" }

// Check async execution status
{ mode: "status", executionId: "abc-123", wait: true }

// Cancel a running execution
{ mode: "cancel", executionId: "abc-123" }

// Query Prometheus metrics
{
  code: `
    const { PrometheusClient, MetricSearchEngine } = require('@prodisco/prometheus-client');
    const client = new PrometheusClient({ endpoint: process.env.PROMETHEUS_URL });

    // Discover metrics semantically
    const search = new MetricSearchEngine(client);
    const metrics = await search.search("memory usage");
    console.log('Found metrics:', metrics.map(m => m.name));

    // Execute PromQL query
    const end = new Date();
    const start = new Date(end.getTime() - 60 * 60 * 1000);
    const result = await client.executeRange('node_memory_MemAvailable_bytes', { start, end, step: '1m' });
    console.log(\`Got \${result.data.length} time series\`);
  `
}

// Query Loki logs
{
  code: `
    const { LokiClient } = require('@prodisco/loki-client');
    const client = new LokiClient({ baseUrl: process.env.LOKI_URL });
    const result = await client.queryRange('{namespace="default"}', { since: '1h', limit: 100 });
    result.logs.forEach(log => console.log(\`[\${log.timestamp.toISOString()}] \${log.line}\`));
  `
}

For architecture details, see .


Advanced Analytics

ProDisco goes beyond simple resource fetching - it provides statistical analysis, machine learning, and signal processing capabilities for deep cluster observability.

Available Libraries:

LibraryPurpose
simple-statisticsMean, median, std dev, z-scores, percentiles, linear regression, correlation
ml-regressionPolynomial, exponential, and power regression for trend forecasting
mathjsMatrix operations, linear algebra, symbolic math
fft-jsFast Fourier Transform for detecting periodic patterns

Example Prompts:

Use CasePrompt
Log Analysis"Query Loki for error logs from the nginx app in the last hour. Show me the most common error patterns."
Cluster Health"Analyze CPU and memory usage across all pods. Calculate mean, median, standard deviation, and identify outliers using z-scores. Show pods above the 95th percentile."
Memory Leaks"Check for memory leaks. Fetch memory usage over 2 hours and use linear regression to identify pods with increasing memory."
Anomaly Detection"Analyze network traffic and detect anomalies. Find receive/transmit rates more than 2 standard deviations from normal."
Correlation"Find correlations between CPU and memory usage. Tell me if high CPU correlates with high memory."
Periodic Patterns"Use FFT analysis on node CPU to detect periodic patterns. Are there dominant frequencies suggesting scheduled jobs?"
Capacity Planning"Analyze resource trends and use polynomial regression to forecast when we might hit resource limits."

For detailed examples with code and output, see .


Advanced Deployment

Container Isolation

For stronger isolation, run the sandbox server in a Kubernetes cluster and connect via TCP.

1. Deploy the sandbox server:

# Build and load the image (for kind clusters)
docker build -f packages/sandbox-server/Dockerfile -t prodisco/sandbox-server:latest .
kind load docker-image prodisco/sandbox-server:latest

# Deploy
kubectl apply -f packages/sandbox-server/k8s/deployment.yaml

# Port-forward to access locally
kubectl -n prodisco port-forward service/sandbox-server 50051:50051

2. Configure the MCP server to use TCP:

export KUBECONFIG="${HOME}/.kube/config"
export SANDBOX_USE_TCP=true
export SANDBOX_TCP_HOST=localhost
export SANDBOX_TCP_PORT=50051
claude mcp add --transport stdio prodisco -- node dist/server.js --config examples/prodisco.kubernetes.yaml

Transport Environment Variables:

VariableDefaultDescription
SANDBOX_USE_TCPfalseUse TCP instead of local subprocess
SANDBOX_TCP_HOSTlocalhostSandbox server host
SANDBOX_TCP_PORT50051Sandbox server port

Transport Security (TLS/mTLS)

For production deployments, the sandbox server supports TLS and mutual TLS (mTLS):

ModeDescription
insecureNo encryption (default, for local development)
tlsServer-side TLS (client verifies server identity)
mtlsMutual TLS (both client and server authenticate)

Configuration:

# Server-side TLS
export SANDBOX_TRANSPORT_MODE=tls
export SANDBOX_TLS_CERT_PATH=/path/to/server.crt
export SANDBOX_TLS_KEY_PATH=/path/to/server.key

# Client-side (MCP server)
export SANDBOX_TRANSPORT_MODE=tls
export SANDBOX_TLS_CA_PATH=/path/to/ca.crt

For Kubernetes deployments, use cert-manager to automate certificate management. See the directory for ready-to-use manifests.

For full architecture and security details, see .


Testing

Integration Tests

End-to-end testing with KIND cluster + Claude Agent SDK:

npm run test:integration

For detailed testing instructions, see .


Additional Documentation

DocumentDescription
Advanced analytics guide - anomaly detection, forecasting, correlation, FFT analysis
Complete searchTools reference with examples and technical architecture
Practical examples + runnable library config files (examples/*.yaml)
Sandbox architecture, gRPC protocol, and security configuration
Integration test workflow and container tests

License

MIT