-
-
Notifications
You must be signed in to change notification settings - Fork 2
cmd mcp
Start the nSelf MCP server: 26 tools, 4 resources, and 3 prompts covering the real core CLI surface, for Claude Code and other MCP clients.
nself mcp [flags]
nself mcp starts a Model Context Protocol server that
exposes nSelf as tools, resources, and prompts. MCP clients (including Claude Code) can
then call those directly, without leaving their coding environment.
By default the server runs over stdio, which is the correct mode for Claude Code's
mcpServers configuration. Use --transport sse or --transport http (streamable HTTP)
to expose the server over a local port instead — set NSELF_MCP_TOKEN to require a bearer
token on those two transports (stdio has no network exposure, so it never needs one).
nself mcp must be run from inside a directory that contains an nSelf project (i.e. one
initialised by nself init). The server exits immediately if no project is found.
Every tool below calls the same internal Go package the matching nself <cmd> uses —
mutating tools (nself_build/nself_start/nself_stop/nself_restart/
nself_plugin_install) re-exec the nself binary itself (resolved via os.Executable(),
never a bare "nself" on PATH) rather than running in-process, since their CLI
implementations print operator banners to stdout and, for start/stop, install a
process-lifetime signal trap — neither of which belongs in a long-lived MCP server. Every
tool declares an output schema and read-only/destructive/idempotent annotations so an agent
can plan without probing.
| Name | Description |
|---|---|
nself_backup_list |
List local backups with id, date, size, and type |
nself_build |
Regenerate docker-compose.yml and nginx config from the project's env files. Overwrites prior generated output. |
nself_config_get |
Read one config key from the project's env file. Secret values are always redacted. |
nself_config_set |
Set one config key in the project's env file |
nself_config_show |
List every config key/value in the project's env file. Secret values are always redacted. |
nself_db_migrate_status |
List database migrations and whether each has been applied |
nself_deploy_status |
Fast local deploy-state read (postgres container presence + control-plane inventory). Not a full SSH-probed remote status — use the CLI for that. |
nself_doctor |
Run the full nSelf diagnostic suite (Docker, disk, ports, certs, and more) |
nself_env_list |
List available environments (dev/staging/prod) and which is active |
nself_get_permissions |
Return a snapshot of Hasura role permissions for all tables |
nself_get_schema |
Introspect the Hasura GraphQL schema and return table/type information |
nself_logs |
Tail recent docker compose logs for one service, or the whole stack |
nself_plugin_install |
Install one plugin by name (core path only — no --force/--preview/--dry-run) |
nself_plugin_list |
List the plugin catalog: registry entries and/or installed plugins |
nself_restart |
Restart the nSelf stack. Causes brief downtime. |
nself_run_migration |
Apply a SQL migration against the nSelf Postgres database. Requires explicit confirmation via the 'confirm' flag. A DDL allowlist blocks destructive statements even with confirm=true. |
nself_service_list |
List running/stopped services with container name, status, and health |
nself_start |
Start the nSelf stack (docker compose up). Safe to call when already running. |
nself_status |
Health status of every service in the current nSelf project |
nself_stop |
Stop the nSelf stack. Causes downtime for any consumer of this project's services. |
nself_urls |
Computed service URLs for the current project, grouped by required/optional/custom/frontend |
sentry_incidents_ack |
Acknowledge an open ɳSentry incident by id |
sentry_incidents_list |
List ɳSentry incidents, optionally filtered by status (open, acknowledged, resolved) |
sentry_monitors_add |
Create an ɳSentry uptime monitor. Tier quotas apply (free: 10 @ 5-min). |
sentry_monitors_list |
List ɳSentry uptime monitors for the authenticated tenant (id, name, url, kind, interval, status) |
sentry_status |
Fetch the ɳSentry public status page summary (overall status + per-component health) |
Regenerate this table from source with go run ./tools/mcpdoc — it text-scans
cmd/commands/mcp.go, cmd/commands/mcp_sentry.go, cmd/commands/mcp_resources.go, and
cmd/commands/mcp_prompts.go, so it can never drift from what the server actually
registers.
| Name | Description |
|---|---|
nself://config |
Project config snapshot |
nself://env |
Effective env cascade inputs |
nself://services |
Service inventory |
nself://urls |
Service URLs |
nself://env lists every env file present in the project (secrets redacted) but
deliberately does not compute which file wins for a given key — that precedence is being
revised (see nself env explain on the roadmap); ask the CLI, not this resource, for the
authoritative answer.
| Name | Description |
|---|---|
add-service |
Enable an optional service (or install a plugin) and bring it up safely |
diagnose-failure |
Investigate why an nSelf service is unhealthy or a project won't start |
prepare-deploy |
Run the pre-deploy checklist before promoting a project to staging or prod |
The five sentry_* tools wrap the same typed client the cmd-sentry command group uses,
so any MCP-capable AI agent can operate monitoring end to end. No dashboard visit needed.
Authentication resolves in this order: NSELF_SENTRY_API_KEY environment variable, then
~/.nself/sentry.json (written by nself sentry login). Set NSELF_SENTRY_API_URL to
target a self-hosted or local sentry bundle instead of the hosted SaaS.
Example prompts an agent can now handle:
Add an uptime monitor for https://api.example.com checked every minute.
Any open incidents right now? Acknowledge the critical one and summarize it.
Is our status page fully operational? If a component is degraded, list it.
List every monitor slower than a 60s interval and tell me which ones to tighten.
Write tools respect tier quotas server-side (free: 10 monitors at 5-minute intervals). The
API returns a quota error with an upgrade hint when a limit is reached. Monitor deletion is
deliberately not exposed over MCP; use nself sentry monitors rm from the CLI.
The nself_run_migration tool enforces a DDL allowlist before executing any SQL. This
prevents AI Studio sessions or automated agents from running destructive statements via
confirm: true set programmatically.
Permitted statement types:
CREATE TABLE IF NOT EXISTSALTER TABLE ADD COLUMNCREATE INDEXCREATE EXTENSIONCREATE POLICY-
INSERTwith an explicit column list -
UPDATEwith aWHEREclause DROP POLICY
Blocked statement types (return an error without executing):
| Blocked prefix | Why |
|---|---|
DROP TABLE |
Irreversible data loss |
DROP DATABASE |
Irreversible data loss |
DROP SCHEMA |
Irreversible data loss |
TRUNCATE |
Irreversible data removal |
DELETE FROM |
Unbounded data removal |
ALTER ROLE |
Privilege escalation |
GRANT |
Privilege escalation |
REVOKE |
Privilege removal |
\copy |
psql meta-command, data exfil risk |
\connect |
psql meta-command, connection switching |
The check is case-insensitive and strips leading SQL comments (-- ...) so that
comment-prefix bypasses are also blocked.
For blocked statement types, run nself db migrate directly from the CLI.
| Flag | Default | Description |
|---|---|---|
--port, -p
|
3825 |
Port for the sse/http transports |
--transport, -t
|
stdio |
Transport: stdio, sse, or http |
--help, -h
|
— | Show help |
# Run as a Claude Code MCP server using stdio (recommended)
nself mcp# Run as an SSE server for browser-based clients
nself mcp --transport sse# Run SSE on a custom port
nself mcp --transport sse --port 4000# Run the streamable-HTTP transport
nself mcp --transport http --port 4000# Require a bearer token on the sse/http transports (stdio never needs one)
NSELF_MCP_TOKEN=$(openssl rand -hex 32) nself mcp --transport httpAdd the following to your project's .claude/settings.json:
{
"mcpServers": {
"nself": {
"command": "nself",
"args": ["mcp"]
}
}
}Claude Code will start nself mcp automatically and connect over stdio.
- cmd-doctor — run the nSelf diagnostics suite
- cmd-plugin — manage the plugin catalog
- cmd-start — start the nSelf stack
ɳSelf CLI v1.0.9. MIT licensed. Docs CC BY 4.0.
GitHub · Issues · Discussions · nself.org · nself.org/docs
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-access · cmd-security · cmd-secrets
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license · cmd-dogfood (extracted, CLI-R11) · cmd-k8s (extracted, CLI-R11) · cmd-encryption (extracted, CLI-R11) · cmd-waf (extracted, CLI-R11) · cmd-federation (extracted, CLI-R11) · cmd-mail (extracted, CLI-R11) · cmd-dlq (extracted, CLI-R11)
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-nClaw, AI Assistant
- Feature-nChat, Messaging
- Feature-nTV, Media Player
- Feature-nFamily, Family Social
- Feature-nCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- plugin-nself-ai-gateway
- plugin-nself-ai-mcp
- plugin-nself-ai-mcp
- plugin-analytics
- plugin-auth
- plugin-backup-pro
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-cron-pro
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-donorbox-pro
- plugin-entitlements
- plugin-epg
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-notify-pro
- plugin-object-storage
- plugin-observability
- plugin-paypal-pro
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-recording
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-shopify-pro
- plugin-social
- plugin-sports
- plugin-stream-gateway
- plugin-streaming
- plugin-stripe-pro
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
Reference
- API-Reference
- error-codes, Error Codes
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions
All commands (52)
- A: cmd-access · cmd-account · cmd-admin
- B: cmd-backup · cmd-build · cmd-bundle
- C: cmd-ci · cmd-clean · cmd-completion · cmd-config
- D: cmd-db · cmd-deploy · cmd-dev · cmd-doctor
- E: cmd-env · cmd-exec
- F: cmd-functions
- G: cmd-generate
- H: cmd-health · cmd-help-topics
- I: cmd-init · cmd-install
- L: cmd-license · cmd-login · cmd-logout · cmd-logs
- M: cmd-man · cmd-mcp · cmd-migrate
- O: cmd-oauth · cmd-ops
- P: cmd-plugin · cmd-promote
- R: cmd-remove · cmd-reset · cmd-restart · cmd-runner
- S: cmd-secrets · cmd-security · cmd-self-heal · cmd-server · cmd-service · cmd-start · cmd-status · cmd-stop
- T: cmd-telemetry · cmd-template · cmd-trust
- U: cmd-update · cmd-urls
- V: cmd-verify-sbom · cmd-version