I

Infra Lens MCP

by oaslananka · io.github.oaslananka/infra-lens-mcp

Enables explaining Linux incidents over SSH with baseline-aware MCP tooling, including live diagnostics, SQLite history, and review-first workflows.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-oaslananka-infra-lens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "infra-lens-mcp"
      ],
      "env": {
        "MCP_PROFILE": "full",
        "INFRA_LENS_DB": "~/.infra-lens-mcp/metrics.db",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_HTTP_PORT": "3000",
        "MCP_HTTP_AUTH_MODE": "none",
        "MCP_SSH_KNOWN_HOSTS": "~/.ssh/known_hosts",
        "MCP_HTTP_BEARER_TOKEN": "unset",
        "MCP_SSH_ALLOWED_HOSTS": "unset",
        "MCP_SSH_ALLOWED_PORTS": "unset",
        "MCP_SSH_ALLOWED_USERS": "unset",
        "MCP_HTTP_ALLOWED_HOSTS": "unset",
        "MCP_HTTP_ENDPOINT_PATH": "/mcp",
        "MCP_HTTP_ALLOWED_ORIGINS": "unset",
        "INFRA_LENS_RETENTION_DAYS": "30",
        "MCP_HTTP_BODY_LIMIT_BYTES": "1048576",
        "MCP_HTTP_REQUEST_TIMEOUT_MS": "30000",
        "MCP_SSH_STRICT_HOST_CHECKING": "true",
        "MCP_HTTP_OAUTH_GATEWAY_HEADER": "x-infra-lens-gateway-auth",
        "MCP_HTTP_OAUTH_GATEWAY_SECRET": "unset",
        "MCP_SSH_MAX_SESSIONS_PER_HOST": "0",
        "MCP_HTTP_AUTHORIZATION_SERVERS": "unset",
        "MCP_HTTP_RATE_LIMIT_PER_MINUTE": "0",
        "MCP_HTTP_MAX_CONCURRENT_REQUESTS": "100",
        "MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE": "0"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-oaslananka-infra-lens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "infra-lens-mcp"
      ],
      "env": {
        "MCP_PROFILE": "full",
        "INFRA_LENS_DB": "~/.infra-lens-mcp/metrics.db",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_HTTP_PORT": "3000",
        "MCP_HTTP_AUTH_MODE": "none",
        "MCP_SSH_KNOWN_HOSTS": "~/.ssh/known_hosts",
        "MCP_HTTP_BEARER_TOKEN": "unset",
        "MCP_SSH_ALLOWED_HOSTS": "unset",
        "MCP_SSH_ALLOWED_PORTS": "unset",
        "MCP_SSH_ALLOWED_USERS": "unset",
        "MCP_HTTP_ALLOWED_HOSTS": "unset",
        "MCP_HTTP_ENDPOINT_PATH": "/mcp",
        "MCP_HTTP_ALLOWED_ORIGINS": "unset",
        "INFRA_LENS_RETENTION_DAYS": "30",
        "MCP_HTTP_BODY_LIMIT_BYTES": "1048576",
        "MCP_HTTP_REQUEST_TIMEOUT_MS": "30000",
        "MCP_SSH_STRICT_HOST_CHECKING": "true",
        "MCP_HTTP_OAUTH_GATEWAY_HEADER": "x-infra-lens-gateway-auth",
        "MCP_HTTP_OAUTH_GATEWAY_SECRET": "unset",
        "MCP_SSH_MAX_SESSIONS_PER_HOST": "0",
        "MCP_HTTP_AUTHORIZATION_SERVERS": "unset",
        "MCP_HTTP_RATE_LIMIT_PER_MINUTE": "0",
        "MCP_HTTP_MAX_CONCURRENT_REQUESTS": "100",
        "MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE": "0"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-oaslananka-infra-lens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "infra-lens-mcp"
      ],
      "env": {
        "MCP_PROFILE": "full",
        "INFRA_LENS_DB": "~/.infra-lens-mcp/metrics.db",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_HTTP_PORT": "3000",
        "MCP_HTTP_AUTH_MODE": "none",
        "MCP_SSH_KNOWN_HOSTS": "~/.ssh/known_hosts",
        "MCP_HTTP_BEARER_TOKEN": "unset",
        "MCP_SSH_ALLOWED_HOSTS": "unset",
        "MCP_SSH_ALLOWED_PORTS": "unset",
        "MCP_SSH_ALLOWED_USERS": "unset",
        "MCP_HTTP_ALLOWED_HOSTS": "unset",
        "MCP_HTTP_ENDPOINT_PATH": "/mcp",
        "MCP_HTTP_ALLOWED_ORIGINS": "unset",
        "INFRA_LENS_RETENTION_DAYS": "30",
        "MCP_HTTP_BODY_LIMIT_BYTES": "1048576",
        "MCP_HTTP_REQUEST_TIMEOUT_MS": "30000",
        "MCP_SSH_STRICT_HOST_CHECKING": "true",
        "MCP_HTTP_OAUTH_GATEWAY_HEADER": "x-infra-lens-gateway-auth",
        "MCP_HTTP_OAUTH_GATEWAY_SECRET": "unset",
        "MCP_SSH_MAX_SESSIONS_PER_HOST": "0",
        "MCP_HTTP_AUTHORIZATION_SERVERS": "unset",
        "MCP_HTTP_RATE_LIMIT_PER_MINUTE": "0",
        "MCP_HTTP_MAX_CONCURRENT_REQUESTS": "100",
        "MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE": "0"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-oaslananka-infra-lens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "infra-lens-mcp"
      ],
      "env": {
        "MCP_PROFILE": "full",
        "INFRA_LENS_DB": "~/.infra-lens-mcp/metrics.db",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_HTTP_PORT": "3000",
        "MCP_HTTP_AUTH_MODE": "none",
        "MCP_SSH_KNOWN_HOSTS": "~/.ssh/known_hosts",
        "MCP_HTTP_BEARER_TOKEN": "unset",
        "MCP_SSH_ALLOWED_HOSTS": "unset",
        "MCP_SSH_ALLOWED_PORTS": "unset",
        "MCP_SSH_ALLOWED_USERS": "unset",
        "MCP_HTTP_ALLOWED_HOSTS": "unset",
        "MCP_HTTP_ENDPOINT_PATH": "/mcp",
        "MCP_HTTP_ALLOWED_ORIGINS": "unset",
        "INFRA_LENS_RETENTION_DAYS": "30",
        "MCP_HTTP_BODY_LIMIT_BYTES": "1048576",
        "MCP_HTTP_REQUEST_TIMEOUT_MS": "30000",
        "MCP_SSH_STRICT_HOST_CHECKING": "true",
        "MCP_HTTP_OAUTH_GATEWAY_HEADER": "x-infra-lens-gateway-auth",
        "MCP_HTTP_OAUTH_GATEWAY_SECRET": "unset",
        "MCP_SSH_MAX_SESSIONS_PER_HOST": "0",
        "MCP_HTTP_AUTHORIZATION_SERVERS": "unset",
        "MCP_HTTP_RATE_LIMIT_PER_MINUTE": "0",
        "MCP_HTTP_MAX_CONCURRENT_REQUESTS": "100",
        "MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE": "0"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-oaslananka-infra-lens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "infra-lens-mcp"
      ],
      "env": {
        "MCP_PROFILE": "full",
        "INFRA_LENS_DB": "~/.infra-lens-mcp/metrics.db",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_HTTP_PORT": "3000",
        "MCP_HTTP_AUTH_MODE": "none",
        "MCP_SSH_KNOWN_HOSTS": "~/.ssh/known_hosts",
        "MCP_HTTP_BEARER_TOKEN": "unset",
        "MCP_SSH_ALLOWED_HOSTS": "unset",
        "MCP_SSH_ALLOWED_PORTS": "unset",
        "MCP_SSH_ALLOWED_USERS": "unset",
        "MCP_HTTP_ALLOWED_HOSTS": "unset",
        "MCP_HTTP_ENDPOINT_PATH": "/mcp",
        "MCP_HTTP_ALLOWED_ORIGINS": "unset",
        "INFRA_LENS_RETENTION_DAYS": "30",
        "MCP_HTTP_BODY_LIMIT_BYTES": "1048576",
        "MCP_HTTP_REQUEST_TIMEOUT_MS": "30000",
        "MCP_SSH_STRICT_HOST_CHECKING": "true",
        "MCP_HTTP_OAUTH_GATEWAY_HEADER": "x-infra-lens-gateway-auth",
        "MCP_HTTP_OAUTH_GATEWAY_SECRET": "unset",
        "MCP_SSH_MAX_SESSIONS_PER_HOST": "0",
        "MCP_HTTP_AUTHORIZATION_SERVERS": "unset",
        "MCP_HTTP_RATE_LIMIT_PER_MINUTE": "0",
        "MCP_HTTP_MAX_CONCURRENT_REQUESTS": "100",
        "MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE": "0"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-oaslananka-infra-lens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "infra-lens-mcp"
      ],
      "env": {
        "MCP_PROFILE": "full",
        "INFRA_LENS_DB": "~/.infra-lens-mcp/metrics.db",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_HTTP_PORT": "3000",
        "MCP_HTTP_AUTH_MODE": "none",
        "MCP_SSH_KNOWN_HOSTS": "~/.ssh/known_hosts",
        "MCP_HTTP_BEARER_TOKEN": "unset",
        "MCP_SSH_ALLOWED_HOSTS": "unset",
        "MCP_SSH_ALLOWED_PORTS": "unset",
        "MCP_SSH_ALLOWED_USERS": "unset",
        "MCP_HTTP_ALLOWED_HOSTS": "unset",
        "MCP_HTTP_ENDPOINT_PATH": "/mcp",
        "MCP_HTTP_ALLOWED_ORIGINS": "unset",
        "INFRA_LENS_RETENTION_DAYS": "30",
        "MCP_HTTP_BODY_LIMIT_BYTES": "1048576",
        "MCP_HTTP_REQUEST_TIMEOUT_MS": "30000",
        "MCP_SSH_STRICT_HOST_CHECKING": "true",
        "MCP_HTTP_OAUTH_GATEWAY_HEADER": "x-infra-lens-gateway-auth",
        "MCP_HTTP_OAUTH_GATEWAY_SECRET": "unset",
        "MCP_SSH_MAX_SESSIONS_PER_HOST": "0",
        "MCP_HTTP_AUTHORIZATION_SERVERS": "unset",
        "MCP_HTTP_RATE_LIMIT_PER_MINUTE": "0",
        "MCP_HTTP_MAX_CONCURRENT_REQUESTS": "100",
        "MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE": "0"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
MCP_PROFILE No full, remote-safe, chatgpt, or claude Default: full
INFRA_LENS_DB No SQLite database path Default: ~/.infra-lens-mcp/metrics.db
MCP_HTTP_HOST No HTTP bind host. HOST remains a deprecated alias Default: 127.0.0.1
MCP_HTTP_PORT No HTTP bind port. PORT remains a deprecated alias Default: 3000
MCP_HTTP_AUTH_MODE No none, bearer, or oauth-gateway; oauth is accepted as a compatibility alias Default: none
MCP_SSH_KNOWN_HOSTS No Known hosts file Default: ~/.ssh/known_hosts
MCP_HTTP_BEARER_TOKEN No Local/dev bearer fallback token Default: unset
MCP_SSH_ALLOWED_HOSTS No Exact host/IP or IPv4 CIDR allowlist; required for remote-safe profiles and enforced in full profile when set Default: unset
MCP_SSH_ALLOWED_PORTS No Optional comma-separated SSH port allowlist Default: unset
MCP_SSH_ALLOWED_USERS No Optional comma-separated SSH username allowlist Default: unset
MCP_HTTP_ALLOWED_HOSTS No Comma-separated allowed Host values Default: unset
MCP_HTTP_ENDPOINT_PATH No Canonical Streamable HTTP MCP endpoint path Default: /mcp
MCP_HTTP_ALLOWED_ORIGINS No Comma-separated allowed Origin values Default: unset
INFRA_LENS_RETENTION_DAYS No Snapshot retention in days; 0 disables automatic pruning Default: 30
MCP_HTTP_BODY_LIMIT_BYTES No Maximum JSON request body size Default: 1048576
MCP_HTTP_REQUEST_TIMEOUT_MS No Maximum time to receive and handle an HTTP request before the socket is closed Default: 30000
MCP_SSH_STRICT_HOST_CHECKING No Strict host key verification toggle Default: true
MCP_HTTP_OAUTH_GATEWAY_HEADER No Header injected by a trusted OAuth gateway Default: x-infra-lens-gateway-auth
MCP_HTTP_OAUTH_GATEWAY_SECRET No Shared backend secret required for oauth-gateway mode Default: unset
MCP_SSH_MAX_SESSIONS_PER_HOST No Optional active SSH session cap per host:port; 0 disables it Default: 0
MCP_HTTP_AUTHORIZATION_SERVERS No OAuth authorization server metadata URLs Default: unset
MCP_HTTP_RATE_LIMIT_PER_MINUTE No Optional per-client in-memory rate limit; 0 disables it Default: 0
MCP_HTTP_MAX_CONCURRENT_REQUESTS No Maximum concurrent HTTP requests accepted by the Node process Default: 100
MCP_SSH_MAX_CONNECTION_ATTEMPTS_PER_MINUTE No Optional SSH connection-attempt cap per host:port per minute; 0 disables it Default: 0

Similar servers