MCP Nexus
Provides tools to manage Docker services on the target server, alongside systemd and nginx.
Provides tools to perform Git operations on the target server, including commit, push, pull, and branch management.
Provides tools to operate and manage Linux servers over SSH, covering files, terminal commands, services, packages, and monitoring.
Provides tools to manage the nginx service on the target server.
Provides package-management tools for npm packages on the target server.
Provides tools to run PostgreSQL queries against databases on the target server.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Hosted Gateway
Don't want to install anything? Use the Lightcap-hosted MCP Nexus instance as a gateway to your servers:
https://lightcap.ai/mcp/nexusConnect your AI client directly, enter your own server credentials once, and let ChatGPT or Claude operate that machine through the gateway. No agent install, no daemon on your server, no custom packaging step.
Open that URL in a browser and you now get a real connect page, not a blank MCP endpoint. It explains the flow, shows the MCP and OAuth values, and links directly to GitHub and the docs while preserving the same path for actual MCP clients.
Why people use the hosted gateway:
Bring any Linux server you already own. MCP Nexus handles the AI-facing side.
Use one connection for terminal, files, git, deploy, database, process control, monitoring, and debugging.
Keep the target explicit. You type your own server host, SSH user, SSH port, and SSH password at connect time.
Skip setup overhead when you just want to put ChatGPT on a real machine and start shipping.
What that page does for humans:
Shows the exact MCP URL to paste into ChatGPT or Claude.
Shows manual OAuth values for clients that still ask for them.
Explains which values are OAuth credentials and which values are your real server credentials.
Links back to the GitHub repository and README for deeper setup details.
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"nexus": {
"url": "https://lightcap.ai/mcp/nexus/sse",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}Claude Code (.mcp.json):
{
"mcpServers": {
"nexus": {
"url": "https://lightcap.ai/mcp/nexus/sse"
}
}
}ChatGPT Apps / Connectors
Use the MCP server URL directly:
Connector URL:
https://lightcap.ai/mcp/nexus
ChatGPT discovers OAuth automatically from:
https://lightcap.ai/.well-known/oauth-authorization-serverhttps://lightcap.ai/.well-known/oauth-protected-resource/mcp/nexus
During Connect, MCP Nexus redirects you to a consent screen where you choose the SSH target for that ChatGPT connection. The resulting OAuth access token is then bound to that server and every tool call is routed through the matching SSH pool.
ChatGPT Connect In 60 Seconds
What you will enter on the MCP Nexus consent page:
Your server host or IP
Your SSH user
Your SSH port
Your SSH password
Those are your real server credentials. They do not go into OAuth client_id or client_secret.
If the ChatGPT UI asks for manual OAuth fields instead of using discovery, use:
MCP URL:
https://lightcap.ai/mcp/nexusAuth URL:
https://lightcap.ai/authorizeToken URL:
https://lightcap.ai/tokenRegistration URL:
https://lightcap.ai/registerAuthorization server base:
https://lightcap.aiResource:
https://lightcap.ai/mcp/nexusClient ID:
nexus-lightcap-prodClient Secret:
nxs_sec_9f78f08ec360-lc2026Scope:
nexusor leave it blank if the client allows that
These are the shared manual OAuth values for the Lightcap-hosted gateway only. They are not your server credentials and they are not meant for self-hosted MCP Nexus deployments.
Do not use these values in ChatGPT Connect:
https://lightcap.ai/mcp/nexus/oauth/tokenas Auth URLhttps://lightcap.ai/mcp/nexus/oauth/tokenas Token URLYour server IP as OAuth
client_idYour SSH password as OAuth
client_secret
Important: ChatGPT Connect uses standard OAuth discovery plus the consent screen. SSH host, user, port, password, or key belong in the consent step, not in OAuth client fields.
If ChatGPT opens a page on https://lightcap.ai/..., that is expected. That page is the OAuth consent screen. Enter your real SSH target there:
SSH host: your server host or IP such as
149.102.155.77SSH user: your SSH username such as
rootSSH port: usually
22SSH password / key: your real SSH credential for that server
Do not reuse those SSH values as OAuth client_id or client_secret.
If you self-host MCP Nexus and want manual OAuth fields to work, configure a real static OAuth client in the server first:
NEXUS_OAUTH_CLIENT_IDNEXUS_OAUTH_CLIENT_SECRETNEXUS_OAUTH_CLIENT_REDIRECT_URIS
NEXUS_OAUTH_CLIENT_REDIRECT_URIS must contain the exact ChatGPT callback URL shown by the client.
If you previously saved a connector with old manual values such as:
Auth URL:
https://lightcap.ai/mcp/nexus/oauth/tokenToken URL:
https://lightcap.ai/mcp/nexus/oauth/tokenclient_id= your server IPclient_secret= your SSH password
delete that connector and create a fresh one. ChatGPT may keep reusing the stale OAuth client configuration, which produces invalid /authorize requests instead of the standards-based discovery flow.
If ChatGPT says Client ID '...' not found, the problem is not localhost handling and not your SSH target. It means the OAuth client_id in the connector does not match a configured MCP Nexus OAuth client.
Legacy machine-to-machine token flow
For scripts, curl tests, or non-ChatGPT clients, the legacy gateway token endpoint still exists. This is a separate flow and should not be used as the ChatGPT Connect configuration:
curl -X POST https://lightcap.ai/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "YOUR_SERVER_IP",
"client_secret": "YOUR_SSH_PASSWORD"
}'The gateway validates by connecting to your server via SSH. Once authenticated, all 163 MCP tools operate on YOUR server through the Lightcap gateway. Full audit logging, rate limiting, and connection pooling included.
flowchart LR
AI["Your AI"] -->|MCP / HTTPS| Gateway["lightcap.ai/mcp/nexus<br/>Hosted Gateway"]
Gateway -->|SSH| Target["Your Server<br/>Target Host"]Self-hosted? Skip the gateway and run MCP Nexus on your own machine — see Quick Start below.
Related MCP server: remote-admin-mcp
Why MCP Nexus?
Most MCP servers give you tools. Nexus gives you tools that remember.
Every command you run, every service you restart, every file you edit — Nexus quietly learns your patterns. The next time you connect, it already knows what you were working on, which paths you use most, and what you'll probably need next.
flowchart LR
Client["You via Claude / GPT"] -->|MCP| Nexus
Nexus -->|SSH| Host
subgraph NexusBox["MCP Nexus"]
direction TB
Nexus["Gateway + Tool Surface"]
Intelligence["Intelligence"]
Memory["Session memory"]
Preferences["Preference learning"]
Workflows["Workflow detection"]
Suggestions["Smart suggestions"]
Nexus --> Intelligence
Intelligence --> Memory
Intelligence --> Preferences
Intelligence --> Workflows
Intelligence --> Suggestions
end
subgraph TargetBox["Your Server"]
direction TB
Host["Execution Target"]
Files["Files<br/>read, write, edit, search, diff"]
Terminal["Terminal<br/>execute commands, scripts"]
Git["Git<br/>commit, push, pull, branch"]
Services["Services<br/>systemd, docker, nginx"]
Database["Database<br/>PostgreSQL queries"]
Debug["Debug<br/>lint, typecheck, syntax, TODOs"]
Monitoring["Monitoring<br/>health, metrics, logs"]
Deploy["Deploy<br/>sync, restart, rollback"]
Network["Network<br/>ports, DNS, SSL, forwarding"]
Packages["Packages<br/>pip, apt, npm"]
end
Host --> Files
Host --> Terminal
Host --> Git
Host --> Services
Host --> Database
Host --> Debug
Host --> Monitoring
Host --> Deploy
Host --> Network
Host --> PackagesWhat makes it different
Other MCP servers | MCP Nexus | |
Hosted gateway | Install-only | Use |
Memory | Stateless — every session starts from zero | Remembers your sessions, preferences, and workflows |
Scope | Single-purpose (just files, just git) | 163 tools covering the full DevOps stack |
Debugging | None | Lint, typecheck, syntax check, error search, symbol finder |
Connection | Spawns new processes per call | Pooled SSH connections with auto-reconnect |
Recovery | You notice when things break | Watchdog auto-restarts crashed services |
Auth | None or basic | OAuth2 with scoped tokens and rate limiting |
Audit | None | Every tool call logged with timing |
Quick Start
Install
mkdir -p ~/mcp-nexus
cd ~/mcp-nexus
python3 -m venv .venv
source .venv/bin/activate
pip install "git+https://github.com/farukalpay/mcp-nexus.git"
mcp-nexus init .Or from a local checkout:
git clone https://github.com/farukalpay/mcp-nexus.git
cd mcp-nexus
python -m venv .venv && source .venv/bin/activate
pip install -e .
mcp-nexus init .Configure
mcp-nexus init . # writes .env
mcp-nexus init . --systemd
# Edit .env with your server credentialsMinimal .env:
NEXUS_SSH_HOST=your-server-ip
NEXUS_SSH_KEY_PATH=~/.ssh/id_rsaNote:
NEXUS_SSH_USERdefaults toroot. If your host uses a different account, set it explicitly in.env. Any non-root user should have the permissions your tool set requires for service, package, and deployment operations.
mcp-nexus init is the pip-first setup path. It writes a runnable .env in the target directory and can also generate a systemd unit example bound to the currently installed Python environment.
Connect to your AI
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"nexus": {
"command": "mcp-nexus",
"args": ["serve", "--transport", "stdio"]
}
}
}Claude Code (.mcp.json):
{
"mcpServers": {
"nexus": {
"command": "mcp-nexus",
"args": ["serve", "--transport", "stdio"]
}
}
}Remote / HTTP mode (for web apps, shared teams):
mcp-nexus serve # starts on port 8766
# Then connect via: http://your-host:8766/mcpDocker:
docker compose up -dIntelligence
The intelligence layer is what turns Nexus from a tool shelf into an operating context. It stores interaction history in SQLite (~/.mcp-nexus/memory.db by default), keeps a JSONL audit trail, and exposes both layers back through MCP tools.
What it learns
Session context: recent actions, errors, and the last active workflow.
Preferences: repeated repo paths, working directories, services, sandboxes, and deployment roots.
Workflow patterns: explicit tool-to-tool transitions such as
git_status -> git_diff -> git_commit.Operational hotspots: slow tools, failure-heavy tools, and audit-derived bottlenecks.
Intelligence & Observability Tools
Tool | What it does |
| Recovers the last active context, recent actions, and learned preferences |
| Shows totals, focus areas, failure hotspots, slow tools, and workflow signals |
| Suggests likely next tools from observed sequences |
| Lists, sets, or clears learned preferences |
| Returns the strongest detected multi-step workflows |
| Exposes the explicit tool catalog and category counts |
| Reads recent structured audit entries |
| Aggregates error rate, p95 duration, and hotspot tools |
| Filters recent failed tool calls |
| Surfaces the slowest recent calls for optimization work |
Capability-Aware Defaults
Nexus no longer assumes one distro or service stack. It probes the connected host and uses that capability model to choose sensible defaults for:
package management (
apt,dnf,yum,apk,pacman,zypper,brew)service control (
systemd,service,launchctl)compose/runtime flows (
docker compose,docker-compose,podman compose)Python execution and sandbox support
Disable intelligence with NEXUS_INTELLIGENCE=false if you prefer stateless mode.
Registry & Diagnostics
Nexus now separates stable registry generation from live session binding:
every process gets a
server_instance_idevery tool snapshot gets a
registry_versionevery tool exposes a stable alias like
/mcp-nexus/db_querystable and runtime alias paths are callable over HTTP (
GETwith query params orPOSTJSON body)runtime binding details are attached as
resolved_runtime_idmetadata
For debugging registry drift and session issues, the HTTP server exposes:
/health/ready/version/tool-registry/sessions/session/{id}/mcp-nexus/{tool_name}/mcp-nexus/runtime/{server_instance_id}/{tool_name}
When OAuth is enabled, HTTP tool-alias invocation requires a valid bearer token.
The same metadata is also available through MCP resources:
nexus://tool-registrynexus://versionnexus://session/{id}
Execution-heavy tools such as execute_command, execute_python, and the database suite now return structured payloads with:
ok,error_code,error_stagestdout,stderr,stdout_preview,stderr_previewartifact_pathsserver_instance_id,registry_version,request_id,trace_id,session_idbackend_kind,backend_instance,duration_ms
Detached Jobs
Long-running jobs no longer need ad-hoc nohup, repeated sleep, or manual ps/tail/wc polling.
run_background_commandlaunches a detached job with managed stdout/stderr capturebackground_job_statusreturns pid, cpu/memory snapshot, log sizes, and previewsbackground_job_waitwaits server-side instead of forcing the client to pollbackground_job_logsreads captured output directlybackground_job_stopterminates by job idlist_background_jobsgives you a reusable inventory across sessions
The runner enables PYTHONUNBUFFERED=1 by default and uses stdbuf -oL -eL when available, which fixes the common “process is busy but log file stays empty” failure mode for ML/data jobs and similar pipelines.
Deep Tool Surfaces
These tools were added to remove repeated shell choreography, not to inflate the catalog:
execute_batchruns a sequence of commands with shared limits, per-step results, and adry_runpreview. Use it for smoke tests, multi-step deploy validation, and command plans you want to inspect before execution.git_diagnoseturns repo state into one structured report: branch, upstream, ahead/behind, conflicts, worktrees, stashes, and optional diff stats.compare_pathscompares two files or directory trees with structured change counts and patch previews. Large diffs spill into artifacts automatically.
Example flows:
Dry-run a release command batch, then rerun the exact same list with
stop_on_error=true.Call
git_diagnosebefore any pull or commit to surface detached HEAD state or unresolved merge/rebase work.Use
compare_pathsto preview a release tree against the live tree before activation or rollback.
These behaviors are identical in hosted and self-host mode because they run against the connected target host through the same managed execution layer.
Tools
MCP Nexus currently exposes 163 tools across execution, infrastructure, deployment, intelligence, audit, and host-side data analysis layers.
Filesystem (20 tools)
Tools | Description |
| Structured file reads with offsets and log-friendly previews |
| Write, patch, and replace file contents |
| Explore directories and search content quickly |
| Inspect metadata and file characteristics |
| Compare files or directory trees with structured summaries and patch previews |
| Perform filesystem mutations with safety guards |
| Adjust permissions and ownership |
Terminal & Runtime (11 tools)
Tools | Description |
| Managed shell execution with usage metrics and optional CPU/memory/file/process limits |
| Multi-line script execution through any interpreter |
| Execute a sequence of commands with shared limits, dry-run preview, and per-step results |
| Direct Python execution with optional reusable virtualenv sandbox |
| Execute an existing Python file with optional sandboxed dependencies and structured database URI injection |
| Inspect runtime defaults, detected backends, and binary availability |
| Lifecycle management for reusable Python sandboxes on the target host |
Git (15 tools)
Tools | Description |
| Inspect worktree state, diagnose repo health, history, and specific objects |
| Stage explicitly and create commits |
| Drive branch and remote sync workflows |
| Inspect remotes/tags, stash changes, and trace authorship |
Debug & Code Analysis (12 tools)
Tools | Description |
| Lint, format, and type-check code with the best available tool |
| Validate syntax, inspect Python issues, and run detected test suites |
| Search source and logs for TODOs, failures, and stack traces |
| Navigate symbols, references, and diffs |
Process & Services (24 tools)
Tools | Description |
| Service inventory and status through the detected service manager |
| Lifecycle control for services |
| Boot-time control and dependency inspection |
| Process inspection, point-in-time resource state, and intervention |
| Managed detached execution with built-in log capture and fast inspection |
| Server-side waiting, stop control, and reusable job inventory |
| Crontab management |
| Compose-level service and log inspection |
Database (22 tools)
Tools | Description |
| Inspect target-side database client readiness: |
| Prepare a reusable database client sandbox with modern |
| List named database profiles and bind the current MCP session to one without exposing secrets |
| Inspect a PostgreSQL target from a named profile or a PostgreSQL URI without relying on Python DB drivers |
| Run SQL from either a named profile or a direct PostgreSQL URI, with optional |
| Inspect execution plans with explicit EXPLAIN tooling |
| Explore schema, index layout, compact table snapshots, and sample rows with safe identifier quoting |
| Profile tables from PostgreSQL statistics and surface likely join candidates |
| Write query output to a CSV artifact or a stable output path in one step |
| Operational database visibility and extension inventory |
Monitoring (10 tools)
Tools | Description |
| High-level resource and pressure snapshots |
| Focused resource inspection |
| Interface and socket visibility |
| Opinionated service-specific health views |
Deployment (11 tools)
Tools | Description |
| Direct sync/restart/validation workflows |
| Release-directory deployment with stable symlink activation and rollback |
| Compose-aware deploy/update flow |
| Backup and restore utilities |
| Fast Python package installs for deploy hooks or bootstrap steps |
Network & Port Forwarding (14 tools)
Tools | Description |
| Port reachability and socket discovery |
| Connectivity and routing diagnostics |
| Firewall and NAT inspection/control |
| Forwarding and tunnel lifecycle management |
Package Management (12 tools)
Tools | Description |
| Capability-aware system package workflows |
| Debian-specific compatibility tools |
| Python package and virtualenv inspection |
| Node package inspection and installation |
Analysis (2 tools)
Tools | Description |
| Profile a CSV file or SQL result into a model-oriented dataset summary without shipping raw Python in tool args |
| Train a general tabular classifier from CSV or SQL using a managed Python sandbox and return a structured evaluation report |
Intelligence (6 tools)
Tools | Description |
| Recover context, analytics, and next-step suggestions |
| Manage learned preferences and inspect the catalog/workflow model |
Logs & Audit (4 tools)
Tools | Description |
| Query structured audit history and operational hotspots |
Architecture
flowchart TB
Client["AI Client / MCP Host"] --> Gateway["FastMCP Server / Gateway"]
Gateway --> Middleware["Auth + Rate Limit + Request Trace"]
Middleware --> Registry["Stable Registry<br/>server_instance_id + registry_version"]
Middleware --> Sessions["Session Store<br/>live binding + active DB profile"]
Registry --> Tools["Tool Catalog (163 tools)"]
Sessions --> Tools
Tools --> Runtime["Capability Probe + Managed Execution + Python Sandbox"]
Tools --> Jobs["Detached Job Layer<br/>run/wait/log/status"]
Tools --> Memory["Intelligence Layer (SQLite)"]
Tools --> Audit["Audit Log (JSONL + in-memory index)"]
Tools --> Artifacts["Artifact Store<br/>stdout/stderr/CSV spillover"]
Runtime --> Pool["SSH Pool / Local Executor"]
Pool --> Target["Target Host"]
Target --> Domains["Files, Git, Services, DB, Network, Packages, Deploy"]
Memory --> Tools
Audit --> Tools
Registry --> Endpoints["/health /ready /version /tool-registry /session/{id}"]Layering
Tool layer stays thin and task-oriented.
Registry layer owns stable tool identity and runtime binding metadata.
Runtime layer owns capability detection, execution wrapping, resource reporting, and sandbox setup.
Detached job layer owns long-running background commands and their captured logs.
Transport layer owns SSH pooling and localhost fallback.
Intelligence + audit layers observe behavior without owning product logic.
How it works
The AI issues an MCP tool call.
Nexus resolves the target host, the active session, and the current registry binding.
Capability probing chooses the right package/service/runtime backend for that host.
Execution-heavy tools return structured envelopes and spill large output into local artifacts.
Long-running jobs can move into the detached job layer with durable job ids and captured stdout/stderr.
Audit + intelligence persist what happened and expose it back through MCP and HTTP diagnostics.
Localhost mode
When NEXUS_SSH_HOST is 127.0.0.1, localhost, or another local interface, Nexus skips SSH entirely and executes locally. This makes CI, laptop workflows, and single-node deployments simpler without changing the tool surface.
When Nexus itself runs inside Docker, that assumption changes: container localhost is the container, not the host machine. Nexus now treats loopback targets as host-bridge targets by default in containerized deployments so localhost-scoped SSH and database profiles keep pointing at the intended host instead of the container namespace.
Configuration
All configuration is environment-driven. Host capability detection supplies the operational defaults; environment variables only override when you need explicit behavior.
SSH
Variable | Default | Description |
|
| Target server hostname or IP |
|
| SSH port |
|
| SSH username |
| SSH password | |
| SSH private key path | |
|
| Max concurrent SSH connections |
Server & Runtime
Variable | Default | Description |
|
| Bind host |
|
| Bind port |
|
| MCP endpoint path |
| Optional comma-separated legacy/compatibility MCP paths such as | |
|
| Logging level |
| Default working directory for execution tools | |
|
| Default command timeout |
|
| Stdout truncation limit |
|
| Stderr truncation limit |
|
| Inline stdout preview size before artifact spillover |
|
| Inline stderr preview size before artifact spillover |
|
| Local artifact directory for oversized stdout/stderr/CSV exports |
|
| Stable HTTP-style alias prefix attached to every tool |
|
| Forwarded headers copied into request/session metadata |
| auto-detect | Force container-runtime detection when localhost should not mean host-local execution |
| auto-detect | Host bridge address used when containerized Nexus must reach host-local services such as SSH or PostgreSQL |
|
| Re-enable container-local execution if you intentionally want |
Intelligence & Audit
Variable | Default | Description |
|
| Enable/disable the intelligence layer |
|
| Local data directory for SQLite memory |
|
| Audit log path; leave empty to use the default under |
Target Host Paths
These paths are evaluated on the connected target host, not expanded on the MCP client side.
Variable | Default | Description |
|
| Root directory for reusable Python sandboxes |
|
| Root directory for detached background jobs and captured stdout/stderr |
|
| Release directory root for release-based deploys |
|
| Stable symlink used by activation/rollback tools |
Security
Variable | Default | Description |
| Public HTTPS origin used by ChatGPT and OAuth discovery | |
|
| Enable standards-based OAuth discovery, registration, and consent routes |
|
| OAuth authorization server issuer |
|
| Optional static OAuth client ID for manual Auth URL / Token URL screens |
| Optional static OAuth client secret for manual OAuth screens | |
| Comma-separated exact callback URLs allowed for the static OAuth client | |
|
| Valid scopes exposed via OAuth metadata |
|
| Scopes granted by default to registered clients |
|
| Access token lifetime |
|
| Refresh token lifetime |
|
| Authorization code lifetime |
|
| Consent UI path used during ChatGPT Connect |
|
| Persistent encrypted state for OAuth clients, bindings, access tokens, and refresh tokens |
| auto-generated | Optional Fernet key used to encrypt the persisted state file |
|
| Requests per minute |
|
| Burst capacity |
Database (optional)
Use named profiles when you do not want agents to ever see raw credentials in tool arguments. Legacy NEXUS_DB_* variables still work and are mapped into the default profile for backward compatibility.
When Nexus executes database commands locally from inside Docker and a database profile points at localhost, Nexus resolves that loopback target through the host bridge instead of the container namespace. SSH-backed sessions keep localhost unchanged, because psql runs on the remote target host rather than inside the Nexus container.
If you provide a PostgreSQL URI, it must be standards-compliant. Passwords containing reserved characters such as # must be URL-encoded, otherwise the URI is malformed before Nexus can parse it.
If an agent needs Python-side database libraries for follow-up work, use db_client_bootstrap first and pass the returned sandbox path into execute_python.sandbox_path. That keeps driver installs isolated from the system interpreter and avoids ad-hoc pip install shell sequences.
If your MCP client is sensitive to raw shell payloads, prefer structured workflows:
Use
db_profiles/db_useor adatabaseURI argument instead of embedding credentials into shell strings.Use
db_export_csv(output_path=...)to materialize a stable dataset file on the host.Use
execute_python_filefor existing scripts andtrain_tabular_classifierfor ad-hoc model evaluation instead of inline heredoc Python.
Variable | Default | Description |
| JSON object of named PostgreSQL profiles consumed by | |
|
| Default profile when no session-bound profile is active |
| Single PostgreSQL URI alternative to the legacy | |
| PostgreSQL host | |
|
| PostgreSQL port |
| Database name | |
| Database user | |
| Database password | |
| Optional PostgreSQL SSL mode for the legacy/default profile |
Watchdog
Variable | Default | Description |
| Comma-separated services to monitor | |
|
| Health check interval (seconds) |
|
| Max auto-restarts per cooldown window |
|
| Cooldown window (seconds) |
Deployment
Docker
docker compose up -dThe bundled compose file now does two extra things on purpose:
Persists
~/.mcp-nexusso OAuth clients, bindings, refresh tokens, and access tokens survive container restarts.Injects
host.docker.internalviahost-gatewayso loopback SSH/database targets can resolve back to the host machine instead of the container itself.
Systemd
./scripts/deploy-to-server.sh your-server-ip root 22Creates a systemd service with auto-restart + nginx reverse proxy snippet. If .env already contains NEXUS_SSH_HOST, NEXUS_SSH_USER, NEXUS_SSH_PORT, or NEXUS_SSH_KEY_PATH, the script will use them automatically when arguments are omitted.
The generated nginx snippet now includes /mcp/nexus, /mcp, /mcp-nexus, /health/nexus, /ready/nexus, and /version/nexus so legacy clients and new diagnostics can coexist cleanly.
If your domain is already served by another frontend application, do not let those OAuth and MCP paths fall through to the website router. Route them to MCP Nexus on the same public origin or ChatGPT Connect will fail.
Release-Based Deploys
The built-in deploy tools support a cleaner release flow than a one-off restart:
deploy_releasesyncs intoNEXUS_RELEASE_ROOT/<timestamp>deploy_activate_releaseupdatesNEXUS_CURRENT_RELEASE_LINKdeploy_health_checkvalidates the new releasedeploy_rollback_releaseflips the symlink back when needed
This keeps rollback state explicit and inspectable instead of burying it in ad-hoc shell scripts.
Compose Deploys
Use deploy_compose when the target host has docker compose, docker-compose, or podman compose available. Nexus detects the backend and drives the correct command by capability rather than by a hardcoded distro assumption.
Behind Nginx
location /mcp/nexus {
proxy_pass http://127.0.0.1:8766/mcp/nexus;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}
location = /.well-known/oauth-authorization-server {
proxy_pass http://127.0.0.1:8766/.well-known/oauth-authorization-server;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /.well-known/oauth-protected-resource/ {
proxy_pass http://127.0.0.1:8766/.well-known/oauth-protected-resource/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /authorize {
proxy_pass http://127.0.0.1:8766/authorize;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /token {
proxy_pass http://127.0.0.1:8766/token;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /register {
proxy_pass http://127.0.0.1:8766/register;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /oauth/consent {
proxy_pass http://127.0.0.1:8766/oauth/consent;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /oauth/token {
proxy_pass http://127.0.0.1:8766/oauth/token;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
}Important: ChatGPT
Connectdepends on/.well-known/oauth-authorization-server,/.well-known/oauth-protected-resource/...,/authorize,/token,/register, and/oauth/consentbeing reachable on the same public origin as/mcp/nexus. If any of those paths fall through to the website frontend,Connectwill fail before the first tool call.
Same-Origin Frontend Apps
If you already have a FastAPI or Starlette app on the public origin and MCP Nexus runs on an internal port, install the built-in proxy helper so your frontend app forwards the MCP and OAuth surface instead of returning its own 403/404 page.
Install the optional extra first:
pip install "mcp-nexus[fastapi]"from fastapi import FastAPI
from mcp_nexus.public_proxy import install_fastapi_public_proxy
app = FastAPI()
install_fastapi_public_proxy(
app,
upstream_base_url="http://127.0.0.1:8766",
)The helper forwards these path groups by default:
/mcp/mcp/nexus/.well-known/oauth-authorization-server/.well-known/oauth-protected-resource/.../authorize/token/register/oauth/consent/oauth/token/health/nexus/ready/nexus/version/nexus/info/nexus
Preferred production pattern:
Put nginx in front and proxy those paths directly to MCP Nexus.
If you must terminate routing inside an existing FastAPI app, use
install_fastapi_public_proxy(...).Do not serve
/authorizeor/.well-known/...from your marketing or SPA router.Let
GET /mcp/nexusreach MCP Nexus for browsers too. It now renders a connect-style landing page with instructions, GitHub links, and manual OAuth values instead of a raw machine-only surface.
Typical symptom of broken same-origin routing:
ChatGPT opens
/authorize?...and you see403 Forbidden,404, or your website error page instead of the MCP Nexus consent screen.
That is an ingress problem, not an OAuth problem and not an SSH localhost problem.
Authentication
For ChatGPT Apps and connectors, MCP Nexus now exposes a standards-based OAuth surface next to the MCP resource server:
MCP resource server:
/mcp/nexusAuthorization server metadata:
/.well-known/oauth-authorization-serverProtected resource metadata:
/.well-known/oauth-protected-resource/mcp/nexusDynamic client registration:
/registerAuthorization code + PKCE:
/authorizeand/tokenConsent UI:
/oauth/consent
During Connect, the consent form binds the resulting OAuth token to an SSH target. Every MCP call carrying that token is then routed to the correct SSH pool.
Which fields to use in ChatGPT
For ChatGPT Apps / Connectors, the preferred input is only:
MCP URL:
https://lightcap.ai/mcp/nexus
ChatGPT should discover the rest automatically from the well-known OAuth metadata.
If a manual OAuth form appears, use:
MCP URL:
https://lightcap.ai/mcp/nexusAuth URL:
https://lightcap.ai/authorizeToken URL:
https://lightcap.ai/tokenRegistration URL:
https://lightcap.ai/registerAuthorization server base:
https://lightcap.aiResource:
https://lightcap.ai/mcp/nexusClient ID:
nexus-lightcap-prodClient Secret:
nxs_sec_9f78f08ec360-lc2026Scope:
nexusor blank
Do not enter:
https://lightcap.ai/mcp/nexus/oauth/tokenas Auth URL or Token URLYour server IP as
client_idYour SSH password as
client_secret
Those values belong to the legacy machine-to-machine flow below, not the ChatGPT connector flow.
If ChatGPT opens /authorize with a URL that does not include code_challenge=..., you are still using an old manual OAuth configuration. Remove that connector and add MCP Nexus again from the MCP URL only.
If ChatGPT returns Client ID '...' not found, that is an OAuth client registration problem, not an SSH host or localhost problem. It means the value in the ChatGPT OAuth form does not match a configured static OAuth client on the server.
If the connector redirects you to https://lightcap.ai/..., that is the correct consent step. Enter the real SSH target there. Do not enter your server IP into OAuth client_id, and do not enter your SSH password into OAuth client_secret.
For the Lightcap-hosted gateway, the standard shared manual client is:
Client ID:
nexus-lightcap-prodClient Secret:
nxs_sec_9f78f08ec360-lc2026
You still enter your own server host, SSH user, SSH port, and SSH password on the consent page after OAuth succeeds.
Legacy gateway token flow
The direct machine-to-machine endpoint remains available for scripts and manual testing:
curl -X POST https://lightcap.ai/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "YOUR_SERVER_IP",
"client_secret": "YOUR_SSH_PASSWORD",
"ssh_user": "root",
"ssh_port": 22
}'Self-hosted mode
When running MCP Nexus privately on your own machine, disable public OAuth by omitting NEXUS_PUBLIC_BASE_URL or setting NEXUS_OAUTH_ENABLED=false.
Troubleshooting
If ChatGPT Connect opens a website page, 403, or 404 instead of MCP Nexus, your same-origin proxy is incomplete. Make sure
/.well-known/oauth-authorization-server,/.well-known/oauth-protected-resource/...,/authorize,/token,/register,/oauth/consent, and/mcp/nexusall reach MCP Nexus on the same public origin.If Cloudflare or another edge firewall returns
403/1010on/mcp/nexusor the OAuth discovery paths while the origin works directly, exclude the MCP and OAuth routes from browser-signature or bot-fight rules. ChatGPT and other MCP clients are not guaranteed to look like a normal browser.If
git_diagnoseorcompare_pathsreturnsGIT_UNAVAILABLE, installgiton the target host.compare_pathsuses Git's--no-indexdiff engine so it can produce structured rename and summary output.If
compare_pathssays a path is missing, verify both path arguments on the target host, not the MCP client.If
execute_batchstops after the first failure, that is by design whenstop_on_error=true. Set it tofalseif you want the remaining commands to run and inspect each step'serror_code.Large outputs from
execute_batchorcompare_pathsspill into local artifact files automatically. Checkartifact_paths,stdout_preview, andstderr_previewin the tool result when the inline payload is truncated.
Development
git clone https://github.com/farukalpay/mcp-nexus.git
cd mcp-nexus
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest # run tests
ruff check . # lint
mypy mcp_nexus/ # type checkLicense
MIT License - see LICENSE for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Persistent Linux computers for AI agents: desktop, signed-in browser, vault, apps and shell.
Linux VMs for AI agents: create VMs, run commands, edit files and open preview URLs.
Related MCP Servers
AlicenseAqualityBmaintenanceEnables AI assistants to manage remote servers via SSH with 43 specialized tools for command execution, file editing, directory operations, and background tasks across Linux, macOS, and Windows.4636 PyPI9GPL 3.0- AlicenseAqualityBmaintenanceEnables AI assistants to manage remote servers via SSH with agentless command execution, file operations, and service management.9MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to SSH into Linux servers, run commands, deploy code, and manage servers via natural language, also doubles as a CLI for manual use.3MIT
- AlicenseAqualityDmaintenanceEnables AI agents to securely connect to and manage remote servers via SSH, with tools for running commands, file operations, log inspection, service management, and system monitoring under configurable access controls and audit logging.127 npm1MIT