MCP server

Connect an MCP client (a coding agent or an assistant) to your site's code with an access token limited by permissions.

Availability

Requires the Pro plan or higher

The MCP server works on your site's code, so it requires a plan that includes code mode (Pro or Enterprise).

What it is and what you can do

Nimlio exposes an MCP (Model Context Protocol) server so an external tool, such as a coding agent, can work on the code of one of your sites: read files, search, edit, build the preview, query your business data and propose a publish. The client connects with an access token that you create, and that token can only do what its permissions allow.

  • Each token belongs to one site and acts with your administrator permissions on that site.
  • It never publishes on its own: it can only propose publishing or going back to a version, and approval is always yours.
  • You can revoke it at any time; the open session is closed immediately.
Requires code mode

Creating tokens requires being a business administrator and your organization's plan including code mode (Pro or Enterprise). On the Starter plan, token creation is refused.

Create an access token

From your business, open Settings → Developers → Manage credentials. The screen is available to organization-wide owners and administrators of the organization that owns this business. Membership in another organization or a role limited to selected businesses does not grant access.

  1. Connect an agent

    Under Connect an AI agent (MCP), choose Connect an agent. Create a website first; the site must support code mode and your organization needs Pro or Enterprise. Starter requires a plan upgrade.

  2. Name it and choose permissions

    Enter a Name (1–80 characters) for the client. Select at least one permission: read, write, build, publish. Use the minimum permissions needed. The label “Publish site” permits proposing a publish; you still approve it.

  3. Choose when it expires

    Set Expires in days (1–90). The default is 30 days.

  4. Copy the credential and setup

    In Agent connection created, choose Copy credential. Copy the Server URL and select Claude Code or Codex, then Copy setup. The setup contains an environment-variable placeholder, never your token. Store the token securely before choosing Done or closing; closing clears it and it cannot be shown again.

Agent connection created dialog on a phone, showing masked credential, server URL and Claude Code environment configuration.
Copy the credential once, then copy setup for your client. The credential in this example is masked.
Treat it like a password

Tokens start with nmcp_. Nimlio stores only a hash, so a lost token must be replaced. Anyone holding it can use its permissions until expiry or revocation. Keep it out of source code, chat and shell history. You can create up to 10 tokens per hour per user.

The connection list shows name, prefix, permissions, expiry, last use and whether a session is active. Choose Revoke, then confirm Revoke credential? to cut access and any active session immediately. To renew or change permissions, create another connection and revoke the old one. Each connection belongs to this site.

Advanced: session-authenticated management

Management calls use your signed-in session, not the MCP token. Include your Nimlio app’s Origin header on POST and DELETE.

ActionEndpoint
POST/api/sites/:siteId/mcp/grants
GET/api/sites/:siteId/mcp/grants?businessId=…
DELETE/api/sites/:siteId/mcp/grants/:grantId?businessId=…
POST body
{
"businessId": "<business-id>",
"label": "Coding agent",
"scopes": ["read", "write"],
"expiresInDays": 30
}

POST: 201, data.grant, data.token (once), data.endpoint. GET: data.items (metadata only). DELETE: 200, data.grant; 404 mcp_grant_not_found for an unknown grant.

Connect your client

The server uses Streamable HTTP with JSON responses at /mcp and negotiates protocol revisions 2025-11-25 (preferred) and 2025-06-18. Always use the exact Server URL returned by Nimlio, replacing <endpoint> in the examples below. The local URL in the screenshot is only an example.

First load your token into the same terminal environment that will launch the client. This Bash prompt keeps it out of the command text and shell history. Paste only into the private prompt:

Bash
read -rs -p 'MCP token: ' NIMLIO_MCP_TOKEN
export NIMLIO_MCP_TOKEN
printf '\n'

Codex

Select Codex in the creation dialog and copy its setup, or start Codex with the options below. bearer_token_env_var names the environment variable; it is not the token itself. These launch options do not edit your global config. See official OpenAI MCP documentation.

Codex
codex -c 'mcp_servers.nimlio.url="<endpoint>"' -c 'mcp_servers.nimlio.bearer_token_env_var="NIMLIO_MCP_TOKEN"'

Claude Code

For Claude Code, save this JSON in your project’s .mcp.json, preserving ${NIMLIO_MCP_TOKEN} literally. Start Claude Code from the terminal where you exported the variable and approve the project server when requested. See Claude Code environment expansion.

.mcp.json
{
"mcpServers": {
"nimlio": {
"type": "http",
"url": "<endpoint>",
"headers": {
"Authorization": "Bearer ${NIMLIO_MCP_TOKEN}"
}
}
}
}

Nimlio authenticates the client with Authorization: Bearer from that environment variable; an API key (nk_pub_) cannot replace an MCP token. Write actions may also require client approval. The client manages Mcp-Session-Id automatically. One token permits one live session; close it before opening another. Revoking or expiring the token cuts the session.

Permissions and tools

Each token carries one or more permissions. The first three are cumulative: write includes read, and build includes write and read. publish is independent and includes nothing else. tools/list returns only the tools your token can use.

PermissionIncludesTools
readRead onlylist_files, read_file, search_files, list_checkpoints, diff_checkpoint, list_site_versions, get_business_profile, list_services, list_catalog, get_cms_schema, list_cms_items, search_media, list_sections, lookup_sdk_reference, update_plan
writeread + code writingwrite_files, delete_file, edit_file, apply_edit_ops
buildwrite + read + buildbuild_preview, get_diagnostics
publishNothing elsepropose_publish, propose_rollback

The write tools change your site's code draft, not the published site. propose_publish and propose_rollback only record a suggestion: nothing is published or rolled back until you approve it.

What MCP cannot do

The declare_sections and write_catalog tools are not available with any permission. In particular, an MCP token cannot write to your product catalog: that is done from Nimlio.

Limits and expiry

WhatLimit
Calls per token120 per minute
Calls per organization600 per minute
New sessions per token30 per hour
Session inactivitycloses after 5 minutes unused
Maximum session length1 hour
Size of each request1 MiB
Attempts with an invalid token20 per minute from the same IP

When you exceed a limit you get 429 with Retry-After. An expired, revoked or unknown token always answers the same, 401, so it doesn't reveal which case it is. The token is checked again before every call: if you revoke it or it expires, the session is cut.

Revoke access

  1. Find the connection

    Find the token by its name and prefix in Settings → Developers → Connect an AI agent (MCP). The list never returns the full token.

  2. Revoke access

    Choose Revoke and confirm. Or call DELETE /api/sites/:siteId/mcp/grants/:grantId?businessId=… with your signed-in session and Origin header. Access and any active session end immediately.

  3. Replace if needed

    A revoked token cannot be reactivated.

Create a separate token per tool or person, with the minimum permission and a short lifetime. That way you can revoke one without affecting the others.

Next steps