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.
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.
list_sources, introspect_source, and propose_playbook via MCP.
See AGENTS.md
in anything-cli for the admin workflow.
- Turn 1 — List configured sources and introspect what is ready
- Turn 2 — Introspect a Notion Payroll database by database ID
- Turn 3 — Suggest a Postgres + Notion semantic layer playbook
- Turn 4 — Create and save
sales-compensation-notion-access
Turn 1 — List data sources
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 ID | Adapter | Status | Notes |
|---|---|---|---|
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_pgandpayroll_csv - Registered but needs setup:
salesforce_main,notion_main
Turn 2 — Inspect Notion database
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.
| Property | Notion type | Role |
|---|---|---|
| Payroll ID | title | Primary identifier |
| User | Employee user identifier | |
| Full Name | rich_text | Display name |
| Pay Period | rich_text | e.g. 2026-04 |
| Pay Date | date | Payment date |
| Gross Pay | number | Amount |
| Currency | select | e.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
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
| Entity | Source | Maps to |
|---|---|---|
crm_user | Postgres | users |
crm_account | Postgres | accounts |
crm_payroll_record | Notion | Payroll 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"
}
}
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
sales-compensation-notion-accesssales-compensation-notion-access via MCP. Playbook and
bindings are live in the reasoning service.
| Entity | Source | Maps to |
|---|---|---|
crm_user | Postgres (warehouse_pg) | users |
crm_account | Postgres | accounts |
payroll_record | Notion (notion_main) | Payroll DB |
| Binding file | Source |
|---|---|
sales-compensation-notion-access.postgres | warehouse_pg |
sales-compensation-notion-access.notion | Notion 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
| # | Tool | Used in this session |
|---|---|---|
| 1 | list_sources | Discover profile source keys |
| 2 | introspect_source | CSV schema + Notion database (with schema_name) |
| 3 | propose_playbook | Validate semantic layer design |
| 4 | save_playbook | Persist sales-compensation-notion-access |
| 5 | propose_binding / save_binding | Postgres + Notion bindings |
| 6 | query_graph | Federated queries once bindings are tested |
Notion introspection: Documentation · Claude payroll tutorial