Translation(model translation, not the source's own text)
MCP server
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { registerFeedbackTool } from "@mostlovedproduct/mcp/sdk";
const server = new McpServer({ name: "acme", version: "1.0.0" });
// Adds the standard submit_feedback tool, with write annotations.
registerFeedbackTool(server, {
key: process.env.MLP_SERVER_KEY!, // server capture key (write-only)
product: "Acme",
profile: "proactive", // or "conservative"
});
import { createFeedbackHandler } from "@mostlovedproduct/mcp";
const feedback = createFeedbackHandler({
key: env.MLP_SERVER_KEY,
product: "Acme",
enabled: () => !env.FEEDBACK_KILL_SWITCH,
context: (call) => ({
trust: call.signedIn ? "authenticated" : "anonymous",
user: { id: call.opaqueUserId, tier: call.plan },
app: { version: BUILD_SHA, env: "production" },
}),
});
// tools/list: plain JSON Schema, no MCP SDK required
tools.push(feedback.tool);
// tools/call: never throws, never blocks the user's task
if (name === feedback.tool.name) return feedback.call(args, callInfo);
curl -X POST https://in.mostlovedproduct.com/api/v1/mcp-feedback \
-H "Authorization: Bearer $MLP_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{
"v": 1,
"id": "01a1d56f-ee88-7c3a-9b1e-4f2d8a6c5e10",
"type": "report",
"sent_at": "2026-11-13T15:04:05Z",
"report": {
"source": { "kind": "agent", "surface": "mcp" },
"kind": "broken",
"impact": "blocked",
"summary": "export_report times out for ranges over 90 days",
"subject": { "type": "tool", "name": "export_report" }
}
}'
Web app
import { init } from "@mostlovedproduct/web";
init({
key: "mlp_pk_...", // publishable, write-only
user: { id: account.opaqueId, tier: account.plan },
flags: { search_v2: experiments.searchV2 },
app: { version: BUILD_VERSION, env: "production" },
// Evaluated when someone files, never before.
getContext: () => ({ selected_invoices: selection.size, view: router.current }),
});
<script>
window.mlp = window.mlp || function () { (mlp.q = mlp.q || []).push(arguments) };
</script>
<script async src="https://cdn.mostlovedproduct.com/mlp.js" data-key="mlp_pk_..."></script>
<script>
mlp("init", {
user: { id: "u_8f3c", tier: "growth" }, // your own opaque id
flags: { search_v2: "B" }, // A/B variants, feature flags
app: { version: "4.12.0", env: "production" },
});
</script>
// Runs in your page: intake checks the Origin against the key.
await fetch("https://in.mostlovedproduct.com/api/v1/user-feedback", {
method: "POST",
headers: {
Authorization: "Bearer mlp_pk_...", // publishable, origin-scoped
"Content-Type": "application/json",
},
body: JSON.stringify({
v: 1,
id: "01a1d56f-ee88-7c3a-9b1e-4f2d8a6c5e10", // UUIDv7 you generate
type: "report",
sent_at: new Date().toISOString(),
report: {
source: { kind: "human", surface: "web" },
kind: "broken",
summary: "Refunded invoices disappear from search",
page: { path: "/invoices" },
},
}),
});