SemiLayerDocs

Talk to your database through an agent

SemiLayer ships an MCP server. Point Claude, Cursor, or any MCP-aware agent at it and the agent can do the work you'd otherwise do in Console or the CLI — introspect a table, scaffold a lens, build a feed, run a search — in the conversation, with your login and your permissions.

You don't teach the agent anything. You add one connector.

Connect it

Add a custom connector pointed at this URL:

https://mcp.semilayer.com/mcp
💡

One OAuth consent — the same login you use for console.semilayer.com. No API keys in your agent config, no static secrets. Per-client walkthroughs (including MCP Inspector) are in MCP setup.

What it looks like

A real session against a Postgres recipes table. Three turns, zero clicks, no config file:

recipes · productionSemiLayer MCP
wire it up
quick_connect_lenscommitted
Introspected the recipes table, chose id as the primary key, flagged title / description / cuisine as searchable, and wired search / similar / query with public access rules. The first call returned a diff; the second one committed it.
resume it and add a discovery feed
resume_ingestadd_facetcommitted
Un-paused the lens, then scaffolded discover into a recency-ranked feed — 7-day half-life, 200 candidates, 12 per page — and auto-attached rules.feed.discover = "public" so pk_ keys can read it.
grab the first 5 from that feed
1
Mapo Tofu
chinese · medium · 30m
Silken tofu in a fiery Sichuan sauce with doubanjiang, fermented black beans, and peppercorns.
2
Coq au Vin
french · hard · 180m
Chicken braised in red wine with lardons, pearl onions, and mushrooms.
3
Miso-Glazed Eggplant
japanese · easy · 15m
Japanese eggplant broiled under a sweet-savory white miso, mirin, and sake glaze.
4
Shakshuka
middle eastern · easy · 25m
Eggs poached in a spiced tomato-and-pepper stew with cumin, smoked paprika, and harissa.
5
Green Curry with Tofu
thai · medium · 35m
Fragrant Thai green curry with coconut milk, crispy tofu, Thai eggplant, and basil.
Three turns. No config files. Every write shown before it committed.

You described the outcome. The agent picked the tools, drafted the config from your real schema, and showed you each change before it committed.

What you can ask it

Plain sentences. The agent maps them to the same operations the CLI exposes:

  • Explore"What lenses do I have, and which ones have a feed?"
  • Query"Find the top 5 Thai recipes in production."
  • Build"Turn the public.products table in my main-db source into a lens, search on name + description."
  • Operate"Rebuild the recipes lens — I changed the embedding model."

There are ~18 tools across explore / query / build / operate / admin. Full catalog with argument shapes: MCP tools. More copy-paste prompts: examples.

What stays true, whatever you ask

  • Your role gates everything. The agent runs as you. A viewer can read; a developer can push; an owner can invite. What you can't do in Console, the agent can't do either.
  • Every write is two-call. Mutating tools (quick_connect_lens, add_facet, rebuild_lens, invite_member, …) first return a diff plus a 15-minute confirm token. Nothing changes until a second call commits it.
  • Same quota, same audit. MCP calls hit the same api.semilayer.com your CLI uses. One rate limit, one bill, every commit in the org audit log tagged source: mcp with your user.
  • Cross-org, cross-env in one session. Ask about production, pivot to staging, jump to another org's lens — no reconfig, no re-login.

Next