How to use Cursor
AI-first code editor. Below: 3 workflows, each with the steps and prompt.
Cursor MCP: connect your first MCP servers
Create a .cursor/mcp.json in the project (or use Cursor Settings > MCP), add each server as a command-plus-args entry, restart Cursor and wait for the tools to show as connected. Start with a read-only server, approve tools one by one, and put secrets in environment variables, never in the JSON. Share the file via git so the team gets the same setup.
- Open the MCP settings
- Add a read-only server first
- Confirm the tools appear
- Smoke-test with a harmless call
- Gate write tools
- Commit the project config
Cursor rules: a .cursor/rules setup that keeps the agent consistent in your repo
Create .cursor/rules/ in your repo with a few short .mdc rule files: one always-applied core rule (stack, commands, conventions), scoped rules attached to file globs (e.g. **/*.tsx for UI conventions), and agent-requested rules for rare tasks like migrations. Keep each rule short and concrete, commit them, and test with a prompt that would break a rule if it weren't loaded.
- Collect what you keep repeating
- Create the core rule
- Add scoped rules
- Add on-demand rules
- Test that rules load
- Commit and maintain
Playwright MCP: set it up and have Claude Code test your web app
Add Microsoft's Playwright MCP server to your agent (for Claude Code: claude mcp add playwright npx @playwright/mcp@latest), point it at a local or staging URL, and ask it to walk a user flow step by step. It drives a real browser through accessibility snapshots, reports what broke, and can then write a regular Playwright test so the check runs in CI without the agent.
- Add the server to your agent
- Choose headed or headless
- Start your app and write the flow down
- Ask for a walkthrough, not a fix
- Check the evidence
- Fix, then re-run the same flow
- Turn it into a real test