Lesson notes
How it works
How Cursor learns Memberstack
Cursor's AI answers from what it already knows unless you give it project context. For Memberstack, that means it can guess at method names. The Memberstack AI docs package fixes this by writing the official docs into your project and adding a rules file that tells Cursor to use them.
This is the same package as the Claude Code lesson, with a different target. If you use both tools, npx memberstack-ai-docs --ai all sets up Claude Code, Cursor and Codex at once.
How to set up the Memberstack docs in Cursor
Open your project folder in Cursor first. An empty folder is fine.
- Open a new terminal in Cursor.
- Run
npx memberstack-ai-docs --ai cursor. - Check the file tree: you should see a
.cursorrulesfile and a.memberstack/folder. - Open Cursor's chat and ask "How do I log in a member?"
- Check that the answer uses Memberstack's real methods.
What the files do
.cursorrules holds the Memberstack instructions for Cursor. If the file already exists, the installer adds a marked Memberstack section rather than replacing your rules. The .memberstack/ folder holds the documentation itself in complete.md, index.json and quickref.md, so Cursor can look up the right method instead of inventing one.
What a good answer looks like
A correct answer starts with initialising Memberstack, memberstackDOM.init({ publicKey: "YOUR_PUBLIC_KEY" }), then covers the login options: loginMemberEmailPassword for email and password, loginWithProvider for social login, and sendMemberLoginPasswordlessEmail plus loginMemberPasswordless for passwordless. It may also mention the pre-built modals, opened with openModal, and onAuthChange, which runs your code whenever a member logs in or out.
Simple questions are only the test. Once it works, ask Cursor to do the job: "Set up my login form" or "Set up my signup form", and it builds them with the correct methods.