chore: anonymize deployment URL in docs and UI

Replace hardcoded memory.dnspegasus.net references throughout README
with the generic memory.example.com placeholder (matches .env.example).

In tokens-manager.tsx, the claude-mcp-add snippet shown to users now
derives the host from PUBLIC_URL via a server-side prop instead of a
hardcoded literal, so any deployer sees their own URL in the snippet.

Prepares the repo for public mirroring.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-22 08:58:57 -07:00
co-authored by Claude Opus 4.7
parent d1d4c60f2d
commit 0afa9e86ae
3 changed files with 23 additions and 15 deletions
@@ -28,11 +28,12 @@ interface Props {
action: (prev: CreateTokenState, formData: FormData) => Promise<CreateTokenState>;
ttlDays: number;
projects: ProjectOption[];
publicUrl: string;
}
const initial: CreateTokenState = { token: null, error: null, projectKey: null };
export default function TokensManager({ action, ttlDays, projects }: Props) {
export default function TokensManager({ action, ttlDays, projects, publicUrl }: Props) {
const [state, formAction, pending] = useActionState(action, initial);
if (state.token) {
@@ -49,7 +50,7 @@ export default function TokensManager({ action, ttlDays, projects }: Props) {
</pre>
<details className="text-xs text-fg-muted">
<summary className="cursor-pointer">claude mcp add command</summary>
<pre className="mt-2">{buildMcpAddSnippet(state.token, state.projectKey)}</pre>
<pre className="mt-2">{buildMcpAddSnippet(state.token, state.projectKey, publicUrl)}</pre>
</details>
<p className="text-xs text-fg-subtle">
Valid for {ttlDays} days. Revoke individually below if it leaks.
@@ -120,14 +121,19 @@ function ProjectSelect({ projects }: { projects: ProjectOption[] }) {
);
}
function buildMcpAddSnippet(token: string, projectKey: string | null): string {
function buildMcpAddSnippet(
token: string,
projectKey: string | null,
publicUrl: string,
): string {
const headerLines = [` --header "Authorization: Bearer ${token}"`];
if (projectKey) {
headerLines.push(` --header "X-Project-Key: ${projectKey}"`);
}
const base = publicUrl.replace(/\/+$/, "");
return [
"claude mcp add --transport http --scope user \\",
...headerLines.map((l) => `${l} \\`),
" shared-memory https://memory.dnspegasus.net/api/mcp",
` shared-memory ${base}/api/mcp`,
].join("\n");
}