Skip to main content
Products -> ERDPricingDocsBlogSign in한국어Start with ERD

Cursor

Connect Cursor to AI-ERD via MCP.


Add the AI-ERD MCP server​

Cursor reads MCP server configuration from ~/.cursor/mcp.json (or the workspace-level .cursor/mcp.json):

{
"mcpServers": {
"ai-erd": {
"url": "https://ai-erd.com/mcp"
}
}
}

Restart Cursor (or reload the MCP config from settings) and Cursor will detect AI-ERD.

The first time you invoke an AI-ERD tool, Cursor opens AI-ERD's authorization page in your browser. Sign in and approve, and Cursor caches the token for subsequent calls.

Cursor's MCP support and config schema evolves — consult the Cursor MCP docs for the current version if the format above doesn't apply.


Roles per repository​

To give the sessions in a repository one role, run ai-erd init there. It writes a single ai-erd entry carrying --role into the repository's .cursor/mcp.json. Reload the MCP configuration (or reopen the window) so Cursor picks it up.

npx -y ai-erd@latest init # you, in a terminal: asks for the role and the project
npx -y ai-erd@latest init --role <role> # an agent, with the role you chose

Try it​

In Cursor's chat:

@ai-erd list my ERD documents
@ai-erd show the orders table in ERD document <uuid>

Cursor will route the request through AI-ERD and inline the results into the chat.


Tips​

  • Mention the server explicitly — Use @ai-erd (or whatever name you gave the server in mcp.json) when you want Cursor to use AI-ERD vs. its built-in tools.
  • Use UUIDs in scripted prompts - when automating with Cursor's rules or system prompts, prefer the ERD document UUID over the title to avoid ambiguity.
  • Watch the version log — Every write through Cursor creates an AI-ERD version snapshot tagged "Updated via MCP". You can roll back if Cursor makes an unwanted change.

Troubleshooting​

Cursor doesn't see the server Check ~/.cursor/mcp.json syntax (must be valid JSON), then restart Cursor.

Auth loop Clear the cached token in Cursor settings → MCP, and re-authorize.

"plan does not include MCP" MCP is a paid feature. See Plans.