Sign up for your free trial and begin automating your processes today.
Featured image of post Supercharge Your n8n & NocoDB Stack: Connecting Dual MCP Servers to Your AI Agent

Supercharge Your n8n & NocoDB Stack: Connecting Dual MCP Servers to Your AI Agent

Stop jumping between tabs to debug workflows and database schemas. Learn how to connect both n8n and NocoDB MCP servers to an AI agent like Antigravity across Cloud and self-hosted setups.

In our previous guide, Beyond Google Sheets: Why NocoDB Is the True Database UI for Your n8n Workflows, we solved the data layer problem. Moving from flat spreadsheets to NocoDB gave us relational schemas, strict field types, and instant webhooks that trigger n8n workflows without polling overhead.

Your runtime architecture is now solid. Your development loop, however, probably still involves a lot of tab switching.

Every time you build, extend, or debug an automation between NocoDB and n8n, you pay a constant context-switching tax: opening NocoDB to verify exact column names, switching to n8n to tweak an expression, flipping back to NocoDB to flip a record status, returning to n8n to inspect the execution log, and copying JSON payloads into an AI chat window so an assistant can help you spot what went wrong.

With the Model Context Protocol (MCP), you can eliminate that manual loop. Both n8n and NocoDB ship with official built-in MCP servers—available whether you run on managed Cloud or your own self-hosted infrastructure. When you connect both MCP servers to an agentic coding environment like Antigravity, your AI agent stops guessing schemas from pasted snippets and starts operating directly against your live workflows and live database.


The Context-Switching Tax in Automation Engineering

Even with a clean stack, working on multi-system workflows without live agent tooling creates four recurring bottlenecks:

  1. Blind Expression Writing: Writing an expression like {{ ($json.body.data?.rows || [$json.body])[0]?.Status }} requires knowing exact field names, casing (Status vs. status, AI Summary vs. ai_summary), and option values (pending, approved, rejected). One typo causes silent empty values downstream.
  2. Slow Webhook Debug Cycles: Testing an After Update or After Insert trigger means manually editing a row in one browser tab, jumping to another tab to inspect the execution trace, and repeating the cycle until every branch passes.
  3. Tedious Test Data Seeding: Validating edge cases—missing company names, multiline notes, special characters, or Unicode—usually ends with manually typing dummy rows into a grid.
  4. Silent Schema Drift: When someone renames a column or adds a new status option in NocoDB, n8n workflows can break or misroute records without immediate visibility until you audit both interfaces side by side.

Connecting NocoDB and n8n to your AI agent via MCP collapses all four steps into a single workspace.


What Dual-MCP Unlocks (and How n8n & NocoDB Differ)

Think of MCP as a standardized USB-C port for AI tools: instead of writing custom glue scripts, each platform exposes structured tools (with typed JSON schemas) that any compatible client—such as Antigravity, Cursor, or Claude—can discover and invoke safely.

Understanding n8n’s Three MCP Roles

Before configuring n8n, it helps to distinguish between three separate MCP features in the n8n ecosystem so you enable the right one:

  1. Instance-Level MCP Server (Built-in): Exposes your n8n instance to external AI agents so they can search workflows, inspect node configs, read execution logs, validate expressions, and run or update workflows. This is what we are using in this guide.
  2. MCP Server Trigger Node: Turns a single n8n workflow into a custom MCP tool endpoint for external clients.
  3. MCP Client Tool Node: Lets an AI Agent running inside an n8n workflow call external MCP servers.

Natively, n8n’s built-in Instance-Level MCP Server exposes a rich toolset covering discovery (search_workflows, get_workflow_details), execution and testing (test_workflow, execute_workflow, prepare_workflow_pin_data, search_workflow_executions, get_workflow_execution), and workflow authoring/validation (search_nodes, validate_node_config, validate_workflow, create_workflow_from_code, update_workflow, publish_workflow).

What NocoDB MCP Exposes (Cloud vs. Self-Hosted Community)

NocoDB also ships a native MCP server, with tool scope depending on your edition:

  • NocoDB Cloud & Licensed Self-Hosted: Connects through a global endpoint using OAuth2 and exposes the full management suite (140+ tools covering bases, tables, fields, views, webhooks, permissions, and records).
  • NocoDB Self-Hosted Community Edition: Uses a base-scoped MCP endpoint authenticated via an API token header. It exposes 11 focused tools for schema inspection, querying, analytics, and record CRUD:
    • Schema & Metadata: getBaseInfo, getTablesList, getTableSchema
    • Read & Analytics: queryRecords, getRecord, countRecords, aggregate, readAttachment
    • Write (CRUD): createRecords, updateRecords, deleteRecords
📝 Note

Practical takeaway: Even on the free self-hosted Community Edition of NocoDB, having live read access to table schemas (getTableSchema) plus full record CRUD (createRecords, queryRecords, updateRecords) is enough to power schema-aware n8n development, automated QA seeding, and end-to-end verification.


Step-by-Step Setup: Connecting n8n and NocoDB to Antigravity

The steps below work uniformly across managed Cloud and self-hosted deployments—no container workarounds or custom wrapper code required.

Step 1: Enable Instance-Level MCP in n8n

Works identically on n8n Cloud and self-hosted n8n:

  1. Sign in to your n8n instance as an Owner or Admin.
  2. Open Settings > Instance level MCP.
  3. Set MCP status to Enabled.
  4. Under Access, open Workflows enabled to choose which specific workflows connected clients can reach (for example, NocoDB Pattern A: Status Trigger and NocoDB Pattern B: AI Enrichment on Insert). Leave MCP access for new workflows toggled off in production if you prefer manual opt-in.

The Instance level MCP settings panel in n8n showing MCP status set to Enabled, the Connect button, and Access controls for Workflows enabled and MCP access for new workflows.

  1. Click Connect to open the Connect a client modal and pick your authentication tab:
    • OAuth (recommended): Best when running on n8n Cloud or an HTTPS self-hosted domain with an OAuth-capable client.
    • API key: Displays your Server URL (https://<your-workspace>.app.n8n.cloud/mcp-server/http on Cloud, https://<your-n8n-domain>/mcp-server/http on self-hosted, or http://localhost:5678/mcp-server/http locally), a masked Access token, and a ready-to-paste Configuration JSON snippet.

The Connect a client modal in n8n showing the API key tab with Server URL, masked Access token, and a ready-to-copy Configuration JSON snippet.

  1. Verify workflow-level access and descriptions: Ensure each target workflow you want the agent to inspect or execute is listed under Workflows enabled (via Enable workflows or the workflow-level Available in MCP toggle). Also give exposed workflows a clear Description—n8n explicitly flags entries with No description because AI agents rely on that summary when selecting tools via search_workflows.

The Workflows enabled table inside n8n Instance level MCP settings showing NocoDB Pattern A and Pattern B with clear descriptions alongside workflows flagged with No description.

💡 Tip

Keep production workflows isolated: While search_workflows lets the agent browse lightweight previews of workflows you have permission to view, execution and modification tools only operate on workflows explicitly marked Available in MCP. Leave sensitive billing or broadcast workflows disabled unless you intentionally want agent access.


Step 2: Get Your MCP Endpoint in NocoDB

Choose the path matching your NocoDB deployment:

Option A: NocoDB Cloud (or Licensed Self-Hosted)

  • Endpoint URL: https://app.nocodb.com/mcp on Cloud, or https://<your-nocodb-domain>/mcp on licensed self-hosted (ensure NC_SITE_URL is configured to your public HTTPS URL).
  • Authentication: OAuth2 sign-in flow when your MCP client connects, allowing you to authorize specific workspaces and bases.

Option B: NocoDB Self-Hosted Community Edition

  1. Open your target Base in NocoDB (for example, the workspace holding your leads table).
  2. In the left sidebar, navigate to Overview > Settings.
  3. Open the Model Context Protocol section and click New MCP Endpoint.
  4. NocoDB opens the MCP Setup screen (with dedicated tabs for Claude, Cursor, Windsurf, and AntiGravity) and generates a base-specific URL and token (displayed only once upon creation or regeneration):
    • URL: https://<your-nocodb-domain>/mcp/<endpoint-id> (or http://localhost:8080/mcp/<endpoint-id> locally)
    • Header: xc-mcp-token: <YOUR_NOCODB_MCP_TOKEN>

The NocoDB MCP Setup panel with the AntiGravity tab selected, showing setup steps and the generated mcpServers JSON configuration.


Step 3: Add Both Servers to Antigravity (mcp_config.json)

Antigravity reads global MCP server definitions from ~/.gemini/config/mcp_config.json and supports both Streamable HTTP (url) and Stdio (command, args, env) transports.

Add both n8n and nocodb inside the "mcpServers" object.

Configuration A: Token-Based Streamable HTTP (Universal for Self-Hosted & Cloud Tokens)

{
  "mcpServers": {
    "n8n": {
      "type": "http",
      "url": "https://<your-n8n-domain>/mcp-server/http",
      "headers": {
        "Authorization": "Bearer <YOUR_N8N_MCP_TOKEN>"
      }
    },
    "nocodb": {
      "type": "http",
      "url": "https://<your-nocodb-domain>/mcp/<endpoint-id>",
      "headers": {
        "xc-mcp-token": "<YOUR_NOCODB_MCP_TOKEN>"
      }
    }
  }
}

Configuration B: NocoDB Cloud (OAuth)

If you use NocoDB Cloud instead of a Community Edition token endpoint, point nocodb to the global Cloud MCP URL:

{
  "mcpServers": {
    "n8n": {
      "type": "http",
      "url": "https://<your-workspace>.app.n8n.cloud/mcp-server/http",
      "headers": {
        "Authorization": "Bearer <YOUR_N8N_MCP_TOKEN>"
      }
    },
    "nocodb": {
      "url": "https://app.nocodb.com/mcp"
    }
  }
}
💡 Tip

Using the mcp-remote Stdio Bridge: NocoDB’s built-in AntiGravity tab generates a snippet using npx mcp-remote (shown below). That works out of the box too—especially if you share the same config with desktop clients that only accept command/args entries or need custom header forwarding over stdio:

"nocodb": {
  "command": "npx",
  "args": [
    "mcp-remote",
    "https://<your-nocodb-domain>/mcp/<endpoint-id>",
    "--header",
    "xc-mcp-token: <YOUR_NOCODB_MCP_TOKEN>"
  ]
}

Note that Antigravity also speaks Streamable HTTP natively (as in Configuration A)—legacy HTTP+SSE endpoints (/sse) are not supported directly without a stdio bridge.

Step 4: Verify Active Tools in Antigravity

  1. Save the merged configuration in ~/.gemini/config/mcp_config.json and double-check that the JSON syntax is clean—a stray brace or trailing comma prevents the entire file from loading.
  2. In Antigravity, open Plugins in the left sidebar, switch to the Installed tab, and scroll to MCP Servers (or run /mcp if you are using the CLI).
  3. If an OAuth-enabled server shows an Authenticate button, complete the sign-in flow.
  4. Confirm that both n8n-mcp and nocodb display green status indicators alongside their enabled tool counts.

The MCP Servers section in Antigravity showing both n8n-mcp with 67 enabled tools and nocodb with 11 enabled tools connected with green status indicators.


4 High-Leverage Use Cases (Built on Our leads Stack)

Once both servers are active, your agent has simultaneous visibility into your data layer and your orchestration layer. Using the same leads table and two workflows from our previous NocoDB guide, here is what that looks like in practice.

1. Schema-Aware Workflow Authoring (Zero Guesswork)

Before: You guess whether the timestamp column is ApprovedAt or approved_at, or copy column names manually before asking an AI to write an expression.

With Dual-MCP: Ask your agent:

“Inspect the leads table in NocoDB and check NocoDB Pattern A: Status Trigger in n8n. Verify that every field referenced in the IF node and NocoDB Update node matches the exact column names and SingleSelect options.”

Under the hood, the agent:

  1. Calls getTablesList and getTableSchema in NocoDB, seeing exact field titles (Id, Name, Email, Company, Status with choices pending, approved, rejected, approved_at, Notes, AI Summary).
  2. Calls search_workflows and get_workflow_details in n8n to inspect the IF conditions and node mappings.
  3. Validates node configuration with validate_node_config or validate_workflow before touching anything live.

2. Automated QA Seeding & End-to-End Verification

Before: You type 3–5 rows into NocoDB manually, wait, refresh, and check n8n executions to verify Pattern B: AI Enrichment on Insert.

With Dual-MCP: Give the agent a single QA prompt:

“Insert 5 realistic test leads into leads covering edge cases (missing company, long multi-line notes, special characters). Then check the latest executions of NocoDB Pattern B: AI Enrichment on Insert in n8n and confirm AI Summary was populated for all 5 rows.”

The agent orchestrates both sides in seconds:

  1. Calls createRecords in NocoDB with 5 edge-case payloads.
  2. Calls search_workflow_executions and get_workflow_execution in n8n to confirm all 5 webhook runs succeeded without timeout or JSON parsing errors.
  3. Calls queryRecords in NocoDB with a filter like (AI Summary,notblank) (or checks the specific created IDs) to confirm the outputs actually landed in the database.

An Antigravity agent session querying the leads table via NocoDB MCP and verifying recent workflow execution results via n8n MCP in a single conversation.

3. Single-Window Webhook & State-Transition Debugging

Before: When a status change fails to stamp approved_at, you bounce between NocoDB webhook logs, n8n execution JSON, and your prompt window.

With Dual-MCP: Ask the agent:

“Record #14 in leads was set to approved, but approved_at is still empty. Check the record and inspect recent failed or filtered executions on NocoDB Pattern A: Status Trigger.”

The agent calls getRecord in NocoDB to inspect current field values, pulls the exact webhook payload from get_workflow_execution in n8n, and immediately spots whether previous_rows[0].Status was already approved, whether an expression path mismatched, or whether the workflow was unpublished. It can even stage test payloads with prepare_workflow_pin_data and run test_workflow safely without waiting for new live webhooks.

4. Natural-Language Ops & Missing-Data Backfills

Before: Finding unenriched leads and running a cleanup pass requires building temporary views or manual CSV exports.

With Dual-MCP: Ask the agent:

“How many leads currently have Status set to pending and an empty AI Summary? List them, and trigger the enrichment workflow for those records.”

The agent combines countRecords and queryRecords (using NocoDB’s filter syntax like (Status,eq,pending)~and(AI Summary,blank)) with execute_workflow in n8n—turning ad-hoc operational maintenance into a natural-language command.


Before vs. After: What Changes Day to Day

Task Manual UI Workflow Dual-MCP Agent Workflow
Checking field names & types Open NocoDB UI, inspect column settings, copy into notes Agent calls getTableSchema directly in context
Testing webhook payloads Edit rows in browser, switch tabs to n8n Executions Agent seeds rows via createRecords and inspects get_workflow_execution
Updating & validating nodes Tweak expressions in canvas, test manually, fix typos Agent inspects via get_workflow_details and checks with validate_workflow
Auditing broken/blank rows Build temporary grid filters or export CSVs Agent queries with queryRecords / aggregate and runs backfill workflows

Guardrails & Best Practices

Giving an AI agent live tools across your database and automation engine is powerful—and deserves basic safety boundaries:

  • Use Least Privilege & Dev Bases First: Start by connecting a staging or development NocoDB base and test workflows. Keep production billing, customer email blasts, or destructive admin workflows toggled off for Available in MCP until your team is comfortable with the workflow.
  • Confirm Destructive Operations: Tools like deleteRecords in NocoDB or update_workflow / publish_workflow in n8n mutate live state. Keep human approval enabled for destructive or publish tool calls in your agent client.
  • Combine MCP with Project Rules (GEMINI.md / SKILL.md): MCP gives your agent hands (live tool access), but it does not automatically know your engineering standards. Pairing mcp_config.json with lightweight project rules—for example, “Always prefer native NocoDB nodes over raw HTTP Request nodes” and “Always guard After Update webhooks with a current !== previous status transition check”—ensures every workflow the agent edits follows your architecture out of the box.

Conclusion

Upgrading from Google Sheets to NocoDB made your automation data layer reliable. Connecting both n8n and NocoDB to an AI agent like Antigravity via MCP upgrades how you build, test, and maintain that stack.

Setup takes less than five minutes—enable Instance-level MCP in n8n, generate an MCP endpoint in NocoDB, and drop both into mcp_config.json. Start with a single non-production base and one or two workflows marked Available in MCP, then try running an automated QA seed-and-verify loop. Once your agent can read the schema and inspect the execution trace in one place, you will never want to go back to copying JSON between browser tabs.

Get a free Brevo account for reliable SMTP and marketing automation in your n8n workflows.
n8n is a trademark of n8n GmbH. This site is not officially associated with n8n GmbH.
Built with Hugo
Theme Stack designed by Jimmy