Connect Cursor
Cursor connects to the gateway as a remote MCP server — one JSON block, no separate app to install. OAuth runs in the browser the first time your agent calls a tool. Cursor's own pricing page lists MCP support under its paid Individual plans (Pro, Pro+, Ultra), not among the free Hobby tier's features, so if the MCP settings described below are missing, that is the likely reason — check your plan before assuming the config is wrong.
You need an Ansvar account first — create a free one from the pricing page by signing in with Google or Microsoft, or with email; no card, no checkout. OAuth consent completes in your browser on the first tool call.
Step 1 — add the server
Cursor reads MCP servers from a JSON file at two possible scopes: a project-level .cursor/mcp.json in the repository root (available only in that project), or a global ~/.cursor/mcp.json in your home directory (available in every project you open). Add the gateway to whichever scope fits — global if you want it everywhere, project-level if you're rolling it out to one repo first:
{
"mcpServers": {
"ansvar": {
"url": "https://gateway.ansvar.eu/mcp"
}
}
}The same block works at either path — Cursor's docs describe both locations, with project config taking precedence where the same server is defined in both. Restart Cursor (or reload the window) after editing the file by hand.
Prefer a UI: Cursor Settings → MCP (labelled Tools & MCP in newer builds) → add a new server, and paste the same URL into the URL field. Cursor has renamed and moved this panel before, so the JSON file above is the steadier way in if the menu doesn't match what you see.
Step 2 — authenticate
Cursor discovers the gateway's OAuth support automatically for a server configured with only a url field: on first use it opens a browser at auth.ansvar.eu — approve the login and Cursor is authenticated. There is no client ID or secret to obtain or paste — this is Dynamic Client Registration, the same mechanism the ChatGPT and Gemini connectors use. Cursor's docs also describe a static auth block (CLIENT_ID/CLIENT_SECRET) for servers that don't support automatic discovery; the gateway does, so you don't need it.
Step 3 — check the connection
Open the MCP settings panel and confirm ansvar shows a connected status with a tool count.
Get your first cited answer
Paste one of these tasks exactly as written. Each reads one source, so it runs on every plan, Free included, and you get the law's text with a link you can open.
Paste the task into the Agent panel. Cursor's agent picks MCP tools itself, so leading with "Using Ansvar" is what makes it call the gateway instead of answering from the model.
An EU regulation article. You should get the text of Article 17 (right to erasure), linked to eur-lex.europa.eu.
Using Ansvar, retrieve GDPR Article 17 and show its official source link.A national law provision. You should get the German text of § 26 BDSG (employee data), linked to gesetze-im-internet.de.
Using Ansvar, retrieve section 26 of the German Federal Data Protection Act (BDSG) and show its official source link.NIS2 obligations for a sector. You should get the ten measures in Article 21(2), linked to eur-lex.europa.eu.
Using Ansvar, retrieve NIS2 Article 21 and list the cybersecurity measures an energy company must take. Show the official source link.DORA incident reporting for a bank. You should get the initial notification, intermediate report and final report of Article 19(4), linked to eur-lex.europa.eu.
Using Ansvar, retrieve DORA Article 19 and list the reports a bank must file after a major ICT-related incident. Show the official source link.What a good answer looks like: the text of the provision, its article or section number, and a link to the official publisher. Your client should also show a call to an Ansvar tool, usually get_provision. An answer with no tool call and no source link came from the model's memory: lead the message with "Using Ansvar" and add the routing instructions.
Instruct your agent — the routing pack
A connected agent without routing instructions can still answer legal questions from its training data — the connector sitting idle at exactly the moment it should prove itself — when a message does not name Ansvar. Add the block below as a rootAGENTS.md or an Always project rule — rules set to Manual or Auto Attached do not reach every session — or as a User Rule to carry it across projects. The block is the same set that Instruct your agent explains line by line; adapt the jurisdictions to your market.
You are a compliance research assistant. Answer legal, regulatory,
and security-standards questions only from Ansvar tool results,
never from your own knowledge.
For every legal, regulatory, or standards question:
1. Call the search tool, always with a scope: jurisdictions=["SE"]
(adapt to your market; add "EU" for EU regulation - GDPR, NIS2,
the AI Act), or frameworks=["GDPR"] for one EU framework across
the board. On the Free plan, pass exactly one jurisdiction or
framework per call.
2. Never pass the user's whole question as the query. Reduce it to
1-3 legal key terms in the language of the law you are searching
- Swedish terms for Swedish law. Try alternative terms as separate
searches. If a multi-concept query returns nothing, split it into
one search per concept.
3. If a search returns nothing, retry once with a synonym or the
corpus's own term for the concept. Whenever a response reports
withheld relaxed matches (meta.broadening_available is true, or
meta.message says so), tell the user and offer a re-run with
allow_broadening=true; re-run only if they accept, and label any
relaxed matches as such. Never set allow_broadening on your own.
If meta.recommended_scopes names scope ids you did not search,
search those next.
4. Cite every answer: law, article, and source URL from the
results. If the results do not contain the answer, say which
searches you ran and that you will not answer from memory -
never invent a source.If something breaks
- No MCP settings in Cursor at all. Check your plan — Cursor's own pricing page lists MCP under the paid plans (Pro, Pro+, Ultra), not among the free Hobby tier's features.
- The server doesn't appear after editing mcp.json by hand. A single JSON syntax error drops the whole file silently rather than just the broken entry — validate it, and check whether a project-level file and a global file both define an
ansvarentry (the project one wins). - Tools are missing or the wrong set appears. Tools outside your Ansvar tier are absent by design — see the tool reference.
- Everything else — the general troubleshooting page covers OAuth popups, quota errors, and empty results.