Learn · Agent access
MCP server
Every project serves an MCP server at /mcp. Each tool call runs under your access rules.
- API
- —
- In the schema
ext::napalm::AgentGrant
Client connections#
Every project serves a stateless Streamable HTTP MCP endpoint at /mcp, and each branch answers at /branches/{name}/mcp. Every tool call executes as the authenticated bearer under your schema’s access policies, using a service key or user session in Authorization: Bearer <token> or an OAuth consent grant from connectors such as Claude or ChatGPT. See Sign-in.
Stateless Streamable HTTP MCP at /mcp
POST /mcp exposes offered deployed queries, gatekeeper actions and schema-aware inspection tools (describe_schema, check_query, explain_query) behind your branch’s access rules.
Issue a service key
Start with a read-only key (
--read-only). Napalm refuses every write from that key before running it.Your terminalnapalm keys create notes --label laptop --read-only --saveCreated laptop for notes, read-only, for 30 daysndb_Qm9zZS1yZWQtZXhhbXBsZS1rZXkSaved for napalm query and napalm mcp.Share the schema (optional)
A project keeps the schema private by default. Turn on
--share-schemato let an agent read your types and rules (describe_schema) and write statements against the schema.Your terminalnapalm endpoint notes --enable --share-schemaSaved the endpoint for notesRegister the MCP server
Point Claude Code or any Streamable HTTP client at your project’s
/mcpaddress.Claude Codeclaude mcp add --transport http napalm https://<label>.napalmdata.com/mcp \ --header "Authorization: Bearer $NAPALM_KEY"A desktop client that can only start a local program uses the napalm mcp bridge below.
Query through the agent
Claude Code sessionWhich of my notes are pinned?describe_schemaquery query: "select Note { title } filter .pinned order by .title"Two: “Hiring plan” and “Launch checklist”. That covers your own notes and the ones shared with you, which are all I can see.
Project tools#
The tools/list response adapts to the project’s passthrough mode, schema-sharing flag and whether the caller may write. A caller is never offered a tool it lacks permission to invoke. Tools for agents covers curating the tool surface.
| Tool name | Behavior | When offered |
|---|---|---|
query | Runs one EdgeQL statement with typed variables and returns JSON rows. Read-write callers can pass is_dry_run: true on mutations to preview before-and-after diffs and roll back. A branch takes 100 dry runs, tests, checks and plans a minute. Past the limit, the tool returns rate_limited with the remaining wait in seconds. | When offeredPassthrough admits caller |
search | Searches a type by meaning and by words. Returns only rows the caller may read. The type needs an ext::ai::index and an fts::index. | When offeredPassthrough admits caller |
read_changes | Reads the change log as GET /changes does. Returns committed changes oldest first under the caller’s access rules. Start from since (a time) or after (a page’s next), stop at until and filter by types. Where the schema is not shared, types is required. A page over 512 KiB cuts cleanly between whole changes, and the page’s next bookmark points to the cut position. | When offeredPassthrough admits caller and change log active |
describe_schema | Returns the branch’s SDL schema including object types, links, computed fields, constraints and access policies. | When offeredSchema shared and passthrough admits caller |
describe_reach | Counts the rows per type the active connection can read, update and delete. Reports whether is_insert_allowed holds and readable ext::files::File bytes alongside is_read_only and is_on_replica. | When offeredSchema shared and passthrough admits caller |
ask | Writes a compiler-checked EdgeQL query from a question in words and runs reads as the caller. A question that needs a change returns the proposed statement and runs nothing. With is_dry_run: true, the statement runs as a rollback preview. See Ask and schema. | When offeredSchema shared and passthrough admits caller |
check_query | Compiles an EdgeQL statement against the branch schema and reports whether the statement reads or mutates, or returns exact compiler diagnostics. Nothing runs. Each call counts against the branch’s 100 dry runs, tests, checks and plans a minute. | When offeredSchema is shared |
explain_query | Type-checks a statement and returns live cluster telemetry covering calls, latency, heaviest access policy and index advice. A statement that has not run yet receives planner cost estimates instead. Each call counts as one check, as check_query does. Past the limit, both tools return rate_limited with the remaining wait in seconds. | When offeredSchema is shared |
| Deployed queries | Each deployed query appears as a separate named tool with typed variables and an explicit JSON outputSchema. A name collision adds the deployed_ prefix. Read-only callers see only read-only queries. Write queries accept is_dry_run. | When offeredAlways (unless hidden via --no-agents) |
| Actions | A deployed query with an attached HTTPS handler appears as one tool taking the query’s typed variables. The query runs under the caller’s access policies, and matching rows go to your handler with a 60-second ES256 identity assertion. The handler’s response is the tool result. Read-only callers see only actions marked isWrite: false. Actions do not support is_dry_run. See Actions. | When offeredAlways (unless hidden via --no-agents) |
On initialize, the server tells the client that database rows are data and not instructions. The server also reports whether the connection can write.
{ "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "query", "title": "Run a query", … }, { "name": "search", "title": "Search by meaning and words", … }, { "name": "read_changes", "title": "Read what changed", … }, { "name": "describe_schema", "title": "Read the schema", … }, { "name": "describe_reach", "title": "See what this connection can reach", … }, { "name": "ask", "title": "Ask a question", … }, { "name": "check_query", "title": "Check a query", … }, { "name": "explain_query", "title": "Explain a query's cost", … } ] }}A connection’s reach#
An MCP connection holds only the rights of its bearer credential and endpoint passthrough mode. Agent access and grants covers delegating specific records for a bounded duration.
Deployed-query lockdown with --passthrough none
Setting --passthrough none strips ad-hoc query, search, ask, describe_schema and read_changes from tools/list, confining MCP callers strictly to offered deployed queries and actions.
- Your rules
- Every call runs under your schema’s access rules. Rows the caller may not read are left out, and a write that a rule refuses fails.
- Reading only
- A read-only key or read-only consent is not offered any deployed query or action that writes, and Napalm refuses any ad-hoc write from that caller.
- Your queries only
- Passthrough
noneremovesquery,search,ask,describe_schema,describe_reachandread_changes. Passthroughkeysremoves those tools for a person’s session. The agent keeps your deployed queries and actions. - One project
- A project’s server cannot change a schema, see another project or call your organization’s Control API.
The local bridge#
Claude Desktop and other stdio clients can only launch a local program and communicate over standard input and output. napalm mcp <project> relays stdio messages to your project’s /mcp endpoint using the key saved in your local CLI config.
{ "mcpServers": { "notes": { "command": "napalm", "args": ["mcp", "notes"] } }}Save a key locally with napalm keys create notes --save, or supply NAPALM_KEY and NAPALM_PROJECT_URL as environment variables.
Repository setup#
Run napalm init <project> in your repository to write the layout of a Napalm project into AGENTS.md (imported by CLAUDE.md) and register napalm mcp <project> in .mcp.json, .cursor/mcp.json and .vscode/mcp.json with zero secrets committed to git.
napalm init notesnapalm keys create notes --saveShare the schema (napalm endpoint notes --share-schema) so the agent can inspect types and rules and validate queries with check_query and explain_query. Coding agents walks through the whole setup.
Your organization’s own server#
Your organization also serves a value-blind control-plane MCP server for clusters and projects at https:/. Add the server as a connector in Claude or ChatGPT, sign in with your Napalm account and choose reading or managing access and a duration. Every control tool runs under your console permissions and never returns customer row values.
Connected ops assistant
Claude or ChatGPT connects to https:/ with time-bounded read or manage consent.
Value-blind org control plane
Control tools inspect clusters, branches, keys and audit logs structurally without reading customer row values.
| Tool | Description |
|---|---|
listOrgs | List your organizations and your role (read or manage) in each. |
listClusters | List clusters with shape, shard count, engine health and maintenance holds. |
getCluster | Inspect one cluster’s topology, members, engines and recent operations. |
listClusterOperations | List the operations on a cluster, newest first. |
listProjects | List projects with assigned clusters and branches. |
listProjectKeys | List service key metadata on a project (never secret tokens). |
listApiTokens | List org token metadata (never secret token values). |
listActivity | Read recent entries from the organization’s audit log. |
requestBackup | Trigger an immediate backup of a cluster shard (manage only). |
requestSwitchover | Trigger a planned zero-data-loss primary switchover (manage only). |
createBranch | Create a schema or --data branch from main (manage only). Returns the branch once ready, or its running operation if setup takes longer than 8 seconds. If the copy fails during that wait, the call returns the failure code and operation ID. |
revokeProjectKey | Revoke a project service key (manage only). isDelivered says whether every engine dropped the key. |
explainAccess | Explain rule by rule why a key, a person or a key not yet issued can or can’t see one object (manage only). A key not yet issued takes a branch, a read-only setting and globals. Reading access explains as a key or a key not yet issued. |
placeHold, changeHold, removeHold | Place, extend or remove a cluster maintenance hold (manage only). |
revokeApiToken | Immediately revoke an org token (manage only). |
Transport and error codes#
| Property | Specification |
|---|---|
| Transport | Stateless Streamable HTTP (POST /mcp returning application/json). |
| Session state | Stateless. Each POST is independent. GET and DELETE return 405 Method Not Allowed. |
| Read-your-own-writes | Every tool call reads all writes acknowledged before the call, including the agent’s own. Calls bypass engine read caches, so no Napalm-Bookmark header is needed. |
| Protocol revisions | Supports 2025-06-18, 2025-03-26 and 2024-11-05. |
| Notifications | JSON-RPC notifications return 202 Accepted with an empty body. |
| Browser CORS | Enforces your project’s allowed origins, matching the Project API. |
Authentication and JSON-RPC errors#
A missing, expired or revoked credential receives HTTP 401 before the message is read, along with OAuth discovery metadata telling interactive clients where to sign in. Malformed messages return standard JSON-RPC codes -32700 (not JSON), -32600 (invalid request or batch), -32601 (no such method) and -32602 (bad parameters).
Revocation#
Revoke a key (napalm keys revoke) or delete an ext::napalm::AgentGrant row, and the agent’s next call is refused. napalm endpoint --disable stops every call from outside at once and deletes nothing. Watching and stopping an agent covers every revocation option.