-
-
Notifications
You must be signed in to change notification settings - Fork 2
cmd mcp
Start the nSelf MCP server and expose infrastructure tools to Claude Code and other MCP clients.
nself mcp [flags]
nself mcp starts a Model Context Protocol server that
exposes nSelf infrastructure operations as tools. MCP clients (including Claude Code) can
then call those tools 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 to expose the server over HTTP on a local
port instead.
The server provides six tools:
| Tool | Description |
|---|---|
nself_list_plugins |
List the plugin catalog (installed and available plugins) |
nself_get_schema |
Hasura GraphQL schema introspection |
nself_get_permissions |
Hasura role permissions snapshot |
nself_run_migration |
Apply a SQL migration (requires confirm: true; DDL allowlist enforced — see below) |
nself_tail_logs |
Tail Docker logs for a named service or plugin container |
nself_doctor |
Run nself doctor --deep and return the diagnostic report |
The server advertises itself via mDNS as _nself._tcp.local so Claude Code and other
mDNS-aware clients can discover a running instance on the local network automatically.
Pass --no-mdns to suppress this.
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.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--transport |
-t |
string | stdio |
Transport mode: stdio or sse
|
--port |
-p |
int | 3825 |
Port for SSE transport |
--no-mdns |
bool | false |
Disable mDNS service advertising |
# 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 without mDNS advertising (e.g. in CI)
nself mcp --no-mdns# Run SSE on a custom port without mDNS
nself mcp --transport sse --port 4000 --no-mdnsAdd 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.
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.
- 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 · docs.nself.org
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-watchdog · cmd-dogfood
- 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-security · cmd-secrets · cmd-waf
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license
- 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-ɳClaw, AI Assistant
- Feature-ɳChat, Messaging
- Feature-ɳTV, Media Player
- Feature-ɳFamily, Family Social
- Feature-ɳCloud, 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-ai
- 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
- 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