infra-lens-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@infra-lens-mcpdiagnose high CPU on prod-db-1 and compare to baseline"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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

See the MCP 2025-11-25 compliance matrix for current protocol support, delegated behavior, and connector publication constraints.
Related MCP server: Linux MCP Server
Tools
Tool | Purpose |
| Analyze a bounded sampled window with progress/cancellation support, then store only the completed observation |
| Analyze and store one immediate snapshot without a sampling delay |
| Store a point-in-time observation without anomaly analysis |
| Save a labeled healthy-state sample |
| Compare current state with a named baseline |
| Return CPU, memory, or load history from SQLite |
| Check required Linux commands and proc files before collection |
| Propose evidence-backed, approval-required remediation without executing changes |
| Draft an incident report and postmortem from persisted observations |
| Compare 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, andunameStrict SSH host verification through
known_hostsor pinned SHA256 host keys
Quick Start
Run the stdio MCP server from npm:
npx -y infra-lens-mcpDesktop MCP client style configuration:
{
"mcpServers": {
"infra-lens": {
"command": "npx",
"args": ["-y", "infra-lens-mcp"],
"env": {
"INFRA_LENS_DB": "/Users/you/.infra-lens-mcp/metrics.db"
}
}
}
}Local development:
corepack enable
corepack prepare pnpm@11.15.1 --activate
pnpm install --frozen-lockfile
pnpm run build
node dist/mcp.jsConfiguration
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.
Variable | Default | Description |
|
| SQLite database path |
|
| Snapshot retention in days; |
|
| HTTP bind host. |
|
| HTTP bind port. |
|
| Canonical Streamable HTTP MCP endpoint path |
| unset | Comma-separated allowed Origin values |
| unset | Comma-separated allowed Host values |
|
|
|
| unset | Local/dev bearer fallback token |
|
| Header injected by a trusted OAuth gateway |
| unset | Shared backend secret required for |
|
| Maximum JSON request body size |
|
| Maximum time to receive and handle an HTTP request before the socket is closed |
|
| Maximum concurrent HTTP requests accepted by the Node process |
|
| Optional per-client in-memory rate limit; |
| unset | OAuth authorization server metadata URLs |
|
|
|
|
| Strict host key verification toggle |
|
| Known hosts file |
| unset | Exact host/IP or IPv4 CIDR allowlist; required for remote-safe profiles and enforced in |
| unset | Optional comma-separated SSH username allowlist |
| unset | Optional comma-separated SSH port allowlist |
|
| Optional active SSH session cap per host:port; |
|
| Optional SSH connection-attempt cap per host:port per minute; |
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
hostKeySha256value in the connection input, such asSHA256:...a
knownHostsPathin the connection inputMCP_SSH_KNOWN_HOSTSpointing at an OpenSSHknown_hostsfile
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
Run the Streamable HTTP transport locally. The canonical MCP endpoint is http://127.0.0.1:3000/mcp unless MCP_HTTP_ENDPOINT_PATH is changed. HTTP mode is stateless today: the server does not issue or accept MCP-Session-Id, and only POST JSON-RPC calls are supported on the MCP endpoint. MCP_HTTP_REQUEST_TIMEOUT_MS and any proxy timeout must exceed the requested sampled window; otherwise use analyze_server_snapshot. stdio has no server-owned wall-clock request timeout, so the client controls its timeout and MCP cancellation.
MCP_HTTP_HOST=127.0.0.1 MCP_HTTP_PORT=3000 node dist/server-http.jsLoopback HTTP can run without auth for local development. Any non-loopback bind, such as 0.0.0.0, fails fast unless all of these are configured:
MCP_PROFILE=remote-safe,chatgpt, orclaudeMCP_HTTP_AUTH_MODE=beareroroauth-gatewayMCP_HTTP_ALLOWED_ORIGINSMCP_HTTP_ALLOWED_HOSTS
Native OAuth/JWT validation is not implemented inside this package. Public deployments should use MCP_HTTP_AUTH_MODE=oauth-gateway behind a production OAuth-aware gateway or reverse proxy, configure HTTPS MCP_HTTP_RESOURCE_URL, and block direct access to the Node process. Keep origin/host allowlists, body limits, request timeout, concurrency limit, and optional rate limit enabled at the Node process even when an upstream proxy also enforces them. See ADR 0006. Connector publication readiness remains false until a full connector deployment is verified.
Docker
The Docker image defaults to stdio mode:
docker build -t infra-lens-mcp .
docker volume create infra-lens-data
docker run --rm -i \
--read-only \
--cap-drop=ALL \
--security-opt=no-new-privileges:true \
--tmpfs /tmp:rw,noexec,nosuid,nodev,size=64m \
--mount type=volume,src=infra-lens-data,dst=/home/appuser/.infra-lens-mcp \
infra-lens-mcpFor local HTTP testing, override the command and keep the bind host on loopback unless a remote-safe profile and auth controls are configured:
docker run --rm -p 127.0.0.1:3000:3000 \
--read-only \
--cap-drop=ALL \
--security-opt=no-new-privileges:true \
--tmpfs /tmp:rw,noexec,nosuid,nodev,size=64m \
--mount type=volume,src=infra-lens-data,dst=/home/appuser/.infra-lens-mcp \
-e MCP_HTTP_HOST=0.0.0.0 \
-e MCP_HTTP_ALLOWED_ORIGINS=http://localhost:3000 \
-e MCP_HTTP_ALLOWED_HOSTS=localhost:3000 \
-e MCP_HTTP_AUTH_MODE=bearer \
-e MCP_HTTP_BEARER_TOKEN=local-dev-token \
infra-lens-mcp node dist/server-http.jsObservability exports
Observability is a separate, disabled-by-default process that reads the latest persisted observations without initiating SSH collection:
INFRA_LENS_OBSERVABILITY_ENABLED=true infra-lens-observeThe default OpenMetrics endpoint is http://127.0.0.1:9464/metrics. Optional OTLP/HTTP JSON export uses standard OTEL_EXPORTER_OTLP_* variables. See Observability exports for Prometheus, OpenTelemetry, privacy, and remote-access guidance.
Development
pnpm run format:check
pnpm run lint
pnpm test
pnpm run test:coverage
pnpm run build
pnpm run check:metadata
pnpm run package:dry-runDocker-backed SSH e2e validation uses a self-contained fixture lifecycle:
pnpm run test:e2eIf a fixture is already running and you intentionally want to skip lifecycle management, use:
INFRA_LENS_E2E_SKIP_FIXTURE=1 pnpm run test:e2e:rawStart with the documentation index for usage, client setup, operations, incident workflows, observability, storage, security, governance, testing, and release guidance. Generated API docs live in docs/api, and reviewed incident examples live in examples/incidents.
Community
Use SUPPORT.md for support channels and response expectations. Active work is tracked in the infra-lens-mcp Governance project. Project conduct is defined in CODE_OF_CONDUCT.md, and maintainer triage policy lives in docs/governance.md.
Release
Releases are managed through release-please manifest mode and the guarded GitHub Actions release workflow. Implementation PRs must not publish packages, containers, MCP Registry entries, marketplace artifacts, or production GitHub Releases.
See docs/release.md and docs/release-state-machine.md.
License
Agent plugin and runtime configuration
This repository owns the product-level agent plugin, MCP runtime configuration, and product-specific skills for infra-lens-mcp. The central agent-tools repository should catalog this plugin, but the manifest and workflow instructions live here so they stay synchronized with the actual MCP server package.
File | Purpose |
Claude Code-valid product plugin manifest. | |
Claude Code project-local MCP server configuration. | |
Codex CLI MCP configuration example. | |
VS Code / GitHub Copilot workspace MCP configuration example. | |
OpenCode project MCP configuration example. | |
| OpenCode-native mirrored skill definitions. |
Agent runtime setup and validation notes. |
Validate plugin packaging locally:
claude plugin validate .For review-first remediation plans, incident drafts, and host/time-window comparisons, see Incident workflows.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables read-only Linux system diagnostics and troubleshooting on local and remote RHEL-based systems via SSH, including services, processes, logs, network, and storage analysis.Last updated20MIT
- AlicenseAqualityFmaintenanceEnables read-only Linux system diagnostics and troubleshooting on RHEL-based systems, including system info, services, processes, logs, network, and storage analysis. Supports both local and remote SSH execution across multiple hosts.Last updated20MIT
- AlicenseBqualityBmaintenanceAn MCP server for read-only Linux system administration and diagnostics on RHEL-based systems via SSH. It enables users to troubleshoot remote hosts by accessing system information, services, logs, and network configurations through natural language.Last updated19272Apache 2.0
- AlicenseCqualityCmaintenanceIncident Triage MCP is a Model Context Protocol (MCP) server for incident triage. It provides safe, auditable tools for evidence retrieval, deterministic summaries, ticket workflows, and notifications.Last updated28Apache 2.0
Related MCP Connectors
Remote MCP for A2A failure replay MCP, structured receipts, audit logs, and reviewer-ready evidence.
Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi
Remote MCP for A2A dependency inspector MCP, structured receipts, audit logs, and reviewer-ready evi
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/oaslananka/infra-lens-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server