Skip to main content

How it all works

A plain-language tour of the Blursec ecosystem: what the SDK does, what the Replit and MCP packages add on top, and exactly what to do to connect each one. No prior security knowledge required.

The problem in one paragraph

Most account takeovers don’t involve anyone “hacking” your platform. Infostealer malware infects a user’s device and silently harvests every credential it can find — saved browser passwords and session cookies for your app, their SaaS tools, email, banking, and every other provider they use. Those credentials are packaged into stealer-log databases sold on the dark web, and an attacker simply logs into your platform with the user’s genuinely valid email + password (or replays a stolen session token). Your code never sees anything wrong — the credentials are correct. Blursec’s job is to answer one question before you accept a login: “Is this credential already in the wild?”

How a check works (step by step)

When your server calls blursec.checkCredential(email, password):
This is called k-anonymity. The password — and even its full hash — never leaves your server. Blursec only ever sees a 10-character prefix that matches thousands of unrelated hashes, so it learns nothing about the actual credential. The same model is used for session tokens via blursec.verifySession(req). Two more guarantees you get for free:
  • Fail-open — if the Blursec API is slow, down, or unreachable, checks return { leaked: false, recommendedAction: "allow", failedOpen: true } instead of throwing. An outage on our side never locks your users out.
  • Fast — checks are budgeted at 1500 ms worst-case and typically answer in under 50 ms.

The three pieces

Rule of thumb: the SDK protects your /login endpoint in production code; the MCP server is for humans-with-AI-assistants investigating things. Never put an LLM in the login hot path.

Using the SDK (2 minutes)

That’s the whole integration. Details: configuration, error model & fail-open, advanced usage.

Using the Replit adapter (3 minutes)

If your app lives on Replit, the adapter removes the remaining boilerplate:
  1. Open your Repl’s Secrets pane (lock icon) and add BLURSEC_API_KEY.
  2. npm i @blursec/sdk @blursec/replit
  3. Wire the middlewares:
The middlewares apply the block / reset / monitor decisions for you. Full option reference: Replit integration.

Connecting the MCP server (5 minutes)

The MCP server lets an AI assistant call Blursec as tools: blursec_check_credential, blursec_check_token, blursec_check_hash, blursec_verify_session, and blursec_whoami. You need two things: your Blursec API key and a one-block config in your AI client. The key is passed as an environment variable only — it never appears in prompts or chat history.

Claude Desktop / Claude Code

Add to claude_desktop_config.json (Claude Desktop → Settings → Developer → Edit Config), or .mcp.json for Claude Code:
Restart the app. You should see blursec listed under available tools.

VS Code (GitHub Copilot agent mode)

Create .vscode/mcp.json in your workspace:
VS Code prompts for the key once and stores it securely.

Cursor and other MCP clients

Any client that speaks MCP over stdio works with the same shape: command npx, args ["-y", "@blursec/mcp"], and BLURSEC_API_KEY in env.

Try it

Ask your assistant:
Is the credential [email protected] / hunter2 in any stealer log?
The agent calls blursec_check_credential, and you get back leaked, severity, and a recommendedAction — with the same k-anonymity guarantee as the SDK (only the 10-character hash prefix leaves your machine). Full tool reference and troubleshooting: AI agents & MCP.

What goes over the wire (summary)