@rateme12/hook
v0.0.0
Published
Local telemetry hook for rateme12 — emits task telemetry from an agent's own MCP client; tool payloads never leave the machine.
Readme
@rateme12/hook
The local client hook for rateme12: every tool call your agent makes against an MCP server becomes a task in the reputation ledger — without the payloads ever leaving your machine. Only a SHA-256 hash of the input and output, the tool name, the exact server version, latency, and the outcome are sent to rateme12 (docs/END_GOAL.md rows 4–5; docs/PRIVACY.md).
Two forms over one emit core:
1. Proxy binary (any MCP client, config-only)
Point your MCP client at rateme12-hook instead of the server; it spawns the
real server and relays stdio, tapping tool calls in flight. Bytes flow
host ↔ hook ↔ server locally; rateme12 sees only hashes.
{
"mcpServers": {
"some-server": {
"command": "rateme12-hook",
"args": ["--", "npx", "-y", "some-mcp-server"],
"env": {
"RATEME12_AGENT_KEY": "rm12_…", // register at /install → returns a key
"RATEME12_SERVER_ID": "<listing id from the directory>"
}
}
}
}Everything after -- is the downstream server command, run unchanged.
Config (env):
| Var | Required | Default | Meaning |
|-----|----------|---------|---------|
| RATEME12_AGENT_KEY | to emit | — | your agent's minted API key (rm12_…) |
| RATEME12_SERVER_ID | to emit | — | the directory listing the server is |
| RATEME12_API_BASE | no | https://api.rateme12.com | API origin |
| RATEME12_MODEL | no | unknown | execution context (e.g. claude-opus-5) |
| RATEME12_HARNESS | no | unknown | execution context (e.g. claude-code) |
| RATEME12_VERSION | no | server's initialize version, else unknown | exact version override |
Without the key or server id the hook still runs — as a transparent pass-through, emitting nothing (a telemetry misconfig never breaks your agent).
2. Middleware (code that drives an MCP client)
Wrap your client's callTool; SDK-agnostic, no proxy process:
import { instrumentCallTool, resolveConfig } from "@rateme12/hook";
const { config } = resolveConfig(process.env);
const callTool = config
? instrumentCallTool(config, (args) => client.callTool(args), { version })
: (args) => client.callTool(args);The wrapped call is behaviourally identical — same result, same thrown errors; emission is fire-and-forget.
Running
Dev / from source (Bun): bun run src/cli.ts -- <server command>.
The published rateme12-hook binary is the bundle produced by
bun run bundle (dist/cli.js, Node ≥ 20).
