Manage Model Context Protocol (MCP) servers so AI tools can read from and act on your ɳSelf stack.
# See what MCP servers are available
nself mcp list
# Install the Postgres MCP server
nself mcp install postgres
# Run a server interactively (for debugging)
nself mcp run postgres
# Remove an installed server
nself mcp remove postgresnself mcp <SUBCOMMAND> [SERVER] [FLAGS]Model Context Protocol is an open standard that lets AI assistants (Claude, Cursor, Windsurf, and others) connect to tools and data sources through a structured JSON-RPC interface. nself mcp makes it easy to run MCP servers that expose your ɳSelf stack — your Postgres database, Hasura schema, file storage, and more — to whichever AI tool you are using.
Installed servers are registered in ~/.nself/mcp.json. Most AI coding tools read this file automatically (or you can point them at it in their settings). Each server process is managed by the CLI; you do not need to run them manually in production.
Show all available MCP servers and their installation status.
nself mcp list
# SERVER STATUS DESCRIPTION
# postgres installed Read and query your Postgres database
# hasura installed Introspect the Hasura GraphQL schema and run queries
# storage available Browse and upload files in MinIO storage
# search available Full-text search via MeiliSearch
# functions available Invoke serverless functionsDownload and register an MCP server. The server binary is placed in ~/.nself/mcp/ and added to ~/.nself/mcp.json.
| Flag | Type | Default | Description |
|---|---|---|---|
--env | string | current env | Environment to configure the server for: dev, staging, prod |
--read-only | bool | false | Restrict the server to read operations only (no mutations) |
--allow-tables | string | all | Comma-separated list of tables to expose (postgres server) |
nself mcp install postgres
nself mcp install hasura --read-only
nself mcp install postgres --allow-tables users,orders,productsUnregister an MCP server and remove its binary. Running sessions are terminated first.
nself mcp remove postgresStart an MCP server process in the foreground, printing its JSON-RPC traffic to stderr. Useful for debugging a new server or checking what an AI tool is requesting.
| Flag | Type | Default | Description |
|---|---|---|---|
--debug | bool | false | Print all JSON-RPC messages to stderr |
--port | int | 0 (stdio) | Listen on a TCP port instead of stdio (for HTTP-transport clients) |
nself mcp run postgres --debug
nself mcp run hasura --port 3333| Server | Requires | What it exposes |
|---|---|---|
postgres | Required service | Schema introspection, read queries, write queries (with --read-only guard) |
hasura | Required service | GraphQL schema, query execution, subscription metadata |
storage | MinIO optional | Bucket listing, file upload, file read, presigned URLs |
search | MeiliSearch optional | Full-text search across all indexed collections |
functions | Functions optional | List and invoke serverless functions by name |
After installing a server, point your AI tool at ~/.nself/mcp.json:
# Claude Code (claude.ai/code)
# Add to your project's .claude/settings.json:
{
"mcpServers": {
"nself-postgres": {
"command": "nself",
"args": ["mcp", "run", "postgres"]
}
}
}
# Cursor
# Settings → MCP → Add server → point at ~/.nself/mcp.jsonnself mcp install postgres --read-only --allow-tables users,products,orders
# Now Claude or Cursor can query these tables but cannot write to themnself mcp run hasura --debug 2>&1 | tee /tmp/mcp-debug.logNSELF_MCP_DIR — override the directory for MCP server binaries (default: ~/.nself/mcp/)DATABASE_URL — used automatically by the postgres server; loaded from your active envHASURA_GRAPHQL_ENDPOINT — used automatically by the hasura server0 — success1 — server not found or installation failed2 — invalid arguments3 — required service not running (e.g. postgres not started)