MCP Server Setup
Connect Claude Desktop, Cursor, Windsurf, or any MCP-compatible client to your NUDG3 workspace or agency portfolio
MCP Server Setup
The NUDG3 MCP (Model Context Protocol) server lets you query your workspace data from any MCP-compatible AI client. Once connected, the client can pull visibility metrics, run competitive analysis, fetch boosters, and trace citations — without leaving the chat.
Current version: 1.1.0 (released 2026-05-31) — adds agency portfolio support. Single-brand customers see no change. Agencies and multi-workspace customers can issue one key that addresses every workspace in their portfolio. See API key personas below.
NUDG3 is published two ways:
nudg3-mcpon PyPI — the stdio package (uvx nudg3-mcp/pip install nudg3-mcp), used by every desktop/editor MCP client today.- Hosted Streamable HTTP at
https://mcp.nudg3.ai/mcp— the same tools, served over HTTPS for clients (and bridges) that prefer remote.
Pick the path that matches your client:
| You're using... | Use this | Setup complexity |
|---|---|---|
| Cursor | Hosted via headers.Authorization in mcp.json | Edit one JSON file |
| Windsurf | Hosted via headers in MCP config | Edit one JSON file |
| Claude Desktop | Hosted via the mcp-remote bridge in claude_desktop_config.json | Edit one JSON file + Node.js installed |
| Claude Desktop (alternative) | Stdio direct via uvx nudg3-mcp | Edit one JSON file + uv installed |
Browser-based one-click connectors (claude.ai web, ChatGPT) require OAuth, which the NUDG3 MCP server does not yet expose. Anthropic and OpenAI's custom-connector dialogs accept only OAuth (client_id / client_secret) — not static Bearer tokens. NUDG3's OAuth support is on the roadmap; until then, use one of the config-file paths above.
What you get
Eleven composable investigation tools, callable from your AI client:
| Tool | What it does |
|---|---|
get_metric_catalog | Static catalog of available metrics + definitions |
list_workspaces | New in 1.1.0. Portfolio discovery for agency keys. Workspace-scoped keys see a single-element list. |
get_overview | Compact health snapshot — organic + branded visibility, trends, alerts |
analyze_competitors | Organic-only competitive rankings, position gaps, movers |
analyze_prompts | Prompt-level performance grouped by funnel stage; flags underperformers |
analyze_sources | Top cited domains, type distribution, content gaps |
analyze_responses | Provider-grouped response samples with sentiment + co-mentions |
export_data | CSV export for BI/spreadsheet workflows (1MB cap with auto-narrow guidance) |
get_reports | List/detail/latest visibility audit reports + executive summaries |
get_insights | Boosters, threats, quick wins, prompt edits, content recommendations |
get_actions | Workspace action pipeline state by status, priority, team |
These are composable — your AI client chains them to answer complex questions. Ask Claude "how am I doing on retirement queries vs Capitec" and it will call analyze_competitors + analyze_prompts and reason over the combined output.
Every tool that returns workspace data (everything except get_metric_catalog and list_workspaces) accepts an optional workspace_id parameter — required only for agency-scoped keys that authorise more than one workspace. See API key personas.
Prerequisites
- An active NUDG3 workspace (or agency).
- An API key with
read:analyticsandread:insightsscopes — generate atapp.nudg3.ai/api-keys. - Your client of choice (Claude Desktop, Cursor, or Windsurf).
Each client adds one tool-specific dependency — noted below.
API key personas
Since 1.1.0, the MCP server supports two key scopes. The MCP behaviour depends on which you hold:
| Scope | Who it's for | Authorises | MCP behaviour |
|---|---|---|---|
| Workspace | Single-brand customers | One specific workspace | All tools just work. Pass nothing extra. list_workspaces returns that one workspace. |
| Agency | Agencies managing multiple clients | Every workspace across every company in your agency | Call list_workspaces first to discover the portfolio. If only one workspace is accessible the client auto-resolves; otherwise pass workspace_id on each subsequent tool call. |
Most customers (single brand, one workspace) want a workspace-scoped key. Agencies managing multiple clients want one agency-scoped key — the "service account" pattern — instead of N workspace keys to rotate separately.
Agency-scoped keys are powerful. One key can read every workspace under your agency, including workspaces added in the future. Store them in a secret manager, restrict by IP if possible, and rotate every 90 days (the default expiration). See Governance below.
Generating your API key
Workspace key (single-workspace customers, recommended for personal use)
- Open
app.nudg3.ai/api-keys. - Confirm the workspace switcher (top-left) is on the workspace you want this key for.
- Click
Create API key. - Tick scopes:
read:analyticsandread:insights. - Name it (e.g.,
Claude Desktop). - Copy the key immediately — it's shown once, then you only see the prefix.
The key inherits the workspace's binding — no further configuration needed in the MCP client.
Agency key (multi-client / multi-workspace, agency admins only)
Only users with the agency admin role (or super-user role) can mint agency-scoped keys. The dashboard surfaces this option when you have the appropriate role. The flow:
- Open
app.nudg3.ai/api-keys. - Switch to the Agency keys tab.
- Confirm the portfolio preview — the dialog lists every workspace this key will be able to access.
- Click
Create agency key. - Name it (e.g.,
BI tooling production). - Tick scopes:
read:analyticsandread:insights. - Optionally restrict by IP (CIDR list — strongly recommended for production tooling).
- Default expiration is 90 days (vs 365 for workspace keys); we recommend keeping it.
- Confirm the blast-radius checkbox and submit.
- Copy the key immediately. Store it in your secrets manager, not in source control.
Agency keys begin with nudg3_live_aak_ (note the aak) — workspace keys begin with nudg3_live_ak_. The third underscore position tells you the scope at a glance.
Distribution
| Channel | Identifier |
|---|---|
| PyPI | nudg3-mcp |
| MCP Registry | ai.nudg3/brand-intelligence |
| Hosted endpoint | https://mcp.nudg3.ai/mcp |
The stdio package and the hosted endpoint serve the same 11 tools backed by the same backend. Stdio runs in your client process; hosted runs on NUDG3's infrastructure.
Claude Desktop
Claude Desktop is configured via a JSON config file. The desktop app's Settings → Connectors UI does not yet accept static Bearer-token authentication for arbitrary remote MCP servers — that path needs OAuth. Until OAuth ships, use one of the two config-file routes below.
Route A: Hosted via mcp-remote bridge (recommended)
mcp-remote is a tiny npm package that wraps any remote MCP server as a stdio process, with full support for --header injection. This is the lightest-touch way to use the hosted endpoint from Claude Desktop.
Prerequisite: Node.js 18+ installed locally (node --version to verify).
-
Open the config file. Easiest way:
- In Claude Desktop:
Settings(Cmd-, on macOS / Ctrl-, on Windows) → Developer in the left sidebar → click Edit Config. Claude Desktop opens the file in your default text editor and creates it if it doesn't exist yet. Use this — it's the path Anthropic supports.
If you must open it from a terminal instead (mind the spaces in the path — they need quoting):
- macOS:
open -a TextEdit "$HOME/Library/Application Support/Claude/claude_desktop_config.json"- If the file doesn't exist yet, create it first:
mkdir -p "$HOME/Library/Application Support/Claude" && echo '{}' > "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
- If the file doesn't exist yet, create it first:
- Windows (PowerShell):
notepad "$env:APPDATA\Claude\claude_desktop_config.json"- If missing:
New-Item -ItemType Directory -Force "$env:APPDATA\Claude" | Out-Null; Set-Content "$env:APPDATA\Claude\claude_desktop_config.json" '{}'
- If missing:
- Linux:
xdg-open "$HOME/.config/Claude/claude_desktop_config.json"
- In Claude Desktop:
-
Add the NUDG3 entry:
-
Replace
nudg3_live_ak_...with the key fromapp.nudg3.ai/api-keys. -
Restart Claude Desktop — fully quit (Cmd-Q / right-click → quit) and relaunch. MCP servers load at startup; closing the window isn't enough.
-
Confirm: click the 🔨 icon in the chat composer — you should see the 10 NUDG3 tools.
-
Try it: ask "Pull my NUDG3 visibility overview for this week". Claude calls
get_overview, asks permission, returns results.
mcp-remote is fetched on-demand by npx; no global install needed. Restart your client after any header/URL change.
Using an agency key here? Start the chat with "List my workspaces" — Claude calls list_workspaces, you pick one, then every follow-up question is auto-targeted at that workspace for the session. If your agency has only one workspace right now, the client auto-resolves and you can skip the discovery step.
Route B: Stdio direct via uvx nudg3-mcp
If you prefer a Python-based bridge (or don't have Node.js installed), use the stdio package directly.
Prerequisite: uv installed locally:
- macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh - Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" - Alternative:
pip install nudg3-mcpand usepython -m nudg3_mcpinstead ofuvx nudg3-mcp.
Config (same file as above):
Restart Claude Desktop. Confirm via the 🔨 icon.
NUDG3_API_URL defaults to https://api.nudg3.ai — don't set it unless pointing at a non-prod environment.
Cursor
Cursor supports both stdio and Streamable HTTP MCP servers natively, and accepts a custom Authorization header for the latter. Use the hosted endpoint directly.
Cursor → Settings → MCP → Add Server. Or edit ~/.cursor/mcp.json:
Restart Cursor. The 10 tools appear in the agent panel.
For added security, reference an environment variable instead of inlining the key:
Windsurf
Same shape as Cursor. Path: ~/.codeium/windsurf/mcp_config.json (verify per your Windsurf version).
If your Windsurf build doesn't support the url / headers fields yet, fall back to the same stdio pattern as Claude Desktop Route B (uvx nudg3-mcp + NUDG3_API_KEY env var).
claude.ai web and ChatGPT (not yet)
Both platforms have UI dialogs to add custom MCP servers, but their auth fields only accept OAuth client_id / client_secret — no static Bearer token / custom header option. The NUDG3 MCP server uses Bearer auth (your existing API key), so the direct paste-the-URL flow does not work yet.
Workarounds:
- Use one of the config-file paths above on a desktop client (Claude Desktop, Cursor, Windsurf).
- Use the NUDG3 REST API via ChatGPT custom GPT actions if you specifically need ChatGPT.
Both browser connectors will work with NUDG3 once OAuth support ships.
What to ask once connected
| Query | Tools called |
|---|---|
| "Which workspaces does my NUDG3 key see?" | list_workspaces |
| "Pull my NUDG3 visibility for this week" | get_overview |
| "Switch to the [client X] workspace, then pull this week's visibility" (agency keys) | list_workspaces → get_overview with workspace_id |
| "Compare my brand to competitors across providers" | analyze_competitors + analyze_prompts |
| "Which NUDG3 prompts are underperforming?" | analyze_prompts (auto-resolves brand) |
| "Show me my top citation sources" | analyze_sources |
| "Pull the latest NUDG3 boosters" | get_insights |
| "What NUDG3 actions are open this week?" | get_actions filtered by status |
| "Export this month's mention data as CSV" | export_data |
| "Show me cross-client visibility — go through each workspace" (agency keys) | list_workspaces, then get_overview per workspace_id |
Governance
The MCP server inherits everything that protects the REST API:
- Tenant-isolated — workspace-scoped keys see one workspace. Agency-scoped keys see their portfolio only; cross-scope requests return
403 WORKSPACE_ACCESS_DENIED. Resolution is enforced at the backend, not by the MCP client, so a compromised client can't escalate. - Audit-logged — every tool call recorded with timestamp + resolved workspace + tool name +
X-Client-Type: mcpheader. For agency keys, the audit log shows the resolved workspace per call, so you can see which clients the key actually queried. - Scope-restricted — the API key's scopes limit which tools work (
read:analyticsfor overview/competitors/prompts/sources/responses/exports,read:insightsfor reports/insights/actions,export:datafor CSV export). - Rate-limited — same 3-tier sliding window as the REST API (Starter 30/min, Professional 120/min, Enterprise 600/min). For agency keys the limit is per-key, not per-workspace; if you have a noisy BI workload, consider one agency key per major workflow rather than sharing one.
- Brute-force protected — 10 failed auth attempts in 5 minutes triggers a 15-minute lockout from your IP. The hosted endpoint forwards the original client IP via
X-Forwarded-Forso the lockout tracks per real user, not per shared Cloud Run NAT. - Read-only in v1 — no write operations exposed to the AI client.
- TLS everywhere — hosted endpoint served via Cloudflare with always-on HTTPS.
- IP allow-list (agency keys) — agency-scoped keys accept an optional
allowed_ips(CIDR list) at creation. Requests from outside the allow-list are rejected before the scope check runs. Use this for production tooling.
For enterprise customers, this is the compliance answer that unlocks AI council approval — your team can use Claude/Cursor with NUDG3 data because it's wired through a governed MCP server with audit logs and tenant isolation.
Agency-key security checklist
If you're issuing agency-scoped keys, treat them with the same care as a service-account credential:
- Store the secret in a managed vault (1Password, AWS Secrets Manager, GCP Secret Manager, Vault) — never in source control.
- Enable
allowed_ipsif the consumer runs on stable infrastructure. - Default expiration is 90 days. Set a calendar rotation reminder; rotation is one new-key-mint + one revoke.
- Use one key per integration, not one key for "everything". Revoke surgically when a tool is decommissioned.
- Audit usage monthly via the dashboard — look for unfamiliar
last_used_ipvalues or new workspace IDs being queried. - Revoke immediately on departure of any employee with access.
Troubleshooting
Tools don't appear after restart: check claude_desktop_config.json (or mcp.json) is valid JSON. A trailing comma anywhere will silently break MCP loading. Paste it into a JSON linter if unsure.
uvx or npx not found: install the corresponding runtime. uvx ships with uv (see prerequisites). npx ships with Node.js. If your environment uses pnpm, swap npx for pnpm dlx.
Hosted (mcp-remote bridge or direct HTTP)
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized on every tool call | API key expired, rotated, missing scope, or wrong syntax | Generate a new key with read:analytics + read:insights. Verify the header value is Bearer (space-separated) + key. |
mcp-remote exits with "Unsupported transport" | Older mcp-remote version | npx -y mcp-remote@latest ... to force the newest. |
| Tools work but data is empty | Workspace-scoped key issued in a different workspace | Confirm the key was issued in the workspace you want to query — or upgrade to an agency-scoped key and pick the workspace via list_workspaces. |
WORKSPACE_ID_REQUIRED returned | Agency key with more than one workspace and no explicit workspace_id | Call list_workspaces, pick a workspace, pass workspace_id to the next tool. The error payload includes the full portfolio inline so your AI client can offer the choices directly. |
WORKSPACE_ACCESS_DENIED returned | Agency key asked for a workspace outside its scope | Verify the workspace is in your portfolio (list_workspaces). Workspace-scoped keys can't escalate this way — the backend resolver fails closed. |
INVALID_WORKSPACE_ID returned | Supplied workspace_id is not a valid UUID | Re-fetch via list_workspaces — IDs in that response are guaranteed canonical. |
Rate limit exceeded | Tier per-minute cap | Wait, reduce parallel calls, or upgrade plan tier. For agency keys: consider one key per integration to avoid shared-quota throttling. |
Too many failed authentication attempts | Brute-force lockout from bad-key submissions | Wait 15 minutes; rotate the key if stale. |
| Cold-start delay 2-5 seconds on first call | Cloud Run scales to zero when idle | Acceptable in early use. We bump min-instances to 1 as usage grows. |
Stdio (uvx nudg3-mcp)
| Symptom | Cause | Fix |
|---|---|---|
analyze_prompts asks for a brand UUID | Old cached version | uvx --refresh nudg3-mcp then restart your client. |
Tools don't expose list_workspaces or workspace_id parameter | Cached nudg3-mcp < 1.1.0 | uvx --refresh nudg3-mcp to pull 1.1.0+ from PyPI, then restart your client. |
| Agency key works in one tool but not the next | The 1.1.0 client caches the resolved workspace per NudgClient instance — restarting the MCP client clears it | If you intentionally switched workspace, restart the client or pass workspace_id explicitly on the next call. |
| Export returns "narrowing required" | Time range too wide, hits 1MB MCP response cap | Narrow date_from/date_to or use the dashboard CSV export. |
read:insights scope missing on a key created before 2026-04-04 | Pre-shipping API key | Regenerate the key. |