Connect and automate

MCP Integration (Model Context Protocol)

Connect your NCB workspace to AI coding assistants like Cursor and Claude.

AI-assisted developers5 min read

MCP Integration: Connecting AI Coding Assistants

The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and development tools.

By integrating NoCodeBackend via MCP, you give AI coding assistants (like Cursor, Windsurf, Claude Desktop, VS Code, or Google Antigravity) direct, secure access to your database schema, live API documentation, and the ability to execute read-only SQL queries directly from your chat interface.

This comprehensive guide covers generating MCP tokens, connecting AI assistants using remote HTTP/SSE or local stdio, configuration file syntax, security practices, and troubleshooting.


1. Overview & Available Tools

When you connect your NoCodeBackend workspace via MCP, your AI assistant gains access to dedicated backend tools:

  • get_schema: Reads the exact SQL structure of your tables (columns, data types, indexes, and foreign key relationships).
  • get_swagger: Reads the live REST API endpoints, expected JSON payloads, and parameter definitions.
  • execute_sql: Allows the AI to run safe, read-only SQL queries against your live database to understand the shape of your actual data.

The connection is scoped strictly to development-assistance tools. Destructive operations (dropping tables, deleting databases, altering billing) are completely blocked.


2. Generating an MCP Token

  1. Log into your NoCodeBackend dashboard at app.nocodebackend.com.
  2. Navigate to Developer Settings > MCP in the sidebar.
  3. Click Create Token.
  4. Enter a descriptive name (e.g., "Cursor Work Laptop" or "Claude Desktop").
  5. Copy the generated token immediately (starts with ncb_mcp_...). Store it securely; for your security, raw tokens cannot be retrieved again after closing the modal.

3. Remote SSE Connection (Recommended)

Remote SSE (Server-Sent Events) requires zero local installation. The MCP server runs directly on NoCodeBackend infrastructure.

  • Active Server URL: https://app.nocodebackend.com/api/mcp/sse
  • Authentication: Sent either as an HTTP Bearer header (Authorization: Bearer <TOKEN>) or directly as a URL parameter (?token=<TOKEN>).

Method A: Configuration File (Best for Cursor, Claude Desktop, Windsurf, VS Code)

1. Cursor (~/.cursor/mcp.json)

Add the following to your Cursor MCP configuration file (~/.cursor/mcp.json):

{
  "mcpServers": {
    "nocodebackend": {
      "url": "https://app.nocodebackend.com/api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_TOKEN"
      }
    }
  }
}

2. Claude Desktop (claude_desktop_config.json)

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "nocodebackend": {
      "url": "https://app.nocodebackend.com/api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_TOKEN"
      }
    }
  }
}

3. Windsurf (~/.codeium/windsurf/mcp_config.json)

{
  "mcpServers": {
    "nocodebackend": {
      "serverUrl": "https://app.nocodebackend.com/api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_TOKEN"
      }
    }
  }
}

4. VS Code (Copilot / .vscode/mcp.json)

{
  "servers": {
    "nocodebackend": {
      "type": "sse",
      "url": "https://app.nocodebackend.com/api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_TOKEN"
      }
    }
  }
}

Method B: GUI Setup (Cursor Settings UI)

If adding the server directly via the editor's visual settings:

  1. Open Cursor Settings (Cmd + Shift + J or Ctrl + Shift + J) → Features → MCP.
  2. Click + Add New MCP Server.
  3. Set Type to sse.
  4. Set Name to NoCodeBackend.
  5. In the URL field, enter:
    https://app.nocodebackend.com/api/mcp/sse?token=YOUR_MCP_TOKEN
    
  6. Click Save. The status dot will turn green, indicating an active connection.

4. Local Stdio Connection (Alternative)

If your environment or corporate firewall blocks outbound SSE streaming connections, you can run the MCP server locally over standard input/output (stdio):

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "nocodebackend": {
      "command": "npx",
      "args": ["-y", "@nocodebackend/mcp"],
      "env": {
        "NCB_TOKEN": "YOUR_MCP_TOKEN"
      }
    }
  }
}

Requirements: Node.js 18+ installed on your local machine.


5. Security & Token Revocation

  • Access Control: An MCP token grants read access to all database schemas, table structures, and Swagger API documentation owned by your account. Treat it with the same care as an administrative API key.
  • Immediate Revocation: If a token is compromised or a developer leaves your team, go to Developer Settings > MCP, locate the token, and click Revoke. All active connections using that token are terminated immediately.

6. Troubleshooting & FAQs

Q: Does mcp.nocodebackend.com exist?

No. Early preview documentation referenced mcp.nocodebackend.com. The active, official endpoint is https://app.nocodebackend.com/api/mcp/sse.

Q: Should the token be sent as a header or query parameter?

Both are fully supported:

  • In JSON config files, use "headers": { "Authorization": "Bearer YOUR_TOKEN" }.
  • In visual inputs that only take a single URL, append ?token=YOUR_TOKEN to the URL.

Q: Why do I see "Invalid JWT form" or "x-clerk-auth-status: signed-out"?

NoCodeBackend MCP tokens use an opaque, high-entropy format (ncb_mcp_...), not Clerk user session JWTs. The /api/mcp/sse endpoint authenticates your token independently. Ensure you are connecting to https://app.nocodebackend.com/api/mcp/sse.

Q: Connection Failed: Unauthorized (401)

  • Verify that your token was copied completely with no leading or trailing whitespace.
  • Check Developer Settings > MCP to ensure the token has not been revoked or replaced.
  • If using npx, make sure the environment variable is named NCB_TOKEN.

Q: AI Assistant says "I don't have access to your database"

Ensure the server indicator is green in your assistant's settings. In your prompt, explicitly prompt the assistant:

💡

"Use the NoCodeBackend MCP tools to inspect my database schema and tell me what tables are available."

MCP Integration (Model Context Protocol) | Help Center