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
| Tool | What it does | Scope it needs |
|---|---|---|
list_regions | Regions where a Database or Replica can run | none |
list_plans | Plans with their Pool, Allowances and features | none |
get_account | Your Account, Plan, Pool use and this month's Usage | account:read |
list_databases | Your Databases | databases:read |
get_database | One Database with its Instances and Endpoints | databases:read |
create_database | Create a Database: Engine, Region, Size, high availability | databases:write |
update_database | Rename, resize, or turn high availability on or off | databases:write |
delete_database | Delete a Database (undelete within 7 days) | databases:write |
undelete_database | Bring back a Database deleted less than 7 days ago | databases:write |
describe_schema | Tables and columns, or Namespaces and collections | databases:read |
run_sql | Run one statement, read-only unless write is true; values go in params | sql:read, plus sql:write for writes |
list_credentials | Credentials of a Database, never their secrets | credentials:read |
create_credential | Create a Credential with a Permission set; the secret is returned once | credentials:write |
update_credential | Change permissions or expiry | credentials:write |
rotate_credential | Issue a new secret; the old one stops at once | credentials:write |
revoke_credential | Revoke a Credential immediately | credentials:write |
add_replica | Add a Replica in another Region | databases:write |
remove_replica | Remove a Replica | databases:write |
promote_replica | Make a Replica the Primary | databases:write |
get_recovery_window | Earliest and latest Restore point | databases:read |
restore_to_time | Restore to a Restore point, as a new Database by default | databases:write |
get_usage | A Database's Reads, Writes, Egress and storage for a month | databases:read |
get_operation | Follow a long-running change | databases:read |
list_audit_log | Who changed what in the Account, newest first | audit: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 job | Scopes |
|---|---|
| Read schemas and data, explain queries | databases:read, sql:read |
| Set up a new project: create a Database and a Credential | databases:read, databases:write, credentials:write |
| Everything above, plus changing data | add 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:
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:
{
"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:
codex mcp add nordbase --url https://nordbase.<base>/api/mcp --bearer-token-env-var NORDBASE_ACCESS_TOKENCursor
Add the server to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every project:
{
"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_sqlis read-only by default. A statement that changes data runs only when the agent asks for a write explicitly and the Access token hassql:write. Without that scope,run_sqlcannot change your data, whatever the agent is told.credentials:writeis 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 assql:write.- Values are parameters.
run_sqltakes 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:writecan 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_credentialreturns the new secret and Connection URL to the agent. Ask it to write the URL into.envand never print it in the chat. - Every call counts. Statements from
run_sqlcount 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.