SDKs & integrations
MCP server
Connect Claude, Cursor or any MCP client to OrbitNest so AI agents can manage projects, SQL, functions, storage and project memory through typed tools.
The OrbitNest MCP server implements the Model Context Protocol, so AI assistants such as Claude Code, Claude Desktop and Cursor can manage your OrbitNest projects with typed tools. It runs locally over stdio and calls the OrbitNest API with your admin session. It never connects to your database directly.
Install
The server is published to npm as @orbitneststudio/mcp-server (binary orbitnest-mcp) and requires Node.js 18 or later. Most clients start it with npx, so you do not need to install it first. This page describes version 1.4.0, which isn't on npm yet. Behavior that is new in 1.4.0 is marked "from version 1.4.0".
Claude Code
claude mcp add orbitnest -- npx -y @orbitneststudio/mcp-server
claude mcp list # orbitnest should show as connectedTo point at a different API, add --env ORBITNEST_API_URL=https://api.example.com before the --.
Claude Desktop
Add the server to claude_desktop_config.json. On macOS the file is in ~/Library/Application Support/Claude/, and on Windows it is in %APPDATA%\Claude\.
{
"mcpServers": {
"orbitnest": {
"command": "npx",
"args": ["-y", "@orbitneststudio/mcp-server"]
}
}
}Restart Claude Desktop. The OrbitNest tools then appear in the tools menu.
Cursor
Add the same mcpServers entry to ~/.cursor/mcp.json to use it in every workspace, or to .cursor/mcp.json in a project.
VS Code and other clients
Any MCP client that can launch a stdio server works. Use the command npx -y @orbitneststudio/mcp-server, or orbitnest-mcp if you installed the package globally with npm install -g @orbitneststudio/mcp-server. For VS Code, add it to .vscode/mcp.json:
{
"servers": {
"orbitnest": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@orbitneststudio/mcp-server"]
}
}
}Windows
If your client cannot launch npx directly on Windows, use "command": "cmd" with "args": ["/c", "npx", "-y", "@orbitneststudio/mcp-server"].
Sign in
You don't need a token or password in the config. Ask your assistant to sign in, and it calls one of these tools:
| Tool | Use it when |
|---|---|
orbitnest_admin_signin | You have an email and password. If two-factor authentication is on, the first call reports that a code is required. Call it again with the same credentials plus mfa_code, set to a 6-digit authenticator code or a recovery code. |
orbitnest_login | You signed up with Google, GitHub or Apple (provider: google, github or apple). It opens your browser, waits up to 3 minutes for you to finish, and receives the session through a one-time 127.0.0.1 callback. Run the server on the same machine as your browser. |
After you sign in:
- Tokens are saved to
~/.orbitnest/credentials.json(mode0600) and loaded again the next time the server starts. The CLI uses the same file, so signing in with either tool signs in both. - The access token is refreshed automatically when it is within 60 seconds of expiry. The server saves each new refresh token as it rotates.
- From version 1.4.0, refreshes are serialized with the CLI and other MCP servers through
~/.orbitnest/credentials.lock. Before refreshing, the server re-reads the credentials file and adopts a token that another process already rotated, instead of reusing the old one (which would revoke the session). Writes are atomic, keep the file at0600, and merge into the existing file, so the CLI's storedapiUrlis kept. orbitnest_admin_signoutrevokes the session on the server and deletes the credentials file. From version 1.4.0, if the revoke fails (for example, the session already expired), it still clears local credentials and says so.
Choose a project
Most tools act on the active project. Set it at the start of a session:
You: List my OrbitNest projects and make my-app the active one.
AI: [calls orbitnest_list_projects]
[calls orbitnest_set_active_project with projectId "3f6c1a52-…"]orbitnest_set_active_projecttakes the project UUID (theidfromorbitnest_list_projects). It loads the project and caches its schema.- On startup, the server looks for
.orbitnest/config.jsonin its working directory and each parent directory, and selects the project it names. Runorbitnest linkfrom the CLI in your repo to create that file. The server reads the slug fromprojectSlug, or fromslugin files written by older CLI versions. - From version 1.4.0,
orbitnest_set_active_projectsaves the project only into the.orbitnest/config.jsonit found at startup, and never creates one in its working directory (for desktop clients that is often/or a system folder). The result'sworkspaceConfigfield gives the path it saved to, or says why nothing was saved. If caching the schema fails, the project is still selected and the result includes awarning. DEFAULT_PROJECT_IDpreselects a project when no workspace file is found.- Every project-scoped tool also accepts an explicit
projectId(a UUID) that overrides the active project for that call. Storage tools takeprojectSluginstead.
Note
Storage tools need the project slug. It comes from orbitnest_set_active_project or from the workspace file. If a storage tool says projectSlug is required, call orbitnest_set_active_project or pass projectSlug.
Configuration
Set environment variables in the env block of your client's MCP config. All of them are optional.
| Variable | Default | Effect |
|---|---|---|
ORBITNEST_API_URL | https://api.orbitnest.io | API to connect to. Must use https://. Plain http:// is allowed only for localhost, 127.0.0.1 and ::1. |
DEFAULT_PROJECT_ID | none | Project UUID to select when no .orbitnest/config.json is found |
ORBITNEST_MIGRATIONS_DIR | migrations | Default directory for the migration tools, relative to the server's working directory |
LOG_LEVEL | info | debug, info, warn or error. Logs go to stderr, so they never interfere with the protocol on stdout. |
ENABLE_SQL_GUARD | true | Set to false to skip the orbitnest_execute_sql safety checks (see Safety) |
BLOCK_AUTH_TABLE_MUTATIONS | true | Set to false to let orbitnest_execute_sql send writes to auth_* tables. The API still enforces its own protections. |
SCHEMA_CACHE_TTL | 300000 | How long the schema cache lasts, in milliseconds |
TOKEN_REFRESH_THRESHOLD | 60000 | Refresh the access token when it expires within this many milliseconds |
From version 1.4.0, trailing slashes are removed from ORBITNEST_API_URL. The variables MCP_SERVER_VERSION, DEFAULT_ENVIRONMENT and REQUIRE_DESTRUCTIVE_CONFIRMATION were removed and are ignored. The server reports the version from its own package.json.
{
"mcpServers": {
"orbitnest": {
"command": "npx",
"args": ["-y", "@orbitneststudio/mcp-server"],
"env": {
"DEFAULT_PROJECT_ID": "3f6c1a52-8d0e-4c1b-9a43-1e2f5b7c9d10",
"LOG_LEVEL": "warn"
}
}
}
}Tools
The server registers 113 tools. In the tables below, the orbitnest_ prefix is left off tool names. Call them by their full name, for example orbitnest_execute_sql.
Account
| Tool | Purpose |
|---|---|
admin_signin | Sign in with email and password (plus mfa_code when two-factor is on) |
login | Sign in with Google, GitHub or Apple in the browser |
admin_signup | Create a new OrbitNest admin account (email, password, fullName) |
request_verification | Email a verification code for sign-up (email, password, fullName) |
admin_signup_verified | Finish sign-up with the same email, password and fullName, plus the emailed 4-digit verificationCode |
refresh_token | Refresh the access token manually |
admin_signout | Sign out and delete the stored credentials |
get_profile | Show the signed-in admin's profile |
From version 1.4.0, fullName is required on the sign-up tools (it replaces the optional name), and verificationCode must be 4 digits. Passwords need at least 8 characters with an uppercase letter, a lowercase letter, a digit and one of @$!%*?&.
These tools manage your OrbitNest admin account. There are no dedicated tools for your app's end users. execute_sql can SELECT from the auth_* tables, but writes to them are blocked. Use the Authentication APIs to manage users.
Projects and API keys
| Tool | Purpose |
|---|---|
list_projects | List your projects |
get_project | Get one project's details |
create_project | Create a project with its own database. Returns its API keys. |
update_project | Change a project's name or settings |
delete_project | Delete a project and all its data (needs confirmDeletion: true) |
set_active_project | Select the project that later tools use by default |
get_project_health | Check project health, including database connectivity |
toggle_debug_mode | Turn the project's debug mode on or off |
get_api_keys | Show the project's API keys |
create_api_keys | Generate a new key pair. This invalidates all existing keys. |
Database
| Tool | Purpose |
|---|---|
get_schema | Get tables, columns (type, nullability, default, key constraint) and RLS status (cached for 5 minutes, forceRefresh to reload) |
execute_sql | Run SQL after the safety checks |
create_table | Create a table from a column list (name, type, nullable, primaryKey, unique, default, references), optionally with RLS on |
get_table_data | Read rows with limit (at most 100), offset and orderBy. The API pages by limit, so use an offset that is a multiple of limit. |
insert_row | Insert one row |
update_row | Update one row by id |
delete_row | Delete one row by id (needs confirmDeletion: true) |
bulk_insert | Insert many rows in one transaction |
bulk_update | Apply { where, data } updates |
bulk_delete | Delete rows that match column=value conditions (needs confirmDeletion: true) |
enable_extension | Enable a Postgres extension: vector, pg_trgm, citext, unaccent or uuid-ossp |
get_connection_string | Get the direct Postgres connection string, if the deployment has direct connections turned on |
Row-level security
| Tool | Purpose |
|---|---|
get_rls_status | Check whether RLS is on for a table |
enable_rls | Turn RLS on for a table |
disable_rls | Turn RLS off (needs confirmDisable: true, refused for auth_* tables) |
list_policies | List a table's policies |
create_policy | Create a policy (command, using, optional withCheck and role) |
delete_policy | Delete a policy (needs confirmDeletion: true) |
Migrations
| Tool | Purpose |
|---|---|
run_migrations | Apply pending .sql migrations in order, each in a transaction. Stops at the first failure. Pass migrationId to run one. |
list_migrations | List migration files with their applied, pending or failed status |
migration_status | Count applied, pending and failed migrations and report checksum mismatches |
The migration tools read files from the machine running the MCP server. They use the same file format and migrations registry table as the CLI. From version 1.4.0, the -- migrate:down marker must be the whole line, as in the CLI. See Migrations.
Edge functions and environment variables
| Tool | Purpose |
|---|---|
list_functions | List functions (without source code) |
get_function | Get a function, including its source |
create_function | Deploy a function (name, sourceCode, optional timeout: 10s, 30s (default), 60s or 120s). The source is JavaScript or TypeScript, with no import statements. |
update_function | Replace a function's source, description or timeout |
delete_function | Delete a function (needs confirmDeletion: true) |
get_function_logs | Read a function's most recent execution logs (limit). From version 1.4.0 it has no time-range parameters. For a time range, use query_logs with logType: edge-functions. |
get_env_variables | List environment variable names (values are never returned) |
create_env_variable | Add a variable |
update_env_variable | Change a variable's value (identified by name) |
delete_env_variable | Delete a variable (identified by name) |
Function source uses the handler format described in Edge functions.
Background jobs
| Tool | Purpose |
|---|---|
list_jobs | List scheduled jobs |
get_job | Get a job's source, schedule and settings |
create_job | Create a job from a cron expression or a preset (every-minute, every-5-minutes, every-15-minutes, every-hour, every-6-hours, daily, weekly), with an optional IANA timezone (default UTC) |
update_job | Change a job's source, schedule, timezone, status (active or inactive) or timeout |
delete_job | Delete a job (needs confirmDeletion: true) |
trigger_job | Run a job now |
get_job_runs | Read a job's run history |
See Background jobs.
Storage
| Tool | Purpose |
|---|---|
list_buckets | List buckets |
create_bucket | Create a bucket. public: true makes its files readable without a user token. Without public, a new bucket is private and an existing one keeps its visibility. |
delete_bucket | Delete an empty bucket (needs confirmDeletion: true) |
list_files | List files, optionally filtered by prefix |
upload_file | Upload a file. fileContent is a string (base64 for binary). Supports contentType and upsert. |
download_file | Download a file. From version 1.4.0, returns { filePath, contentType, size, encoding, content }. Text types (text/*, JSON, XML, CSV, JavaScript, SVG) come back as utf8 text and anything else as base64. Files over 1 MB return only filePath, contentType and size. |
delete_files | Delete files by path (needs confirmDeletion: true) |
get_public_url | Get the public URL of a file in a public bucket |
get_bucket_size | Get a bucket's total size |
See Storage.
Realtime
| Tool | Purpose |
|---|---|
list_realtime_tables | List tables with change streaming turned on |
enable_realtime | Stream INSERT, UPDATE and DELETE events for a table, with an optional column allowlist. Not allowed on auth_* or _realtime_* tables. |
disable_realtime | Stop streaming a table. Existing subscribers stop receiving its events. |
broadcast | Send a JSON payload to every subscriber of a channel. The broadcast: prefix is added if missing. |
See Realtime.
Webhooks and SMS
| Tool | Purpose |
|---|---|
list_webhooks | List database webhooks |
create_webhook | Create a signed webhook for row events (events, optional table_name). Returns the signing secret once. |
test_webhook | Send a test event to a webhook |
delete_webhook | Delete a webhook |
get_sms_config | Show the project's Twilio settings (the auth token is never returned) |
set_sms_config | Set account_sid, auth_token, from_number and is_enabled. The auth token is stored encrypted. |
test_sms | Send a test SMS |
get_auth_security | Show the project's end-user auth limits: code length, wrong codes, codes per hour, lockout |
set_auth_security | Change those limits (only the ones you pass; workspace admin) |
See Webhooks and Authentication.
Email (SMTP)
| Tool | Purpose |
|---|---|
get_smtp_settings | Show the project's SMTP settings |
update_smtp_settings | Set host, port, username, password, fromEmail, and optionally fromName and secure |
See Email & SMTP.
Analytics
| Tool | Purpose |
|---|---|
get_analytics_overview | Events, sessions, DAU and crashes for a date range |
get_analytics_events | Event counts as a time series |
get_top_analytics_events | The most frequent events |
get_top_analytics_screens | The most viewed screens or pages |
get_analytics_retention | Day-N rolling retention |
get_analytics_funnel | Funnel conversion across two or more event names (steps) |
get_analytics_performance | Performance metric percentiles |
get_analytics_crashes | Crash groups and crash rate |
create_analytics_token | Create an ingestion token |
list_analytics_tokens | List ingestion tokens |
revoke_analytics_token | Revoke a token (needs confirmRevocation: true) |
Most analytics tools accept from and to (ISO 8601) and some accept granularity, platform and appVersion. See Analytics.
Logs
| Tool | Purpose |
|---|---|
query_logs | Search logs by logType (all, database, auth, edge-functions), level, time range (startTime, endTime, ISO 8601) and text. From version 1.4.0, every logType applies all of these filters. |
get_slow_queries | List database queries that took longer than 1000 ms |
get_log_stats | Get log statistics and aggregations |
export_logs | Export logs as json or csv, newest first, up to 10,000 rows. Filters: level, search, startTime, endTime. From version 1.4.0, returns the raw JSON or CSV text, with a note when the export was cut off at 10,000 rows. |
See Logs & observability.
Project Memory
| Tool | Purpose |
|---|---|
get_project_context | Load the project's memory at session start |
sync_memory | Save a session digest plus decisions, tasks and events in one call. From version 1.4.0, lists each item that failed, with the error. |
add_decision / get_decisions | Record or read architectural and product decisions |
add_task / get_open_tasks / complete_task | Track follow-up work |
add_feature / update_feature | Track roadmap features |
add_event / get_recent_changes | Write to or read the project timeline |
search_memory | Semantic search across all memory |
set_project_profile | Set the project summary, stack, conventions or digest |
See Project Memory for parameters and the recommended agent workflow.
Workspace and admins
| Tool | Purpose |
|---|---|
get_dashboard_stats | Workspace totals (projects, users, functions, storage) |
get_activity | Recent workspace activity |
list_admins | List the members of your organization |
get_admin | Get your own admin record (the API returns only your own) |
create_admin | Invite a member by email (needs confirmCreate: true and the workspace admin role) |
update_admin | Change fullName or email on your own account, or isActive for another member (needs confirmUpdate: true) |
delete_admin | Remove a member, or close your own account (needs confirmDeletion: true). Removing someone else requires the admin role. |
From version 1.4.0, update_admin sends fullName and email to your own admin record. Changing email needs currentPassword and signs out all your sessions, including this one. isActive uses a separate endpoint and needs the workspace admin role.
See Team & roles.
Resources and prompts
Besides tools, the server provides:
- Server instructions that tell the assistant how to use Project Memory: load context once at session start, write decisions, tasks and events as they happen, and call
orbitnest_sync_memoryat the end. - The
project://contextresource: a short JSON summary of the active project (name, one-line description, stack, item counts). It is capped at 4,000 characters because some clients read resources on every request. When you aren't signed in, it returns{ "error": "Not signed in…" }instead of failing. - The
orbitnest_load_projectprompt: loads the project's full memory into the conversation in one step.
Safety
The server signs in as you, so every tool can do what your account can do. Review tool calls before you approve them, especially in production projects.
SQL checks
Unless ENABLE_SQL_GUARD=false, orbitnest_execute_sql checks each query before sending it:
- Queries that contain
INSERT,UPDATE,DELETE,ALTER,DROP,TRUNCATE,GRANTorREVOKEare rejected unless you passconfirmDestructive: true.SELECTandCREATErun without it. - Queries that look like injection are blocked outright: a stacked destructive statement (for example
; DROP ...),UNION SELECT, a/* ... */comment, or a line that ends in a bare--. - Writes that touch an
auth_*table are blocked. Read-onlySELECTs are allowed.
The row tools (insert_row, update_row, delete_row and the bulk tools) also refuse auth_* tables. The API applies its own validation on top of these checks.
Confirmation flags
These tools refuse to run unless their confirmation flag is true:
| Flag | Tools |
|---|---|
confirmDeletion | delete_project, delete_row, bulk_delete, delete_policy, delete_function, delete_job, delete_bucket, delete_files, delete_admin |
confirmDestructive | execute_sql (for the statements listed above) |
confirmDisable | disable_rls |
confirmRevocation | revoke_analytics_token |
confirmCreate, confirmUpdate | create_admin, update_admin |
Changes with no confirmation flag
Some tools change things without a confirmation flag: create_api_keys (invalidates every existing key), delete_webhook, delete_env_variable, disable_realtime, run_migrations, update_function, update_job and the settings tools. Use a staging project when an agent is exploring.
Permissions and plans
- Raw SQL and schema changes are limited to the project's creator:
execute_sql,create_table,enable_extension, the migration tools,enable_rls,disable_rls,create_policyanddelete_policy. Other workspace members get403 This operation is restricted to the project owner. - Any workspace member can read the schema (
get_schema), table data, RLS status and policies, and use the row tools. - The storage, background job and realtime tools work on every plan.
- Plan quotas apply. When a workspace is over a quota, uploads, writes that grow the database, function creation and function invocations return
402with codeQUOTA_EXCEEDED. See Plans & billing.
Example session
You: Create a posts table with id, title, body, author_id and created_at,
turn on RLS, and let users update only their own posts.
AI: [orbitnest_create_table tableName "posts", enableRLS true]
[orbitnest_create_policy command "UPDATE",
using "author_id = auth.uid()"]
[orbitnest_add_decision "posts are owner-editable via RLS"]
Done. posts exists with RLS on, plus an UPDATE policy limited
to the row's author. I recorded the decision in project memory.Studio Assistant
Studio also has a built-in assistant that works without installing anything. Open it from the bot icon in the Studio top bar. It runs on the OrbitNest server, not in your MCP client, and has a smaller, fixed set of tools:
| Kind | Tools |
|---|---|
| Read | List projects, get a project, list tables, get schema, list functions, list jobs, list buckets, workspace stats, list members, and get a project's URL and anon key (the service role key is never shown) |
| Project Memory (read-only) | Load context, recent changes, open tasks, active decisions, semantic memory search |
| Write | Create a table from a column spec (the model never writes raw SQL), create a project (workspace admins only), invite a member (workspace admins only) |
- Questions and how-to requests get a written answer. Requests that map to a tool are carried out immediately. Write actions do not ask for confirmation.
- Project-scoped requests use the project you have open, or one you name in the prompt.
- Requests outside the OrbitNest platform are declined.
- Requests are planned by a Google Gemini model on the OrbitNest server and are logged with the tools they ran.
- Default limits per user: 10 requests per minute, 50 per hour and 1,000 per day, with at most 10 tool steps per request.
To write Project Memory or use the full tool set, use the MCP server.
Troubleshooting
| Symptom | Fix |
|---|---|
Not authenticated | Call orbitnest_admin_signin or orbitnest_login. |
projectId is required | Call orbitnest_list_projects and then orbitnest_set_active_project, or set DEFAULT_PROJECT_ID. |
| Refresh fails and you must sign in again | Refresh tokens rotate, and reusing a rotated one revokes the session. MCP 1.4.0 and CLI 0.6.0 share a lock and adopt each other's new tokens. Older versions running side by side can still end up holding a used token. Upgrade both and sign in again. |
Refusing to use an insecure API URL | ORBITNEST_API_URL must use https:// unless it points at localhost. |
| Server missing from the client | Check that Node.js 18+ is on the client's PATH. For Claude Code, run claude mcp list. The first npx start can take a few seconds while the package downloads. |
Browser doesn't open for orbitnest_login | The sign-in URL is written to the server log (stderr). Open it manually within 3 minutes. |