Overview

gizzi mcp manages Model Context Protocol (MCP) servers that extend the Allternit runtime with external tools and context sources. You can register local command-based servers, connect to remote HTTP servers, and handle OAuth authentication from the terminal. MCP servers declared through the CLI are written to your gizzi.json or gizzi.jsonc configuration, either in the current project or globally.

Protocol versions (2026-07-28 and older servers)

Gizzi speaks MCP 2026-07-28 and every earlier revision, using the official TypeScript SDK v2 (@modelcontextprotocol/client / server / core). You don’t configure anything: on the first connect to a server Gizzi sends server/discover. The verdict is cached per server in mcp-era.json in Gizzi’s data directory, keyed by the server’s URL or command:
  • A 2026-07-28 verdict skips the probe. Gizzi confirms it with one server/discover on the live connection. For local servers this saves spawning a second probe process.
  • An older-server verdict goes straight to initialize and expires after 24 hours, so an upgraded server is picked up the next day.
  • Changing a server’s URL or command, gizzi mcp auth, or gizzi mcp logout clears the cached verdict.
For a local (stdio) server, the first probe runs in a short-lived copy of the server process. A server that doesn’t answer within 5 seconds is treated as an older server. gizzi mcp list shows the result next to each connected server. For example, connected · 2026-07-28 is a 2026-07-28 server, and connected · legacy 2025-06-18 is an older one. To override detection for one server, set protocol on its entry:
The behaviors below work the same in both protocol eras:
  • Tool names are namespaced as mcp__<server>__<tool>, in a stable order: servers by name, then each server’s tools by name. Name collisions get the same suffix on every run.
  • Approval flags (allternit/approved in _meta) are sent on tool calls.
  • The MCP Apps UI capability is sent to every server.
  • timeout applies to connecting and to requests.
Gizzi’s own MCP servers answer both protocol eras. This includes the knowledge-vault Lens server.

MCP Apps in the terminal

When a tool’s result comes with an app (the tool names a ui:// resource), the TUI adds one line under the result: ⧉ MCP App · View in browser. Click it (or open the file path printed after it) to open the app in your browser with the tool’s real input and result, the same way Desktop shows it in the chat. The page runs the app in a sandboxed frame. Links the app opens go to new tabs, and actions that need the chat, such as calling another tool, say to open the chat in Allternit Desktop. The line appears for tool calls Gizzi Code makes itself. A CLI brain calls its own tools, so its results show as plain text.

Command reference

Listing servers

Show every configured server and its current status:
Each entry displays:
  • Server name and type (local or remote)
  • Connection status: connected, disabled, needs authentication, failed, or not initialized
  • For remote servers, the target URL and whether OAuth credentials are stored
  • Error hints when a server failed to connect

Adding a server

Add a remote server in one command:
It saves to your global config. Add --project to save to the project config instead. Gizzi makes one unauthenticated request to the URL; if the server answers 401 it saves the server with OAuth turned on and tells you to run gizzi mcp auth <name>. To use the interactive wizard instead, run it with no arguments:
The wizard prompts for:
  1. Location — current project (gizzi.json or .gizzi/gizzi.json) or global config.
  2. Name — a short identifier used in commands and runtime tool routing.
  3. Type — local or remote.

Local server

For a local server, provide the shell command to start it:
This writes an entry like:

Remote server

For a remote server, provide the HTTPS URL. You can then opt into OAuth and supply a pre-registered client ID and optional client secret, or leave the client ID empty and let Gizzi identify itself (see How Gizzi identifies itself to OAuth servers).
To disable OAuth for a remote server, set "oauth": false.

Removing a server

Remove a server interactively:
Or pass the name directly:
The command locates the config file that defines the server (project or global) and removes the entry while preserving JSONC comments.

Authenticating with OAuth

Remote MCP servers that require OAuth can be authenticated through the browser:
If you omit the name, the CLI lists all OAuth-capable servers and lets you pick one. The command opens the provider’s authorization URL in your default browser and stores the tokens locally. If the browser cannot be opened automatically, the URL is printed so you can complete the flow manually. Check the current auth status at any time:
Statuses shown are authenticated, expired, or not authenticated.

How Gizzi identifies itself to OAuth servers

When oauth.clientId is not set, Gizzi picks the first method the authorization server supports:
  1. Client ID Metadata Document (CIMD). MCP 2026-07-28 prefers this method over dynamic client registration. If the authorization server advertises client_id_metadata_document_supported, Gizzi uses https://platform.allternit.com/oauth/gizzi-client.json as its client_id. That document lists Gizzi’s loopback redirect URIs (http://127.0.0.1:19876/mcp/oauth/callback and http://localhost:19876/mcp/oauth/callback). Nothing is registered and nothing is stored per server.
  2. Dynamic client registration (RFC 7591). This is the fallback for servers without CIMD. MCP 2026-07-28 deprecates it, but Gizzi still supports it. The registered client is stored with the server’s tokens.
  3. If the server supports neither method, gizzi mcp list shows needs client registration. Add a pre-registered clientId (and clientSecret if the server requires one) to the server’s oauth block.
A configured clientId always takes precedence. To turn CIMD off, set MCP_OAUTH_CLIENT_METADATA_URL to an empty string. To test against a different document, set it to that document’s URL. The authorization callback is checked against the issuer the flow started with (RFC 9207 iss), so a mixed-up or forged callback is rejected.

Logging out

Delete stored OAuth tokens and client registration for a server:
Running logout without a name presents a picker for all servers that have stored credentials.

Debugging OAuth

Use debug to inspect the OAuth handshake and basic HTTP connectivity:
The command prints:
  • Stored auth status and token expiry
  • Whether a refresh token is present
  • Client registration details
  • HTTP response status from the server
  • Which protocol era the server speaks. The probe is a server/discover request: a 2026-07-28 server lists its supported versions, and an older server rejects it.
  • WWW-Authenticate header analysis
  • Whether the OAuth flow can be triggered successfully
This is useful when a remote server shows needs authentication or failed in gizzi mcp list.

Server status reference

Common positional arguments

Most mcp commands are interactive by default when name is omitted, except for debug where the name is required.

Configuration file locations

The CLI searches for a config file in this order inside the project:
  1. gizzi.jsonc
  2. gizzi.json
  3. .gizzi/gizzi.jsonc
  4. .gizzi/gizzi.json
If none exist, the wizard defaults to gizzi.json. For global scope it writes to the equivalent path under ~/.config/gizzi-code/.

Tool-change holds

Gizzi pins each MCP server’s tools. A pin is a sha256 of the tool’s name, description, input schema and annotations, kept in mcp-tool-pins.json in Gizzi’s config directory.
  • The first time Gizzi sees a server, it pins everything that server lists.
  • After that, a tool that is new or changed (a different description, schema or annotations) is held out of the tool list. The model never sees it, and Gizzi logs which tools were held and why.
  • When Gizzi runs under an Allternit runtime (ALLTERNIT_API_URL is set and you are signed in), it asks the runtime to check the pins (POST /mcp/pins/check) instead of using the local file. A held tool opens a Tool changed item in your inbox; tap Approve tool there and the tool returns on the next listing, on every surface. The local pins file is used only if there is no runtime or it can’t be reached.
  • Offline fallback: start Gizzi once with GIZZI_MCP_APPROVE_TOOLS=<server> (comma-separate several servers, or use *) to re-pin the tools as they are listed now. Use it only when no runtime is reachable.
  • Removed tools only narrow what the model can do, so they take effect at once.
Bots in the app have the same rule on the server side, for every attached MCP server: a tool change leaves that tool out of the bot’s list and opens one Tool changed item per tool in your Inbox (Desktop, phone and the PWA). Approve tool re-pins that tool and closes the item. See Red-team suite.

Long-running tools (MCP tasks)

Some servers run slow tools as tasks (MCP revision 2025-11-25). When a server declares task support for tools/call and a tool sets execution.taskSupport to optional or required, Gizzi starts the call as a task and checks on it at the interval the server asks for (between 0.25 and 5 seconds) instead of waiting on one request.
  • The tool line shows the server, the task’s state, time so far, progress and the server’s status text, for example MCP task Working · docs · 42s · 3/10 · Indexing 3,000 files · Esc to stop.
  • Esc stops it: Gizzi sends tasks/cancel to the server. Apps and the web chat show the same task as one card with a Stop button (POST /mcp/task/:taskId/cancel).
  • 2026-07-28 connections use the final tasks extension (io.modelcontextprotocol/tasks). Gizzi calls the tool normally; if the server answers with a task it polls tasks/get at the server’s pollInterval and stops at its ttl. When the task is input_required, each entry in inputRequests opens the normal elicitation form and is answered with tasks/update. The result comes back inside the completed task; there is no tasks/result.
  • Older connections (2025-11-25) read the result with tasks/result once the task leaves the working state, so a task that needs input can ask for it there.
  • The terminal app and the engine (gizzi run, the app’s Code sessions) both do this. Developers: src/shared/util/mcp-tasks.ts, stream parts in src/runtime/tools/mcp/task-stream.ts (mcp.task, mcp.elicitation, reply POST /mcp/elicitation/:requestID/reply), test test/mcp/tasks.test.ts.

MCP skills

A server that lists skill://<name>/SKILL.md resources gets each one added as a command named mcp__<server>__skill_<name>. This is on by default (the MCP_SKILLS feature flag).

Disabling MCP support

MCP support is enabled by default. To disable it for a session: