Connecting Claude Code to Knack

Connect Claude Code to your Knack app through the Knack MCP Server so it can read your data model and build a custom frontend against it.

What you'll learn

Claude Code connects to Knack through the Knack MCP Server, which lets it read your app's tables, fields, and user roles and build a custom frontend against them. This article covers making that connection, pointing Claude Code at the right app, and confirming it worked before you build anything.

What you need before you start

You need three things in place. Two of them are outside Knack.

  • A Knack app with Builder access on the account you'll sign in with
  • Claude Code, in the desktop app or the terminal
  • A GitHub account and a hosting account, such as Cloudflare

The last one surprises people. Claude Code builds on your own computer rather than hosting your app for you, which has two consequences worth understanding before you start.

Your app has no backup until you make one. On platforms that build and host for you, your code sits on their servers automatically. Here it sits in a folder on your laptop, with no copy and no version history, until you save it to GitHub.

Your app also has no web address until you deploy it. That matters sooner than you'd expect, because Knack only accepts https sign-in addresses. Nobody can log in to your frontend until it has a real address, including you.

📘

This differs from Lovable and Base44

Those platforms store and host your app themselves, so backups and sign-in both work without you arranging anything. With Claude Code you choose where your code is stored and where it runs. That is more control and more responsibility, and the setup is a one-time cost.

See Hosting a Claude Code Frontend for Knack for that side of the setup.

How Claude Code connects to Knack

Claude Code talks to Knack through the Knack MCP Server, a connector you authorize once with your Knack Builder login. Once it's connected, Claude Code can read your app's structure and make changes to it.

The connection is tied to the Knack account you sign in with. It reaches the apps that account can open in the Builder, and no others.

Your data model becomes the specification. You don't describe your tables to Claude Code, because it reads them.

Connecting the Knack MCP Server

  1. In Claude Code, open Settings and go to Connectors
  2. Add the Knack connector
  3. Sign in with your Knack Builder credentials when prompted
  4. Enter your six-digit code if you have two-factor authentication turned on
  5. Approve the authorization screen
  6. Confirm the connector shows as active

You do this once per Claude account, not once per project. It follows you to any computer you sign in on.

⚠️

Check which Knack account you connected

The connector authorizes whichever Knack account you sign in with, and if you're already signed in to Knack in that browser it may go through without asking. If you have more than one Knack account, you can end up connected to the wrong one without any warning.

Telling Claude Code which app to use

Name the app and ask Claude Code to read it before you ask for anything to be built.

A first message that works:

Connect to my Knack app "Larkspur Patient Portal" and tell me what's in it.

Claude Code returns your tables, fields, user roles, and the connections between them. Read that summary before going further. If the tables listed aren't the ones you expect, you're pointed at the wrong app.

Once it has read the app, describe what you want built. Two things belong in that description:

  • Which user roles need their own view
  • Where the app will be hosted

The second one is easy to leave out. Mentioning your host lets Claude Code set up the deployment configuration correctly the first time instead of you fixing a failed deploy later.

What Claude Code can and cannot change in Knack

The MCP Server manages your app's structure. It does not manage individual records.

Claude Code canClaude Code cannot
Read your app's tables, fields, and connectionsCreate or edit individual records
Create and update tables and fieldsChange the type of an existing field
Configure Data Access ControlBuild Knack pages, elements, or themes
Create sample recordsReach apps on other Knack accounts

Two of these have consequences worth knowing about now.

Field types can't be changed after a field is created. Changing one means deleting and recreating it, which loses the data in it.

Whether a table holds users who log in is also permanent. A table built as a standard table can never become a user role table. If people will sign in as that role, say so before it gets built.

⚠️

Verify changes in the Builder

An AI builder can report that a change succeeded when it didn't land. After Claude Code tells you it changed something in Knack, open the Builder and confirm. This applies in both directions. If it tells you something isn't possible, check that too.

Verifying the connection works

Run these three checks before you build anything on top of the connection.

  1. Ask Claude Code to list your Knack apps. The list should look like yours.
  2. Ask it to describe the app you named. The tables should match what's in your Builder.
  3. Open the Builder and confirm the record counts it reports are right.

If any of the three is wrong, fix it now. Every later step inherits this connection, and a wrong app is much cheaper to correct before code exists.

Common mistakes

Connected to the wrong Knack account. The connector uses whichever account was signed in during authorization. Ask Claude Code to list your apps and check the list before building.

Asking for a build before asking for a read. Claude Code builds better against a data model it has actually inspected. Ask it to read the app first, in its own message.

Not saying which tables hold users. Tables that hold people who sign in must be user role tables, and that choice can't be reversed. Name those roles in your first description.

Trusting a completion message. Confirm changes in the Builder rather than relying on what the builder reports.

Next steps


Did this page help you?