Skip to content
NordBaseDocs

Search the docs

Find a page or a section of the NordBase docs

AI

MCP server

Let Claude Code, Codex, Cursor and other MCP clients manage your NordBase Account with a scoped Access token, with SQL read-only by default.

The NordBase MCP server lets an AI agent manage your Account: list and create Databases, create least-privilege Credentials, read a schema, run a read-only query, add a Replica or start a Restore. It is a remote MCP server over Streamable HTTP, so there is nothing to install.

https://nordbase.<base>/api/mcp

<base> is the NordBase domain, shown in the console. The tools call the same operations as the management API, so an agent can do exactly what its Access token allows, and nothing more.

Tools

ToolWhat it doesScope it needs
list_regionsRegions where a Database or Replica can runnone
list_plansPlans with their Pool, Allowances and featuresnone
get_accountYour Account, Plan, Pool use and this month's Usageaccount:read
list_databasesYour Databasesdatabases:read
get_databaseOne Database with its Instances and Endpointsdatabases:read
create_databaseCreate a Database: Engine, Region, Size, high availabilitydatabases:write
update_databaseRename, resize, or turn high availability on or offdatabases:write
delete_databaseDelete a Database (undelete within 7 days)databases:write
undelete_databaseBring back a Database deleted less than 7 days agodatabases:write
describe_schemaTables and columns, or Namespaces and collectionsdatabases:read
run_sqlRun one statement, read-only unless write is true; values go in paramssql:read, plus sql:write for writes
list_credentialsCredentials of a Database, never their secretscredentials:read
create_credentialCreate a Credential with a Permission set; the secret is returned oncecredentials:write
update_credentialChange permissions or expirycredentials:write
rotate_credentialIssue a new secret; the old one stops at oncecredentials:write
revoke_credentialRevoke a Credential immediatelycredentials:write
add_replicaAdd a Replica in another Regiondatabases:write
remove_replicaRemove a Replicadatabases:write
promote_replicaMake a Replica the Primarydatabases:write
get_recovery_windowEarliest and latest Restore pointdatabases:read
restore_to_timeRestore to a Restore point, as a new Database by defaultdatabases:write
get_usageA Database's Reads, Writes, Egress and storage for a monthdatabases:read
get_operationFollow a long-running changedatabases:read
list_audit_logWho changed what in the Account, newest firstaudit:read

The server is https://<your NordBase host>/api/mcp (Streamable HTTP, stateless). Every tool calls the management API with your Access token, so the token's scopes decide what the agent can do.

Create an Access token for the agent

In the console, create an Access token with only the scopes the agent needs. It starts with nbt_ and is shown once. Keep it in an environment variable, here NORDBASE_ACCESS_TOKEN, rather than in a config file you might commit.

Agent's jobScopes
Read schemas and data, explain queriesdatabases:read, sql:read
Set up a new project: create a Database and a Credentialdatabases:read, databases:write, credentials:write
Everything above, plus changing dataadd sql:write, only when you mean it

An Access token manages your Account; it never connects to a Database. Your app still uses a Credential in NORDBASE_URL.

Claude Code

Add the server for all your projects:

bash
claude mcp add --transport http --scope user nordbase https://nordbase.<base>/api/mcp \
  --header "Authorization: Bearer $NORDBASE_ACCESS_TOKEN"

Or share it with your team in the project's .mcp.json, with the token read from each person's environment:

json
{
  "mcpServers": {
    "nordbase": {
      "type": "http",
      "url": "https://nordbase.<base>/api/mcp",
      "headers": { "Authorization": "Bearer ${NORDBASE_ACCESS_TOKEN}" }
    }
  }
}

Run /mcp in Claude Code to check that nordbase is connected.

Codex

Add the server to ~/.codex/config.toml. Codex reads the token from the environment variable you name:

[mcp_servers.nordbase]
url = "https://nordbase.<base>/api/mcp"
bearer_token_env_var = "NORDBASE_ACCESS_TOKEN"

Or from the command line:

bash
codex mcp add nordbase --url https://nordbase.<base>/api/mcp --bearer-token-env-var NORDBASE_ACCESS_TOKEN

Cursor

Add the server to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every project:

json
{
  "mcpServers": {
    "nordbase": {
      "url": "https://nordbase.<base>/api/mcp",
      "headers": { "Authorization": "Bearer ${env:NORDBASE_ACCESS_TOKEN}" }
    }
  }
}

Other clients

Any MCP client that supports Streamable HTTP works. Point it at https://nordbase.<base>/api/mcp and send Authorization: Bearer with the Access token. Signing in with OAuth instead of a token is coming soon.

Safety

  • run_sql is read-only by default. A statement that changes data runs only when the agent asks for a write explicitly and the Access token has sql:write. Without that scope, run_sql cannot change your data, whatever the agent is told.
  • credentials:write is a write scope too. A token with it can create a Credential that writes, and the agent sees that Credential's secret. Give it with the same care as sql:write.
  • Values are parameters. run_sql takes values separately and binds them as $1, $2, like the libraries.
  • One statement per call, stopped after 30 seconds, at most 10,000 rows returned.
  • It runs with your Account's own access, not as one of your Credentials. A token with sql:write can change any data in your Databases, so give that scope only for a task that needs it, and revoke the token afterwards.
  • Secrets reach the agent once. create_credential returns the new secret and Connection URL to the agent. Ask it to write the URL into .env and never print it in the chat.
  • Every call counts. Statements from run_sql count as Reads and Writes like any other.
  • Scopes are your guardrail. The agent can only call tools its token's scopes allow. Use short-lived tokens with an expiry for one-off tasks.

To teach an agent the rules for code that uses NordBase, add the NordBase AI skill as well.