{"slug": "cursorfy-recursive-cursor-sdk-and-fastapi-dashboard-that-sees-itself", "title": "Cursorfy – recursive Cursor SDK and FastAPI dashboard that sees itself", "summary": "Cursorfy launched a recursive, self-aware dashboard built on the Cursor SDK and FastAPI that reads, queries, and edits its own source code when users ask for changes. The tool scaffolds full data dashboards from any folder of files, computes real aggregates and findings, then allows users to request redesigns or new charts through an in-app chat agent that directly edits the application code.", "body_md": "A recursive, self-aware dashboard built on the [Cursor SDK](https://cursor.com/docs/sdk/python)\nand FastAPI.\n\nThe app reads its own source code, queries its own data, and edits itself when you ask it to.\n\n``` python\nfrom fastapi import FastAPI\nimport cursorfy\n\napp = FastAPI()\ncursorfy.mount(app)\n<script defer src=\"/cursorfy/static/chat.js\"></script>\n```\n\nAn `[ ASK ]`\n\nbutton appears in lower right corner. Users ask questions about the data, ask how the app works, or ask for changes. The agent reads `app.py`\n\n, queries\nthe data, edits the file, and tells the user to refresh.\n\nAsk for a redesign and the agent edits `app.py`\n\n. Refresh, the dashboard changes.\n\n```\nuv add cursorfy   # or: pip install cursorfy\nexport CURSOR_API_KEY=crsr_...   # https://cursor.com/dashboard/integrations\n```\n\n`.env`\n\nin the project root is loaded automatically.\n\nPoint it at any folder of data and get a working dashboard:\n\n``` bash\n$ ls\nyellow_taxi_2026_03.parquet  taxi_zones.csv\n\n$ cursorfy init\n[cursorfy] scaffolding dashboard in . (model=composer-2.5)…\n[cursorfy] done in 42.4s\n[cursorfy] agent: Built dashboard: Manhattan accounts for 86% of yellow\n                  taxi pickups in March 2026; airport runs earn 3× the\n                  street fare — 2 charts + sortable zone leaderboard\n                  from yellow_taxi_2026_03.parquet (5,000 trips) joined\n                  to taxi_zones.csv (265 zones).\n\n$ uvicorn app:app --port 8086\n```\n\nThe scaffolder reads every file, joins fact tables to dimension tables when they coexist, computes real aggregates, and picks the strongest finding before writing a line of code. The page leads with the finding, four KPI tiles, two or three Tufte-correct charts, and a sortable leaderboard. Theme inherits the cursorfy CSS variables. The agent then has full context for follow-up edits.\n\nIterate from the chat: \"add a histogram of tip_pct\", \"color the bars by\nborough\", \"drop the last chart\". The agent edits `app.py`\n\n; you refresh.\n\nSix dashboards ship in `examples/`\n\n, each scaffolded by the same `cursorfy init`\n\nprompt over a different real, public dataset. Click a tile to jump to its\nsource.\n\n```\ngit clone https://github.com/crowdcent/cursorfy\ncd cursorfy\nuv pip install -e \".[examples]\"\nexport CURSOR_API_KEY=crsr_...\n```\n\n|\n|\n\n[Top GitHub repos](https://github.com/crowdcent/cursorfy/tree/master/examples/github/)The 30 most-starred OSS repos, via the live GitHub Search API.\n\n[S&P 500](https://github.com/crowdcent/cursorfy/tree/master/examples/sp500/)Five years of daily close plus the top SPY holdings.\n\n[Global CO 2 emissions](https://github.com/crowdcent/cursorfy/tree/master/examples/co2/)\n\nOur World in Data, 2000–2024. China overtook the US in 2006.\n\n[Olympic medals](https://github.com/crowdcent/cursorfy/tree/master/examples/olympics/)Rio 2016, Tokyo 2020, Paris 2024. US and China tied at 40 gold.\n\n[MovieLens](https://github.com/crowdcent/cursorfy/tree/master/examples/movies/)Four CSVs joined in polars. 30,000 ratings, 610 users.\n\nEach example boots on its own port (see the docstring at the top of its\n`app.py`\n\n). Each ships an `AGENTS.md`\n\nwith the data schema, the findings worth\nreferencing, common questions, and the chart conventions. The chat agent\nreads that file on every session.\n\n``` python\nfrom fastapi import FastAPI\nfrom fastapi.responses import HTMLResponse\nimport cursorfy\n\napp = FastAPI()\ncursorfy.mount(app)              # POST /api/chat + /cursorfy/static/*\n\n@app.get(\"/\", response_class=HTMLResponse)\ndef index():\n    return \"\"\"<!DOCTYPE html>\n    <html><body>\n      <h1>My dashboard</h1>\n      <script defer src=\"/cursorfy/static/chat.js\"></script>\n    </body></html>\"\"\"\nuvicorn app:app --reload\n```\n\n`mount()`\n\nadds one POST route and one static-files mount. It does not touch\nyour existing routes, middleware, or templates. The agent's working directory\ndefaults to the caller's file directory.\n\nThree ways to wire it up:\n\n``` python\ncursorfy.mount(app)\n@cursorfy.enable\ndef create_app(): return FastAPI()\napp = cursorfy.attach(FastAPI())\n```\n\nAll take the same kwargs (`cwd`\n\n, `model`\n\n, `valid_models`\n\n, `preamble`\n\n,\n`api_key`\n\n, `prefix`\n\n, `static_path`\n\n). See [AGENTS.md](/crowdcent/cursorfy/blob/master/AGENTS.md#api) for\ndefaults and descriptions.\n\n- The full project directory via standard Cursor tools (\n`read_file`\n\n,`grep`\n\n,`terminal`\n\n,`edit_file`\n\n, etc). Format doesn't matter — CSV, parquet, JSON, sqlite, Excel. For SQL across mixed formats the agent uses DuckDB. It also sees`app.py`\n\nitself, so it can explain how anything on the page was built. - Any SQL database whose URL you export as\n`CURSORFY_DB_<NAME>`\n\nin`.env`\n\n(Postgres, MySQL, Snowflake, BigQuery, etc.). Cursorfy lists each one in the agent's preamble; the agent picks the driver (`uv add sqlalchemy psycopg[binary]`\n\n) and queries it with sqlalchemy + polars or DuckDB ATTACH. Passwords are masked in the preamble. Read-only by default. - A screenshot of the page the user is looking at, captured client-side and\nattached as an image. The agent sees the actual dashboard, not just the\ntext prompt. Opt out with\n`data-screenshot=\"false\"`\n\non the script tag. `AGENTS.md`\n\nat the project root, appended to the system prompt in full. Put project-specific rules, data descriptions, and chart conventions here. The scaffolder writes one for you.\n\n```\n# .env\nCURSOR_API_KEY=crsr_...\nCURSORFY_DB_USERS=postgresql://user:pass@localhost:5432/users\nCURSORFY_DB_WAREHOUSE=snowflake://user:pass@account/analytics\n<script defer src=\"/cursorfy/static/chat.js\"\n        data-endpoint=\"/api/chat\"\n        data-title=\"Ask the data\"\n        data-model=\"composer-2.5\"\n        data-models=\"auto,composer-2.5,claude-opus-4-7\"\n        data-theme=\"auto\"\n        data-screenshot=\"true\"\n        data-starters='[\"What columns are here?\", \"Plot Y over time\"]'></script>\n```\n\n`data-theme`\n\n: `auto`\n\n(default, follows OS), `dark`\n\n, or `light`\n\n.\n`data-screenshot`\n\n: `true`\n\nby default; `\"false\"`\n\nskips the capture.\n\nBuilt-in light and dark modes — follows `prefers-color-scheme`\n\nautomatically\nand the floating `T`\n\ntoggle lets users flip on demand. Override the eight\n`--cursorfy-*`\n\nCSS variables in your own stylesheet to retheme everything;\nevery tint, border, and hover state is derived via `color-mix()`\n\n, so\nchanging one accent color cascades. See [AGENTS.md](/crowdcent/cursorfy/blob/master/AGENTS.md#theming) for\nthe variable list.\n\n`/api/chat`\n\nis unauthenticated by default. The agent it spawns has full shell + read/write access to the project directory. Treat the endpoint as privileged: bind uvicorn to`--host 127.0.0.1`\n\nfor local dev, and put it behind your own auth (reverse proxy, FastAPI dependency, etc.) before exposing it publicly.- The agent has read/write access to your project directory. Don't deploy it next to secrets. Use a service account that owns just the dashboard.\n- Set\n`CURSOR_API_KEY`\n\nvia your platform's secret manager. Never commit it. - First message in a new session takes 2-5s (agent cold start). Follow-ups resume the agent and are faster.\n- Each session holds one agent process. Default cap is 50. Override with\n`cursorfy.mount(app, max_sessions=...)`\n\n.\n\nMIT. See [LICENSE](/crowdcent/cursorfy/blob/master/LICENSE).\n\nBuilt on the [Cursor SDK](https://cursor.com/docs/sdk/python) by\n[Cursor](https://cursor.com), at [CrowdCent](https://crowdcent.com).\n\nIf you think this README could be better, `cursorfy init`\n\nin this repo and\nask the agent to rewrite it.", "url": "https://wpnews.pro/news/cursorfy-recursive-cursor-sdk-and-fastapi-dashboard-that-sees-itself", "canonical_source": "https://github.com/crowdcent/cursorfy", "published_at": "2026-05-27 00:02:42+00:00", "updated_at": "2026-05-27 00:40:25.230172+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "ai-products"], "entities": ["Cursor SDK", "FastAPI", "Cursorfy"], "alternates": {"html": "https://wpnews.pro/news/cursorfy-recursive-cursor-sdk-and-fastapi-dashboard-that-sees-itself", "markdown": "https://wpnews.pro/news/cursorfy-recursive-cursor-sdk-and-fastapi-dashboard-that-sees-itself.md", "text": "https://wpnews.pro/news/cursorfy-recursive-cursor-sdk-and-fastapi-dashboard-that-sees-itself.txt", "jsonld": "https://wpnews.pro/news/cursorfy-recursive-cursor-sdk-and-fastapi-dashboard-that-sees-itself.jsonld"}}