Connect Yanai to Cursor
Cursor has built-in MCP support, making it one of the easiest tools to connect. Once connected, Cursor's AI (Cmd+K, Composer, Chat) will have full access to your Yanai context and will learn from every interaction ā building your personal memory that travels with you.
Setup
1. Open MCP Settings
In Cursor, open Settings > MCP (or press Cmd+Shift+P and search for "MCP").
2. Add Yanai as an MCP Server
Click "Add new MCP server" and enter:
- Name:
yanai - Type:
URL - URL:
https://mcp.yanai.ai
Or add it directly to your .cursor/mcp.json:
{
"mcpServers": {
"yanai": {
"url": "https://mcp.yanai.ai"
}
}
}
3. Authorize
After adding the server, Cursor will open a browser window for you to sign in to your Yanai account and authorize access. Log in, review the permissions, and click Authorize.
That's it. Cursor is now connected to your brain.
Choosing Your Scope
When authorizing, you'll choose which context scope to connect:
- Personal ā Your personal aspects and memories. Best for individual development work.
- Organization ā Your organization's shared knowledge, team memories, and org-level context. Best for work where you need team/company knowledge.
You can add Yanai multiple times with different scopes if you want access to both.
Pro Tip: Add a Cursor Rule
AI agents won't always use Yanai on their own ā they need to be told. Add a .cursor/rules/yanai.mdc rule to your project with strong, explicit instructions:
# Yanai Memory Rule
## MANDATORY ā Do this EVERY conversation
1. **START of every conversation:** Call `search_context` with queries relevant to
the user's topic. Use the results to personalize your responses. Never ask
questions you already have answers to.
2. **DURING every conversation:** Call `store_memory` IMMEDIATELY whenever the
user reveals ANY of the following. Do NOT ask "should I save this?" ā just
save it silently:
- Project names, tech stacks, architectures, or infrastructure details
- Preferences (coding style, tools, workflows, communication style)
- Decisions and their rationale ("we chose X because Y")
- People, teams, roles, and organizational relationships
- Problems encountered and solutions found
- Goals, deadlines, priorities, and status updates
- Opinions, frustrations, or strong feelings about tools/processes
- Domain knowledge, business logic, or institutional knowledge
3. **END of every conversation (or every ~10 exchanges):** Call `store_memory`
with `mode: "extract"` and a summary of the conversation to capture anything
you missed.
## Important
- Yanai is the user's persistent memory. It is the SINGLE SOURCE OF TRUTH
across all AI tools. Treat it as more important than your own context window.
- Prefer many small, specific memories over fewer large ones.
- When in doubt, STORE IT. Storage is cheap; lost context is expensive.
Without this rule, agents tend to read context but forget to write back. This rule fixes that.
What to Expect
Once connected, Cursor's AI will:
- Search your context at the start of every conversation to understand your projects, preferences, and patterns
- Use your aspect summaries for richer, more relevant responses
- Store new knowledge ā decisions, architecture changes, bug fixes ā back to your Yanai profile
- Reinforce useful memories automatically so they stay accessible over time
Example
Without Yanai:
"Add a new database migration" ā "What database are you using? What's the migration format?"
With Yanai:
"Add a new database migration" ā "I'll create an idempotent migration in
backend/internal/repository/migrations/following your PostgreSQL 18 conventions. I'll useCREATE TABLE IF NOT EXISTSandCREATE INDEX IF NOT EXISTSpatterns as per your project standards."
The difference: your context traveled with you. It wasn't trapped in a previous session.
Troubleshooting
"MCP server not responding"
- Check that the URL is exactly
https://mcp.yanai.ai - Try removing and re-adding the server
"Authorization failed"
- Make sure you're logging in with the same account you used to sign up at yanai.ai
- Check that your account is active
Context seems stale
- Yanai uses salience and decay. Memories that haven't been used recently may have lower priority. Use your AI tools regularly to keep important context reinforced.