SemiLayerDocs

MCP-ify anything

You point an agent at SemiLayer. The agent points SemiLayer at your data. Suddenly the database you were about to build a search box on top of just… has one. And a similarity API. And a feed.

Any database. Any table. One sentence at a time.

Three sentences, one ranked feed

Real transcript, three turns, zero clicks:

wire it up

quick_connect_lens introspected the recipes table, picked id as PK, scaffolded text fields, wired search / similar / query with public rules. Committed.

resume and add a discovery feed to this lens

resume_ingest un-paused. add_facet auto-expanded discover into a recency-ranked feed (7d half-life, 200 candidates, 12 per page, dedup on sourceRowId), auto-attached rules.feed.discover = "public" so pk_ keys can hit it. Committed both.

grab the first 5 items from that discovery feed

1. Mapo Tofu — chinese · medium · 30m
   "Silken tofu in a fiery Sichuan sauce with doubanjiang, black beans, ground pork, 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 with a sweet-savory white miso + mirin + 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."

That's it. No config file. No schema authoring. No ranking math. The agent writes what needs to be written; the two-call confirm pattern stops it from writing anything you didn't want.

Why this isn't "AI in the sidebar"

Most "AI integrations" pipe answers into a chat. This inverts it — your agent becomes a first-class writer on your intelligence layer, with your identity and your audit trail.

  • Every database is fair game. Postgres today, MySQL / SQLite / MongoDB / Neon / CockroachDB / Turso / Planetscale / DynamoDB / Firestore / ClickHouse / Redis as their bridges ship. Point the agent at any of them and the same "add a feed, explain a ranking" vocabulary works.
  • Every write is shown before it commits. Destructive tools (quick_connect_lens, add_facet, update_lens_config, rebuild_lens, invite_member, push, …) return a diff + a 15-minute confirm token on the first call. The second call commits. No accidental DROP LENS.
  • Every tool is aware of your data. When you say "add a trending feed" the agent doesn't have to guess the shape — the tool auto-scaffolds a sensible default based on the feed name (recency for latest, similarity against context.seedRecordId for related, recency + 7d decay for discover). When you add a new feed, the access rule attaches itself. When you introspect a table, field types flow straight from the real column types.
  • Cross-org, cross-project, cross-env in one session. Ask about production; pivot to staging; jump to a different org's lens — no reconfig, no re-login. Your Console session is the agent's session.
  • Same quota, same audit, same RBAC. MCP calls hit the same api.semilayer.com endpoints your CLI uses. Viewer can read; developer can push; owner can invite. What you can see in Console is what the agent can see. What you can't do in Console is what the agent can't do.

What the agent can do today

A rough shape, grouped by intent. Full catalog at MCP Tools.

Explorewhoami, get_map, list_lenses, describe_lens, list_members, status Querysearch, similar, query, feed, explain_feed (with per-record score breakdown) Buildquick_connect_lens (introspect → scaffolded lens in one turn), create_lens, update_lens_config, add_facet (auto-scaffolds feed defaults, auto-attaches access rules) Operateresume_ingest, smart_sync (non-destructive refresh), rebuild_lens (first-build + drift-recovery, with loud warning when vectors exist), pause_ingest Admininvite_member, remove_member, edit_source, push (full-env reconciliation — the explicit "config-as-code" path) Sessionset_context, get_context (so you don't repeat org/project/env every turn)

Ready?