What this walkthrough covers

Enterprise teams store data everywhere — relational warehouses, spreadsheets, SaaS tools like Notion and Salesforce — and each silo speaks a different language. Before an agent can answer a business question, it needs to know what exists and how it connects. AnythingGraph solves that with a thin reasoning layer: one MCP server (anythinggraph-thin on port 3334) that lists profile sources, introspects live schema read-only, and maps silos into governed playbooks — no ETL, no data movement.

Yoda meme: If into the data silos you go, only pain will you find
Siloed CRM, payroll, and SaaS data — the pain AnythingGraph MCP is built to solve.

In this session we connected Cursor, asked what sources are available, inspected a Notion payroll database, and designed a federated Postgres + Notion semantic layer ending in sales-compensation-notion-access.

Use MCP tools, not curl: Agents should call list_sources, introspect_source, and propose_playbook via MCP. See AGENTS.md in anything-cli for the admin workflow.
  1. Turn 1 — List configured sources and introspect what is ready
  2. Turn 2 — Introspect a Notion Payroll database by database ID
  3. Turn 3 — Suggest a Postgres + Notion semantic layer playbook
  4. Turn 4 — Create and save sales-compensation-notion-access

Turn 1 — List data sources

Cursor Turn 1 · list_sources
You
Using AnythingGraph MCP, please tell me what data sources are available.
MCP tool
list_sources() → introspect_source(...) per source
Cursor

Checking the AnythingGraph MCP configuration, then querying available sources.

Queried anythinggraph-thin with list_sources, then ran introspect_source where possible. The server exposes 4 data sources.

Source IDAdapterStatusNotes
warehouse_pg SQL (Postgres) Ready — DSN configured CRM warehouse. Used by crm-payroll-access and simple-crm-access for users and accounts.
payroll_csv CSV Ready File-backed payroll data (payroll.csv).
salesforce_main SOQL Not configured Missing instance_url in profile.
notion_main Notion Registered Uses auth token — not DSN. Introspect with schema_name = Notion database ID.

payroll_csv introspection

  • File: payroll.csv (3 rows)
  • Columns: payroll_id, user, full_name, pay_period, pay_date, gross_pay, currency

Summary

  • Ready to query: warehouse_pg and payroll_csv
  • Registered but needs setup: salesforce_main, notion_main

Turn 2 — Inspect Notion database

Cursor Turn 2 · introspect_source
You
Here is my Notion database — Payroll database. Please check what data I have.
MCP tool
introspect_source({ source_id: "notion_main", schema_name: "d2f81b18cde0483b9b1af366944d1678" })
Cursor

Introspecting your Notion database via MCP using the ID from that URL.

Extracted database ID d2f81b18cde0483b9b1af366944d1678. Connection works — live schema returned. Row-level queries need binding fixes before MCP can list individual records.

PropertyNotion typeRole
Payroll IDtitlePrimary identifier
UseremailEmployee user identifier
Full Namerich_textDisplay name
Pay Periodrich_texte.g. 2026-04
Pay DatedatePayment date
Gross PaynumberAmount
Currencyselecte.g. USD

This mirrors the local payroll_csv structure. A binding crm-payroll-access.notion already exists but the playbook still routes payroll to CSV by default.

Turn 3 — Suggest a semantic layer playbook

Cursor Turn 3 · propose_playbook
You
I want to create a semantic layer using my CRM data in Postgres and payroll data in Notion — can you suggest what playbook I can create?
Cursor

Reviewing existing playbooks and source schemas for a Postgres + Notion design.

Recommended: crm-payroll-notion-access — same pattern as crm-payroll-access but payroll routed to Notion. Validated with propose_playbook.

Semantic model

flowchart LR
  subgraph Postgres["warehouse_pg"]
    U[users]
    A[accounts]
    U -->|owner_user_id| A
  end
  subgraph Notion["notion_main — Payroll DB"]
    P[Payroll pages]
  end
  subgraph Playbook["crm-payroll-notion-access"]
    CU[crm_user]
    CA[crm_account]
    CP[crm_payroll_record]
    CU -->|owns_account| CA
    CU -->|user_has_payroll| CP
  end
  U -.-> CU
  A -.-> CA
  P -.-> CP
              
EntitySourceMaps to
crm_userPostgresusers
crm_accountPostgresaccounts
crm_payroll_recordNotionPayroll DB properties

Proposed playbook JSON (excerpt)

{
  "id": "crm-payroll-notion-access",
  "name": "CRM + Notion payroll access",
  "entities": {
    "crm_user": { "id": "user_id", "fields": ["full_name"] },
    "crm_account": { "id": "account_name", "fields": ["industry"] },
    "crm_payroll_record": {
      "id": "payroll_id",
      "fields": ["user_id", "pay_period", "gross_pay", "currency", "pay_date"]
    }
  },
  "relationships": {
    "owns_account": { "from": "crm_user", "to": "crm_account" },
    "user_has_payroll": { "from": "crm_user", "to": "crm_payroll_record" }
  },
  "sources": {
    "crm_user": "postgres",
    "crm_account": "postgres",
    "crm_payroll_record": "notion"
  }
}
Join key: Postgres user_id values (e.g. alex.ae) must align with Notion User (typed as email). Mismatched keys mean payroll rows will not join to CRM users.

Turn 4 — Create the playbook

Cursor Turn 4 · save_playbook
You
Create playbook called sales-compensation-notion-access
MCP tools
propose_playbook() → save_playbook() → propose_binding() → save_binding()
Cursor · completed
Created sales-compensation-notion-access via MCP. Playbook and bindings are live in the reasoning service.
EntitySourceMaps to
crm_userPostgres (warehouse_pg)users
crm_accountPostgresaccounts
payroll_recordNotion (notion_main)Payroll DB
Binding fileSource
sales-compensation-notion-access.postgreswarehouse_pg
sales-compensation-notion-access.notionNotion Payroll database

Example query — count owned accounts

{
  "playbook_id": "sales-compensation-notion-access",
  "entity": "crm_user",
  "by_name": "Alex Anderson",
  "count_relationship": "owns_account"
}

MCP tool checklist

#ToolUsed in this session
1list_sourcesDiscover profile source keys
2introspect_sourceCSV schema + Notion database (with schema_name)
3propose_playbookValidate semantic layer design
4save_playbookPersist sales-compensation-notion-access
5propose_binding / save_bindingPostgres + Notion bindings
6query_graphFederated queries once bindings are tested

Notion introspection: Documentation · Claude payroll tutorial

Connect Cursor to your sources

Clone anything-cli, set AG_NOTION_TOKEN and Postgres credentials, connect MCP in Cursor, and let the agent map your first federated playbook.