Snoopr NodeSnoopr
BETA

Snoopr MCP Gateway

Das zentrale Zuhause für die MCP Apps von Snoopr: Partner erhalten einen klaren Einstieg in Produktstrecken, sichere Integrationen und eine konsistente Nutzererfahrung.

Verfügbare Apps

Öffnen Sie die Detailansicht, um Funktionsumfang und verfügbare Tools je App zu sehen.

Snoopr MCP Tarifrechner-App

Live
Öffentlich

/mcp/quote

Digitale Angebotsstrecke für Tarife, Angebotsdokumente und Antragsabschluss in einem geführten Ablauf.

Sandbox / MCP App Testumgebung

SandboxÖffentlich

/test

Abgesicherte Testumgebung für Partner zur End-to-End Validierung gegen von MCP Apps inklusive OAuth Login.

Partnerschaft & Integration

Informationen zur Bereitstellung eigener MCP Apps und zur Nutzung des Snoopr MCP Gateways.

Eigene MCP App für Snoopr?

Thema Bereitstellung

Haben Sie Interesse, eine MCP App für Snoopr bereitzustellen? Dann kontaktieren Sie bitte den Kundenservice von Snoopr unter service@snoopr.de.

Snoopr MCP Gateway nutzen?

Thema Nutzung

Wenn Sie Informationen zur Nutzung des Snoopr MCP Gateways und Zugangsdaten für Ihr System benötigen, melden Sie sich bitte unter service@snoopr.de. Die Integration richtet sich primär an Hersteller technischer Systeme, bevorzugt an KI-Agenten. Auch Makler, die z. B. mit n8n eigene Workflows bauen, können das Snoopr MCP Gateway nutzen.

Dokumentation

So authentifizieren sich Integrationspartner per OAuth (Client Credentials) und nutzen den Quote Service.

MCP Gateway Auth

OAuth Client-Credentials für den Gateway-Zugriff

  • Token: /oauth/token
  • OAuth Discovery: /.well-known/oauth-authorization-server
  • Scope: quote:mcp

Tool-Nutzung MCP Tarifrechner-App

Nach erfolgreicher Authentifizierung über den MCP Endpoint

  1. Sie erhalten von Snoopr eine client_id und ein client_secret.
  2. Sie rufen POST /oauth/token mit grant_type=client_credentials auf.
  3. Sie verwenden das erhaltene access_token als Bearer Token für MCP Requests auf /mcp/quote.

curl Beispiel: MCP Gateway Auth

Access Token über OAuth Client Credentials anfordern

curl -X POST https://mcp.snoopr.de/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id=IHRE_CLIENT_ID&client_secret=IHR_CLIENT_SECRET&scope=quote:mcp"

JavaScript Beispiel: Tool-Nutzung MCP Tarifrechner-App

Lokal verifiziertes Script (JSON + SSE kompatibel) für Token, initialize, tools/list und get_products

const baseUrl = "https://mcp.snoopr.de";
const baseUrl = "https://mcp.snoopr.de";

function parseRpcResponse(rawText, contentType = "") {
  const text = (rawText || "").trim();
  if (!text) throw new Error("Leere Antwort vom Server");

  try {
    return JSON.parse(text);
  } catch {
    // weiter mit SSE parsing
  }

  const looksLikeSse = contentType.includes("text/event-stream") || text.includes("\ndata:");
  if (!looksLikeSse) throw new Error("Antwort ist weder JSON noch SSE.");

  const chunks = text.split(/\n\n+/);
  for (const chunk of chunks) {
    const dataLines = chunk
      .split("\n")
      .map((line) => line.trim())
      .filter((line) => line.startsWith("data:"))
      .map((line) => line.slice(5).trim());
    if (!dataLines.length) continue;
    const data = dataLines.join("\n");
    if (!data || data === "[DONE]") continue;
    try {
      return JSON.parse(data);
    } catch {
      // next chunk
    }
  }

  throw new Error("SSE-Antwort enthält kein parsebares JSON.");
}

async function getAccessToken() {
  const body = new URLSearchParams({
    grant_type: "client_credentials",
    client_id: process.env.SNOOPR_CLIENT_ID,
    client_secret: process.env.SNOOPR_CLIENT_SECRET,
    scope: "quote:mcp",
  });

  const res = await fetch(`${baseUrl}/oauth/token`, {
    method: "POST",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    body,
  });
  if (!res.ok) throw new Error(`Token request failed: ${res.status}`);
  const data = await res.json();
  return data.access_token;
}

async function callMcp(token, payload, sessionId) {
  const headers = {
    Authorization: `Bearer ${token}`,
    "Content-Type": "application/json",
    Accept: "application/json, text/event-stream",
    "mcp-protocol-version": "2025-11-25",
  };
  if (sessionId) headers["mcp-session-id"] = sessionId;

  const res = await fetch(`${baseUrl}/mcp/quote`, {
    method: "POST",
    headers,
    body: JSON.stringify(payload),
  });
  const text = await res.text();
  const contentType = res.headers.get("content-type") || "";
  if (!res.ok) throw new Error(`MCP request failed: ${res.status}`);
  const body = parseRpcResponse(text, contentType);

  return {
    body,
    sessionId: res.headers.get("mcp-session-id"),
  };
}

async function run() {
  const token = await getAccessToken();

  const init = await callMcp(token, {
    jsonrpc: "2.0",
    id: 1,
    method: "initialize",
    params: {
      protocolVersion: "2025-11-25",
      capabilities: {},
      clientInfo: { name: "Integration Client", version: "1.0.0" },
    },
  });

  const list = await callMcp(token, {
    jsonrpc: "2.0",
    id: 2,
    method: "tools/list",
    params: {},
  }, init.sessionId);

  const products = await callMcp(token, {
    jsonrpc: "2.0",
    id: 3,
    method: "tools/call",
    params: { name: "get_products", arguments: {} },
  }, init.sessionId);

  console.log("Tools:", list.body);
  console.log("Products:", products.body);
}

run().catch(console.error);

Das vollständige, lokal getestete Script liegt unter scripts/verify-quote-mcp.mjs.