From a9e01fe7726b1e1ea2382e688a514e1e2e360688 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Sat, 7 Feb 2026 20:53:01 +1000 Subject: [PATCH] fix: correct claude mcp add arg order in all docs and UI The -H/--header flag is variadic and swallows subsequent positional args when placed before them. Move name and URL before flags so the CLI parses correctly. Also update docs from npx mcp-remote to native HTTP transport. --- .../collections/[slug]/CollectionDetailClient.tsx | 2 +- .../src/app/dashboard/collections/[id]/page.tsx | 2 +- apps/web/src/app/docs/page.tsx | 4 ++-- apps/web/src/app/docs/platform-guide/page.tsx | 4 ++-- .../components/collections/InstallationSection.tsx | 14 +++++++------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/web/src/app/(profile)/[username]/collections/[slug]/CollectionDetailClient.tsx b/apps/web/src/app/(profile)/[username]/collections/[slug]/CollectionDetailClient.tsx index 3592810..9c91e0f 100644 --- a/apps/web/src/app/(profile)/[username]/collections/[slug]/CollectionDetailClient.tsx +++ b/apps/web/src/app/(profile)/[username]/collections/[slug]/CollectionDetailClient.tsx @@ -127,7 +127,7 @@ function McpUrlSection({ }; // Claude Code CLI command (correct arg order: options before name and url) - const claudeCodeCommand = `claude mcp add --transport http tpmjs-${slug} ${httpUrl}`; + const claudeCodeCommand = `claude mcp add tpmjs-${slug} ${httpUrl} -t http`; // Claude Desktop native HTTP config const configSnippet = `{ diff --git a/apps/web/src/app/dashboard/collections/[id]/page.tsx b/apps/web/src/app/dashboard/collections/[id]/page.tsx index 66294ce..5e47db2 100644 --- a/apps/web/src/app/dashboard/collections/[id]/page.tsx +++ b/apps/web/src/app/dashboard/collections/[id]/page.tsx @@ -370,7 +370,7 @@ export default function CollectionDetailPage(): React.ReactElement { const sseUrl = `${baseUrl}/api/mcp/${collection.user.username}/${collection.slug}/sse`; // Claude Code CLI command (correct arg order: options before name and url) - const claudeCodeCommand = `claude mcp add --transport http --header "Authorization: Bearer YOUR_TPMJS_API_KEY" ${collection.slug} ${httpUrl}`; + const claudeCodeCommand = `claude mcp add ${collection.slug} ${httpUrl} -t http -H "Authorization: Bearer YOUR_TPMJS_API_KEY"`; // Claude Desktop native HTTP config const configSnippet = `{ diff --git a/apps/web/src/app/docs/page.tsx b/apps/web/src/app/docs/page.tsx index 7a291a1..a864eb5 100644 --- a/apps/web/src/app/docs/page.tsx +++ b/apps/web/src/app/docs/page.tsx @@ -1308,8 +1308,8 @@ export TPMJS_EXECUTOR_URL=https://executor.mycompany.com`} //http \\ - --header "Authorization: Bearer YOUR_TPMJS_API_KEY"`} + https://tpmjs.com/api/mcp///http \\ + -t http -H "Authorization: Bearer YOUR_TPMJS_API_KEY"`} />

This automatically adds the server to your Claude Code configuration. diff --git a/apps/web/src/app/docs/platform-guide/page.tsx b/apps/web/src/app/docs/platform-guide/page.tsx index d1b2140..9b5c3f0 100644 --- a/apps/web/src/app/docs/platform-guide/page.tsx +++ b/apps/web/src/app/docs/platform-guide/page.tsx @@ -802,8 +802,8 @@ Invalid usernames: diff --git a/apps/web/src/components/collections/InstallationSection.tsx b/apps/web/src/components/collections/InstallationSection.tsx index 168669d..008289b 100644 --- a/apps/web/src/components/collections/InstallationSection.tsx +++ b/apps/web/src/components/collections/InstallationSection.tsx @@ -41,14 +41,14 @@ export function InstallationSection({ const mcpUrl = `${baseUrl}/@${username}/collections/${collection.slug}/mcp`; // Build the claude mcp add command - // Options must come before + // Positional args (name, url) must come before flags to avoid -H swallowing them const commandParts = ['claude mcp add']; - commandParts.push('--transport http'); - if (isPrivate) { - commandParts.push('--header "Authorization: Bearer YOUR_TPMJS_API_KEY"'); - } commandParts.push(collection.slug); commandParts.push(mcpUrl); + commandParts.push('-t http'); + if (isPrivate) { + commandParts.push('-H "Authorization: Bearer YOUR_TPMJS_API_KEY"'); + } const installCommand = commandParts.join(' \\\n '); @@ -90,8 +90,8 @@ export function InstallationSection({ const copyCommand = async () => { // Copy the flat command (without line breaks for easy pasting) const flatCommand = isPrivate - ? `claude mcp add --transport http --header "Authorization: Bearer YOUR_TPMJS_API_KEY" ${collection.slug} ${mcpUrl}` - : `claude mcp add --transport http ${collection.slug} ${mcpUrl}`; + ? `claude mcp add ${collection.slug} ${mcpUrl} -t http -H "Authorization: Bearer YOUR_TPMJS_API_KEY"` + : `claude mcp add ${collection.slug} ${mcpUrl} -t http`; await navigator.clipboard.writeText(flatCommand); setCopiedCommand(true);