Infra Lens MCP logo

Infra Lens MCP

SSH Linux metrics, baselines, anomaly detection, and plain-English infrastructure explanations.

Install Infra Lens MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "infra-lens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "infra-lens-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

Tools10

What Infra Lens MCP lets your agent do. Expand a tool for its parameters.

Self-reported~204 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 3d ago

Recent health check succeeded.

7/7 checks healthy over the last 41d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · infra-lens-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
npm downloads573Package downloads in the last 30 days.
Last commit3d agoMost recent push to the default branch.
Tools exposed10Callable tools this server registers over MCP.

From the project README

infra-lens-mcp

Explain Linux incidents over SSH with baseline-aware MCP tooling.

A TypeScript MCP server for live Linux diagnostics, local SQLite history,
review-first incident workflows, and secure observability exports.

CI status CodeQL status Security Gates status OSV-Scanner status Codecov coverage OpenSSF Scorecard

npm version npm downloads Node.js 22 or newer MCP 2025-11-25 Signed multi-architecture GHCR image MIT license

Documentation · Usage · Architecture · Security · Governance · Roadmap · Support · Releases

Buy me a coffee

infra-lens-mcp connects to Linux hosts over SSH, captures bounded live metrics, stores observations and approved baselines in local SQLite, explains anomalies, and produces review-first incident artifacts. The npm package and signed container are release-ready; public connector publication remains intentionally blocked until an external OAuth/HTTPS deployment is verified.

Demo

infra-lens-mcp demo

See the MCP 2025-11-25 compliance matrix for current protocol support, delegated behavior, and connector publication constraints.

Tools

ToolPurpose
analyze_serverAnalyze a bounded sampled window with progress/cancellation support, then store only the completed observation
analyze_server_snapshotAnalyze and store one immediate snapshot without a sampling delay
snapshotStore a point-in-time observation without anomaly analysis
record_baselineSave a labeled healthy-state sample
compare_to_baselineCompare current state with a named baseline
get_historyReturn CPU, memory, or load history from SQLite
inspect_host_capabilitiesCheck required Linux commands and proc files before collection
plan_remediationPropose evidence-backed, approval-required remediation without executing changes
draft_incident_reportDraft an incident report and postmortem from persisted observations
compare_incident_windowsCompare adjacent windows for one host or the same window across two hosts

All tools return both readable JSON text and MCP structuredContent validated by declared outputSchema definitions, so clients and agents can consume responses without parsing the text block. Collection tools include a warnings array when optional sections cannot be collected but a partial snapshot is still usable. Use analyze_server_snapshot for interactive checks; use analyze_server only when a sampled window is required. Sampled analysis emits MCP progress when the client supplies a progress token and never persists a cancelled partial run.

Requirements

  • Node.js 24 LTS for CI, Docker, and release workflows
  • Node.js 22 or newer for package runtime compatibility
  • pnpm 11.15.1 through Corepack for development installs
  • Linux SSH targets with /proc, free, df, ps, and uname
  • Strict SSH host verification through known_hosts or pinned SHA256 host keys

Quick Start

Run the stdio MCP server from npm:

Terminal
npx -y infra-lens-mcp

Desktop MCP client style configuration:

config.json
{
  "mcpServers": {
    "infra-lens": {
      "command": "npx",
      "args": ["-y", "infra-lens-mcp"],
      "env": {
        "INFRA_LENS_DB": "/Users/you/.infra-lens-mcp/metrics.db"
      }
    }
  }
}

Local development:

bash
corepack enable
corepack prepare pnpm@11.15.1 --activate
pnpm install --frozen-lockfile
pnpm run build
node dist/mcp.js

Configuration

Transport is selected by the executable entry point, not by an environment variable: npx -y infra-lens-mcp or node dist/mcp.js starts stdio, while node dist/server-http.js starts Streamable HTTP.

VariableDefaultDescription
INFRA_LENS_DB~/.infra-lens-mcp/metrics.dbSQLite database path
INFRA_LENS_RETENTION_DAYS30Snapshot retention in days; 0 disables automatic pruning
MCP_HTTP_HOST127.0.0.1HTTP bind host. HOST remains a deprecated alias
MCP_HTTP_PORT3000HTTP bind port. PORT remains a deprecated alias
MCP_HTTP_ENDPOINT_PATH/mcpCanonical Streamable HTTP MCP endpoint path
MCP_HTTP_ALLOWED_ORIGINSunsetComma-separated allowed Origin values
MCP_HTTP_ALLOWED_HOSTSunsetComma-separated allowed Host values
MCP_HTTP_AUTH_MODEnonenone, bearer, or oauth-gateway; oauth is accepted as a compatibility alias
MCP_HTTP_BEARER_TOKENunsetLocal/dev bearer fallback token
MCP_HTTP_OAUTH_GATEWAY_HEADERx-infra-lens-gateway-authHeader injected by a trusted OAuth gateway
MCP_HTTP_OAUTH_GATEWAY_SECRETunsetShared backend secret required for oauth-gateway mode
MCP_HTTP_BODY_LIMIT_BYTES1048576Maximum JSON request body size
MCP_HTTP_REQUEST_TIMEOUT_MS30000Maximum time to receive and handle an HTTP request before the socket is closed
MCP_HTTP_MAX_CONCURRENT_REQUESTS100Maximum concurrent HTTP requests accepted by the Node process
MCP_HTTP_RATE_LIMIT_PER_MINUTE0Optional per-client in-memory rate limit; 0 disables it
MCP_HTTP_AUTHORIZATION_SERVERSunsetOAuth authorization server metadata URLs
MCP_PROFILEfullfull, remote-safe, chatgpt, or claude
MCP_SSH_STRICT_HOST_CHECKINGtrueStrict host key verification toggle
MCP_SSH_KNOWN_HOSTS~/.ssh/known_hostsKnown hosts file
MCP_SSH_ALLOWED_HOSTSunsetExact host/IP or IPv4 CIDR allowlist; required for remote-safe profiles and enforced in full profile when set
MCP_SSH_ALLOWED_USERSunsetOptional comma-separated SSH username allowlist
MCP_SSH_ALLOWED_PORTSunsetOptional comma-separated SSH port allowlist
MCP_SSH_MAX_SESSIONS_PER_HOST0Optional active SSH session cap per host:port; 0 disables it
MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE0Optional SSH connection-attempt cap per host:port per minute; 0 disables it

MCP_DB_PATH from older examples is not used; use INFRA_LENS_DB.

SSH Security

Strict host key checking is enabled by default. Provide either:

  • a hostKeySha256 value in the connection input, such as SHA256:...
  • a knownHostsPath in the connection input
  • MCP_SSH_KNOWN_HOSTS pointing at an OpenSSH known_hosts file

Raw passwords, private keys, and passphrases are accepted only in the default full profile for trusted local MCP contexts. remote-safe, chatgpt, and claude profiles reject raw SSH credentials in tool input and require MCP_SSH_ALLOWED_HOSTS. Production SSH policy can also restrict exact hosts or IPv4 CIDR ranges, users, ports, per-host active sessions, and per-host connection attempts.

Process command arguments are not collected by the default process command. Secret-like values in process data, SSH errors, and logs are redacted before storage or output.

HTTP Transport

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Infra Lens MCP

infra-lens-mcp is an MCP server that connects to Linux hosts over SSH, captures bounded live metrics, stores observations and approved baselines in local SQLite, explains anomalies in plain English, and produces review-first incident artifacts. It is implemented in TypeScript and supports live diagnostics, baseline-aware analysis, and secure observability exports.

Use infra-lens-mcp to connect to Linux hosts over SSH and analyze a bounded sampled window of live metrics. The server supports review-first incident workflows and can explain infrastructure conditions in plain English.

Yes, infra-lens-mcp stores observations and approved baselines in local SQLite and uses them to support baseline-aware analysis and anomaly explanations.

infra-lens-mcp stores observations and approved baselines in a local SQLite database.

Public connector publication is intentionally blocked until an external OAuth and HTTPS deployment is verified. The npm package and signed container are described as release-ready.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewInfra Lens MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/infra-lens-mcp?style=directory)](https://allmcps.com/mcp/infra-lens-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/infra-lens-mcp"><img src="https://allmcps.com/api/badge/infra-lens-mcp?style=directory" alt="Infra Lens MCP on AllMCPs" /></a>