Helm7

Build MCP Server Tools Over a Product Catalogue

The Helm7 team · Published 15 November 2026 · Checked 16 November 2026 · 7 min read

build mcp server: a vintage card catalogue drawer in an archive library
Photo by Tima Miroshnichenko on Pexels

You want an AI assistant to answer questions about your product catalogue, and you want your own customers to point their assistants at it too. You could build MCP server code by hand, or you could describe the tools you want and let the database enforce the limits. This worked example takes a small catalogue from table to a connected client, and shows which columns and rows stay out of reach.

In short

  • To build MCP server tools over a table, describe each tool by kind, table, columns, filters, row filter and auth mode. Do not write endpoint code.
  • Limits are enforced by Postgres itself: column-level grants for exactly the named columns, and a role switch with token claims set on every request.
  • Public insert and update without a row filter is refused, and insert pins row-filter columns from the caller's claims.
  • Connect with a single URL. In Claude Code, that is claude mcp add with the http transport. Delete the server and its roles go straight away; the URL returns 404 within seconds.
  • Public means public. List only columns you would publish on a web page, and treat row text as untrusted input.

What are we going to build?

A worked example, with a made-up shop. It has a Postgres database, a products table people may browse, and a reviews table that signed-in customers may add to. Before we build MCP server tools, we want three things: anyone can search and read live products, nobody can see our costs, and a customer can only create or read their own reviews.

CREATE TABLE products (
  id           bigserial PRIMARY KEY,
  sku          text UNIQUE NOT NULL,
  name         text NOT NULL,
  description  text,
  category     text,
  price_pence  integer NOT NULL,
  status       text NOT NULL DEFAULT 'draft',  -- 'live' or 'draft'
  cost_pence   integer,                        -- private
  supplier     text                            -- private
);

CREATE TABLE reviews (
  id          bigserial PRIMARY KEY,
  product_id  bigint REFERENCES products(id),
  user_id     text NOT NULL,
  rating      integer NOT NULL,
  body        text
);
The two tables in the example. Cost and supplier must never reach the public.

Two details to hold on to. Draft products exist in the table and must stay hidden. And cost_pence and supplier are columns in the same row as the public data, which is the case that goes wrong most often when people hand-write an endpoint.

Why build MCP server tools from a table description?

You can always build MCP server code yourself with an official SDK. That is the right choice when a tool needs real logic: calling a payment provider, combining three systems, applying business rules. When you build MCP server tools that only read and write rows, hand-written code is mostly plumbing, and plumbing is where mistakes hide. A forgotten column in a SELECT, a missing filter on one route.

The transport side is simple. The current specification says that on Streamable HTTP each message is an HTTP POST to a single MCP endpoint, so a server is one URL that answers JSON-RPC. If MCP is new to you, what an MCP server is covers the vocabulary first.

“each message is an HTTP POST to a single MCP endpoint”
Model Context Protocol specification, Transports, revision 2026-07-28

The approach in this post moves the limits out of application code and into the database. You name the table, the columns and the filters, and the permissions follow from that, not from remembering to check.

Which tools should the server offer?

Helm7's database_mcp_create takes a list of tools. Each tool has a kind, which is one of get, list, search, traverse, insert or update, plus a table, the columns it may touch, optional filters, an optional row filter and an auth mode of public or end_user. Fewer tools is better, because every tool is a description a client has to carry. For the shop we want four.

Four tools for the product catalogue example
ToolKindTable and columnsRow filterAuth
get_productgetproducts: id, sku, name, description, category, price_pencestatus = 'live'public
search_productssearchproducts: id, sku, name, description, category, price_pencestatus = 'live'public
my_reviewslistreviews: id, product_id, rating, bodyuser_id = $user.subend_user
add_reviewinsertreviews: product_id, rating, bodyuser_id = $user.subend_user

Notice what is absent. There is no tool for cost_pence or supplier, and no update or delete for products. A model cannot ask for what no tool offers. That is a better defence than telling it in a prompt not to.

How do columns and row filters keep data private?

This is the part that makes it safe to build MCP server endpoints for public use, so it is worth knowing how it works. Each database gets two login-less Postgres roles for its MCP server, one for public callers and one for signed-in users. They hold column-level grants for exactly the columns your tools name and nothing else. If cost_pence is not in any tool, the public role has no right to read it, and Postgres itself would refuse a query that tried.

Each request then runs as one transaction. It switches to the right role with SET LOCAL ROLE and sets the caller's token claims, so any row level security policies you already wrote still apply on top. Postgres documents these policies as restricting, per user, which rows normal queries can return or change. The row filter in a tool is an extra, simpler layer: a literal such as status = 'live', or a claim such as user_id = $user.sub, joined with AND.

  • Public insert or update without a row filter is refused outright.
  • On an insert, the columns named in the row filter are pinned from the caller's claims. A customer cannot write a review as somebody else.
  • Callers are rate limited to 120 requests a minute each.
  • End-user tools check the session token from your Product's managed auth before doing anything.

The claim name after $user is whatever your tokens carry. We used sub, the standard JWT subject claim, which is an assumption about your sign-in setup. Check the claim your tokens contain before you rely on it.

How to build MCP server tools in Helm7, step by step

  1. 1Write the tools down firstUse the table above. For each tool, note the kind, table, columns, filters, row filter and who may call it.
  2. 2Preview with a dry runEvery change to a database can be dry-run. Call database_mcp_create with dry_run set to true and read the plan, which is costed, before anything is created.
  3. 3Create the serverCall database_mcp_create with the tools list. You can do the same from the dashboard, the REST API, the CLI or the SDK, and the API reference has the schema.
  4. 4Copy the URLThe server answers at https://www.helm7.com/api/app-mcp/ followed by its id. It speaks Streamable HTTP with stateless JSON responses.
  5. 5Test as an anonymous callerAsk for a draft product by id and confirm you get nothing back. Ask for cost and confirm no tool offers it.
  6. 6Test as a signed-in userCall add_review with a valid session token, then my_reviews. Try to write a review for another user id and confirm the claim overrides it.

To take the server down, delete it. Its database roles are dropped straight away, so it can read nothing more, and the URL returns 404 within seconds.

How do you connect an MCP client to it?

Any client that speaks Streamable HTTP can connect, because the server is a plain URL. In Claude Code, the documented command for a remote HTTP server is claude mcp add with the http transport, a name and the URL. Replace the placeholder with your server's id.

claude mcp add --transport http shop-catalogue \
  https://www.helm7.com/api/app-mcp/<amcp_id>

claude mcp list
Add the public server, then check its health

The same entry in a project's .mcp.json needs a type of http. An entry with a url but no type is treated as a local process and skipped with an error, which catches people out.

{
  "mcpServers": {
    "shop-catalogue": {
      "type": "http",
      "url": "https://www.helm7.com/api/app-mcp/<amcp_id>"
    }
  }
}
The equivalent .mcp.json entry

For the end-user tools, the client has to send the customer's session token. Claude Code's add command accepts a --header option for an Authorization header, but whether a customer's own assistant can supply that token depends on how you issue them. Plan that flow before you promise end-user tools to customers.

What should you still watch for?

  • Public means public. Anything in a listed column of a live row is readable by anyone, including scrapers. Do not list a column you would not publish on a web page.
  • Text in your rows reaches a model. If customers write reviews, treat the text as untrusted input, the way you would any user content shown in a prompt.
  • Keep the tool list short. The more tools, the more descriptions a client carries, a cost the MCP adoption numbers post goes into.
  • This is separate from agent keys. A key that lets an agent manage your hosting is a different thing from a public catalogue server, and scoped API keys for AI agents covers it.

Helm7 is one way to do this. If you need logic beyond rows, build MCP server code with the official SDK. If you already run a hosted MCP gateway you like, point it at a read-only database role. The databases page shows the switch we offer for the table-shaped case.

Common questions

  • How do I build MCP server tools for my database?

    Either build MCP server code with an official SDK, or describe tools over your tables and let a platform serve them. In Helm7 you call database_mcp_create with tools, columns, filters, row filters and an auth mode, and you get a URL.

  • Can an MCP server be public without exposing private columns?

    Yes, if the server only has rights to the columns its tools name. Here the public role holds column-level grants, so a column no tool lists cannot be read at all, whatever a client asks for.

  • What transport does the server use?

    Streamable HTTP, with stateless JSON responses. Each request is one POST to a single URL, which any client supporting that transport can use.

  • Is there a rate limit?

    Yes. Each caller is limited to 120 requests a minute on these servers.

  • How do I remove an MCP server?

    Delete it. Its database roles are dropped straight away, so clients lose access at once, and the URL returns 404 within seconds.

Sources

  1. Model Context Protocol specification: transports (2026-07-28)
  2. Claude Code documentation: connect to MCP servers
  3. PostgreSQL documentation: row security policies

Run your entire app stack, end to end, from $12 a month.

App, Postgres, auth, storage, jobs and domains on one platform, planned and priced before anything changes.

More from the blog