Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ oddkit reads markdown files from a GitHub repository — decisions, constraints,

oddkit is a remote MCP server. You don't install anything — you point your AI tool at a URL.

You can optionally add `?consumer=yourname` to the URL to identify yourself on the public transparency leaderboard. oddkit tracks which tools are used and how often, but never what you search for or what documents contain. Replace `yourname` with your name, a handle, or a project name — or leave it off to stay anonymous.

### Claude.ai

Settings → Connectors → Add Custom Integration:
- **Name:** `oddkit`
- **URL:** `https://oddkit.klappy.dev/mcp`
- **URL:** `https://oddkit.klappy.dev/mcp?consumer=yourname`

### ChatGPT

Settings → Developer Mode → Create App → add MCP server URL:

`https://oddkit.klappy.dev/mcp`
`https://oddkit.klappy.dev/mcp?consumer=yourname`

### Claude Code / Cursor / Any MCP Client

Expand All @@ -35,19 +37,19 @@ Add to your `.mcp.json`:
"mcpServers": {
"oddkit": {
"type": "http",
"url": "https://oddkit.klappy.dev/mcp"
"url": "https://oddkit.klappy.dev/mcp?consumer=yourname"
}
}
}
```

Or in Claude Code: `claude mcp add --transport http oddkit https://oddkit.klappy.dev/mcp`
Or in Claude Code: `claude mcp add --transport http oddkit https://oddkit.klappy.dev/mcp?consumer=yourname`

### Lovable / Replit / Gemini / ElevenLabs / Others

Any tool that supports MCP can connect. Look for "MCP server" or "custom integration" in your tool's settings and provide the URL:

`https://oddkit.klappy.dev/mcp`
`https://oddkit.klappy.dev/mcp?consumer=yourname`

---

Expand Down
2 changes: 1 addition & 1 deletion docs/CLAUDE-CODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ npm run deploy

Then add the remote MCP server in Claude.ai:
1. Go to Settings → Integrations → MCP
2. Add server URL: `https://oddkit.klappy.dev/mcp`
2. Add server URL: `https://oddkit.klappy.dev/mcp?consumer=yourname`

See [workers/README.md](../workers/README.md) for full deployment instructions.

Expand Down
23 changes: 16 additions & 7 deletions workers/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,36 @@ function parseClientInfoName(payload: unknown): string | null {

/**
* Consumer label resolution chain:
* 1. x-oddkit-client header (explicit, highest priority)
* 2. MCP initialize → clientInfo.name (protocol-native)
* 3. User-Agent header (fallback)
* 4. "unknown" (default)
* 1. ?consumer= query parameter (URL-level, highest priority)
* 2. x-oddkit-client header (explicit)
* 3. MCP initialize → clientInfo.name (protocol-native)
* 4. User-Agent header (fallback)
* 5. "unknown" (default)
*/
export function parseConsumerLabel(
request: Request,
payload: unknown,
): { label: string; source: string } {
// 1. Explicit header
// 1. URL query parameter — lets platforms that block custom headers self-identify
const url = new URL(request.url);
const consumer = url.searchParams.get("consumer");
if (consumer) {
const label = sanitize(consumer);
if (label) return { label, source: "query-param" };
}

// 2. Explicit header
const explicit = request.headers.get("x-oddkit-client");
if (explicit) {
const label = sanitize(explicit);
if (label) return { label, source: "x-oddkit-client" };
}

// 2. MCP initialize clientInfo.name
// 3. MCP initialize clientInfo.name
const fromInit = parseClientInfoName(payload);
if (fromInit) return { label: fromInit, source: "initialize.clientInfo.name" };

// 3. User-Agent
// 4. User-Agent
const ua = request.headers.get("user-agent");
if (ua) {
const first = ua.split(/\s+/)[0] ?? "";
Expand Down
Loading