Skip to content

Latest commit

 

History

History
402 lines (334 loc) · 19.3 KB

MCP-SERVERS.md

File metadata and controls

402 lines (334 loc) · 19.3 KB

MCP server configuration files

Nebula can import MCP servers from the JSON files that Claude Desktop, Cursor, and VS Code already use, and export its own servers back to that format. You can usually import an existing file unchanged.

nebula-core mcp import ~/.cursor/mcp.json            # preview only
nebula-core mcp import ~/.cursor/mcp.json --apply    # save the servers
nebula-core mcp export mcp.json                      # write Nebula's servers

New servers start disabled and local programs start untrusted, unless you choose otherwise for that import: tick Enable after import (CLI: --enable) and pick a Tool approval (CLI: --approval ask). Enabling a local (stdio) program also needs Trust (CLI: --trust-local-programs), because it runs on the Nebula host outside the automation container; without it the program is saved disabled. Nebula probes every server it enables so its tools are ready. You can also enable servers later: open Settings → Automation → MCP servers, tick I trust this local program for a stdio server (Edit), then Probe and Enable it.

Importing a file you imported before updates only what changed; see Preview, conflicts, and re-importing.

Where to find an existing file

Client File
Claude Desktop claude_desktop_config.json (Settings → Developer → Edit Config)
Claude Code .mcp.json in a project
Cursor ~/.cursor/mcp.json or .cursor/mcp.json in a project
VS Code .vscode/mcp.json, or the "mcp" key in settings.json

Nebula never reads these locations by itself; you choose the file to import.

File structure

The file is a JSON object with the servers under one of these keys, each server keyed by its name:

{ "mcpServers": { "NAME": { ... } } }       // Claude, Cursor
{ "servers":    { "NAME": { ... } } }       // VS Code .vscode/mcp.json
{ "mcp": { "servers": { "NAME": { ... } } } } // VS Code settings.json

A single file may contain up to 200 servers. Names may use letters, digits, ., _, and -; other characters are replaced with - and the preview says so.

Local (stdio) server

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}",
        "LOG_LEVEL": "info"
      }
    }
  }
}
Field Required Meaning
command yes Program to run on the Nebula host. A bare name such as npx or uvx is resolved on the host PATH when you import; an absolute path is used as given. Relative paths are rejected.
args no List of arguments, passed literally. They cannot contain ${...}; put values in env instead.
env no Environment variables for the program. See Values and secrets.
cwd no Absolute working directory on the host. Omit it to run in the Project workspace.
type no "stdio". Inferred from command when omitted.

Remote (HTTP) server

{
  "mcpServers": {
    "intel": {
      "type": "http",
      "url": "https://mcp.example.com/mcp",
      "headers": { "Authorization": "Bearer ${INTEL_TOKEN}" }
    }
  }
}
Field Required Meaning
url yes Streamable HTTP endpoint. Must be https:// unless it is on the host itself (localhost, 127.0.0.1, ::1), and cannot contain credentials, a query string, or a fragment.
headers no Request headers. Authorization: Bearer ... becomes bearer authentication; every other header is treated as a secret.
type no "http" (also accepted: "streamable-http", "streamableHttp"). Inferred from url when omitted.

The legacy "sse" transport is not supported; use the server's streamable HTTP endpoint.

Values and secrets

Nebula never saves a secret value in a server profile.

You write Nebula stores
"${NAME}" or "${env:NAME}" A reference to the environment variable NAME of the Nebula Core process, read each time the server starts.
A literal value in a header, or in an env entry whose name looks like a credential (contains TOKEN, SECRET, PASSWORD, API_KEY, AUTH, COOKIE, SESSION, CREDENTIAL, or ends in _KEY) The value is moved into the operating-system credential vault and the profile keeps only the vault reference.
Any other literal env value Stored as written.

Only whole-value references work: "Bearer ${TOKEN}" in Authorization is supported, but "${HOME}/data" is not. VS Code ${input:...} prompts are not supported; replace them with ${env:NAME}.

If the host credential vault is unavailable, entries with literal secrets are reported as invalid. Use ${NAME} references instead, or pass --reject-literal-secrets to refuse literal secrets outright.

Nebula settings

An optional nebula object on a server sets options other clients don't have:

"burp": {
  "command": "npx",
  "args": ["-y", "burp-mcp"],
  "nebula": {
    "default_approval": "ask",
    "tool_overrides": { "scan_passive": "allow" },
    "disabled_tools": ["delete_project"],
    "tool_timeout_seconds": 300
  }
}
Key Values
default_approval risk_based (default), ask, allow, or deny
tool_overrides Object mapping a tool name to one of the approval values
enabled_tools Only these tools are offered (default: all)
disabled_tools These tools are never offered
required true fails new sessions when the server cannot start
startup_timeout_seconds Up to 120 (default 10)
tool_timeout_seconds Up to 900 (default 60)

enabled and trusted_stdio cannot be set from a file; that decision is always made in Nebula, when importing or afterwards. A default_approval in the file wins over the Tool approval chosen for the import.

How the assistant uses MCP tools

In a provider chat, Assistant settings → MCP tool context chooses how selected servers reach the model. New UI conversations default to Load schemas on demand (mcp_context_mode: on_demand): eligible servers send only a short, schema-free directory until the assistant explicitly uses tool_catalog.load. Ranking supplies hints, never preloaded schemas. Loaded definitions remain exact through this turn's routing, compaction, reconnect and resume; the next new turn drops their schema presence and loads again only when needed. Historical messages and immutable manifest revisions are not deleted.

Always load selected schemas (always_loaded) explicitly sends every usable tool of checked servers as native declarations. Existing conversations missing the field retain this legacy mode. Changing modes applies to the next turn, never a running or resumed turn. Project Always loaded tools pins remain protected in either mode.

Unchecking a previously checked server saves an explicit excluded_mcp_server_ids choice for this conversation's next turn. Every tool from that server is removed from full schemas, the schema-free directory, discovery, ranking and loading until the server is checked again. This reduces assembled tool context even if a tool was loaded earlier. Untouched, never-selected servers remain available on demand; use the server's Exclude action to exclude an on-demand server without selecting it first. Excluded servers show “Not sent next turn”; check the existing server checkbox to restore them.

Core saves the choice, including across refresh, forks and automatic goal continuations. An in-flight turn (including resume) keeps its frozen snapshot; changing next-turn settings does not modify its tools. Transcript history and immutable manifest revisions remain intact. Older conversations and snapshots without exclusions default to the previous behavior. This is a provider-chat context selection, not a permission change or native harness tool control.

Other enabled, probed servers with at least one usable tool are available on demand. Unloaded tools contribute a schema-free directory; a successful load adds their complete definitions to the turn's durable tools context. Legacy always_loaded mode also permits ranking preloads for unselected sources and carries loaded definitions across turns. A server that is disabled, has not been probed, or has no usable tool left is not offered and does not fail the turn. The on-demand servers join only a turn that already uses tools, such as a command-runtime chat or one with a ticked server, so a plain provider chat stays one. A managed harness exposes its ticked servers through its gateway and can discover eligible unselected sources through Core's on-demand catalog. Both paths retain project policy, data-transfer consent, tool approvals and narrowed child assignments. Notebook MCP requires explicit selection on both backends and is excluded from automatic discovery.

The provider assistant receives a compact directory of each unloaded on-demand tool's name, server, and short purpose on each routing request. Nebula derives the purpose from the tool description supplied by the MCP server; an empty purpose means the server supplied none. The directory omits parameter schemas and lives in the request instructions, so conversation compaction does not remove it. The provider assistant also sees three fixed catalog tools. Managed harnesses expose the same catalog tools through their Core gateway and can search before loading an eligible tool's schema:

  • tool_catalog.search finds MCP tools by what they do.
  • tool_catalog.load returns the full description and input schema for up to five tools.
  • tool_catalog.call runs a tool by name with arguments that match its schema.

Core runs the real tool behind tool_catalog.call, so its arguments are validated against the tool's own schema and its approval, risk, and scope rules apply unchanged. Transcripts, approvals, and tool cards show the real tool name.

Native function declarations remain stable for an admitted turn. Core records explicitly loaded definitions in immutable session-manifest revisions and restores the referenced context on resume. Each assembled request contains one canonical complete definition per loaded tool, outside summarizable transcript history. Compaction, reconnect and Core restart therefore preserve exact schemas. A later turn reconciles changed definitions or availability, and on_demand first clears schema presence for deferred tools without resetting revision history. Disabling or revoking a source removes active definitions and execution permission while preserving historical calls. Excluded sources remain absent in either mode. A provider may cache the repeated prefix, but persistence alone does not establish cache savings.

Search runs on the Nebula host with the same local embedding model used for project documents (all-MiniLM-L6-v2 in the local Chroma index), combined with keyword matching. Nothing about the tools or the request leaves the machine for search. Until the model has been downloaded and loaded, search uses keyword matching only. Before each turn, the same search ranks the tools against the operator's latest message: only current definitions absent from the conversation are candidates. In always_loaded mode a strong match loads its complete schema into durable context; in on_demand mode all matches are hints only. A directory entry or hint never establishes that a schema was loaded. Native harness tool-loading behavior is unchanged.

Loading on demand is on for every project. Set on_demand_tools to false on a project's scope (PUT /api/v1/engagements/{id}/scope) to turn it off: only the ticked servers are then offered, and all their tools go out with every request in legacy always_loaded mode. A conversation explicitly choosing on_demand still gets its catalog gateway and defers selected schemas even when that project flag is off. A tool listed in the scope's always_loaded_tools is sent with every request whenever its server is offered, ticked or on demand. A project that opts into Jev suggestions from TypeSafe uses Jev's picks instead of the local ranking, and falls back to the local ranking when Jev is unavailable. Jev is sent the redacted operator messages, the expanded instructions of the skills selected for the turn, server names and descriptions, and tool names and descriptions — never tool output.

Jev ranks two things in one call: the on-demand servers and their individual tools. In always_loaded mode ticked servers are already loaded, so Jev is not asked about them; in on_demand they are ranked too. Deferred tools whose current complete definition is already present are also excluded. It is never asked whether the turn needs a tool at all; every question carries a "none of these" option instead. A server's rank weights the tools that come from it — the top-ranked server's tools keep their full score and the bottom-ranked server's tools keep half — and at most three tools survive: up to two have their schema preloaded in always_loaded mode, while on_demand converts every pick into a schema-free hint alongside the servers most likely to hold what the request needs. A tool whose question rated "none of these" higher is never preloaded, only hinted.

Jev is asked once per turn, and a ranking is reused when the request that produced it recurs: the cache key covers the operator's message, the selected skills, complete current tool-definition digests and the source descriptions, so a retried turn or a repeated question against an unchanged catalog costs nothing, while the next message, a new MCP server or a changed server description asks again. The cache holds the newest 64 rankings in the Core process, records nothing on disk, and never stores a failed call; a turn answered from it is marked cached in its snapshot and reports no input tokens.

Server descriptions

A server can carry a description of what it is for, up to 500 characters. Set it in the server's Edit dialog, with a description field in an imported file, or through the API:

"linear": {
  "url": "https://mcp.linear.app/mcp",
  "description": "Issue tracker for the web app: search, file, and close bugs."
}

Jev ranks a server by its description. A server without one is described by the instructions string it returned at the MCP handshake, stored in its capability snapshot, and a server with neither by its tool names. Handshake instructions are written by the server, so like tool descriptions they steer a ranking and nothing else.

Once tools are picked for a turn, by Jev or by the local ranking, the model is told which server each pick comes from, and it gets the description of every server behind a pick or ranked by Jev, as JSON data. Handshake instructions are never sent to the model.

Results and timeouts

Every MCP result is saved as artifacts. A text result also reaches the model inline as a redacted output_preview, with the same size limits as a command's output: small text in full, larger text as its head and tail. When structured content carries stdout, stderr or output text that does not fit, the preview shows those fields instead of the JSON. Images and other binary content are never previewed.

When a call runs past tool_timeout_seconds, or its turn is stopped, Nebula sends the server notifications/cancelled for that request and gives it about 1.5 seconds to wind down. Then it closes the connection: a stdio server gets end of input before it is stopped. A server that frees what a call holds, such as a lock or lease, only on cancellation can free it right away.

Fields that are not imported

These are recognised and skipped with a warning in the preview: disabled (enable servers in Nebula when importing), alwaysAllow and autoApprove (set approvals in Nebula instead), timeout (use nebula.tool_timeout_seconds), and envFile (reference variables with ${NAME}). Any other unknown field is skipped with a warning.

Editor validation

Nebula publishes a JSON Schema for these files. An editor that uses it autocompletes fields, shows what each one means, and flags mistakes such as a relative command, the sse transport, or an unknown nebula setting before you import. Save it from an installed Nebula:

nebula-core mcp schema > ~/.config/nebula/mcp-servers.schema.json

It is also in this repository as mcp-servers.schema.json. In VS Code, map it to your MCP files in settings.json:

"json.schemas": [
  { "fileMatch": ["**/.cursor/mcp.json", "**/.mcp.json", "**/nebula-mcp.json"],
    "url": "file:///home/YOU/.config/nebula/mcp-servers.schema.json" }
]

or add a "$schema" key pointing at the file to a config you keep only for Nebula; import ignores that key. The schema cannot see the Nebula host, so a missing program or an unset ${NAME} variable only shows up in the import preview or when probing.

Preview, conflicts, and re-importing

An import is a preview unless you pass --apply (API: "dry_run": false). The preview lists, for each server, whether it will be created, updated, left unchanged, replaced, skipped, or is invalid and why, the resolved command, where each secret will come from, and whether it will be enabled. Secret values are never shown.

Servers are matched by name. When a server already exists, Nebula compares it with the file and saves only what differs; the preview lists each changed setting with its old and new value. Importing the same file twice changes nothing.

  • The file owns the connection: command, args, env, cwd, url, and headers. A variable or header removed from the file is removed from the server.
  • Settings made in Nebula (enabled state, approvals, tool overrides, timeouts) are kept unless the server's nebula block sets them.
  • A description in the file replaces the saved one; a file without one keeps the description written in Nebula.
  • A literal secret that matches the stored one keeps the stored credential; a different value is stored and the old one is deleted.
  • If the command, args, env, or cwd of a trusted local program changes, it becomes untrusted and disabled again, unless you tick Trust (CLI: --trust-local-programs) for that import.
  • Any connection change clears the server's probed tools. Nebula probes it again straight away if it stays enabled.
  • Enable and Tool approval apply only to new servers.
  • Servers that are not in the file are never deleted.

Pass --skip-existing (API: "on_conflict": "skip") to leave existing servers untouched, or --replace (API: "on_conflict": "replace") to overwrite them from the file and discard settings made in Nebula; a replaced server is treated like a new one.

Exporting

nebula-core mcp export [FILE] (API: GET /api/v1/mcp-servers/export) writes all servers in the mcpServers format with a nebula block for any non-default settings. Environment references are written as ${NAME}. Secrets stored in the credential vault are written as ${NAME} placeholders and listed as warnings: set those environment variables on the host where the file is imported.

API

POST /api/v1/mcp-servers/import
{ "config": { "mcpServers": { ... } },
  "dry_run": true,
  "on_conflict": "update",        // or "skip", "replace"
  "literal_secrets": "vault",     // or "session", "reject"
  "source_name": "mcp.json",
  "defaults": { "enabled": false, "default_approval": "risk_based" },
  "trust_local_programs": false }

GET /api/v1/mcp-servers/export?profile_id=ID&profile_id=ID