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.
This commit is contained in:
parent
36598fec61
commit
a9e01fe772
5 changed files with 13 additions and 13 deletions
|
|
@ -127,7 +127,7 @@ function McpUrlSection({
|
||||||
};
|
};
|
||||||
|
|
||||||
// Claude Code CLI command (correct arg order: options before name and url)
|
// 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
|
// Claude Desktop native HTTP config
|
||||||
const configSnippet = `{
|
const configSnippet = `{
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
const sseUrl = `${baseUrl}/api/mcp/${collection.user.username}/${collection.slug}/sse`;
|
const sseUrl = `${baseUrl}/api/mcp/${collection.user.username}/${collection.slug}/sse`;
|
||||||
|
|
||||||
// Claude Code CLI command (correct arg order: options before name and url)
|
// 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
|
// Claude Desktop native HTTP config
|
||||||
const configSnippet = `{
|
const configSnippet = `{
|
||||||
|
|
|
||||||
|
|
@ -1308,8 +1308,8 @@ export TPMJS_EXECUTOR_URL=https://executor.mycompany.com`}
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
language="bash"
|
language="bash"
|
||||||
code={`claude mcp add tpmjs-my-collection \\
|
code={`claude mcp add tpmjs-my-collection \\
|
||||||
-- npx mcp-remote https://tpmjs.com/api/mcp/<username>/<collection-slug>/http \\
|
https://tpmjs.com/api/mcp/<username>/<collection-slug>/http \\
|
||||||
--header "Authorization: Bearer YOUR_TPMJS_API_KEY"`}
|
-t http -H "Authorization: Bearer YOUR_TPMJS_API_KEY"`}
|
||||||
/>
|
/>
|
||||||
<p className="text-foreground-secondary mt-4">
|
<p className="text-foreground-secondary mt-4">
|
||||||
This automatically adds the server to your Claude Code configuration.
|
This automatically adds the server to your Claude Code configuration.
|
||||||
|
|
|
||||||
|
|
@ -802,8 +802,8 @@ Invalid usernames:
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
language="bash"
|
language="bash"
|
||||||
code={`claude mcp add tpmjs-my-collection \\
|
code={`claude mcp add tpmjs-my-collection \\
|
||||||
-- npx mcp-remote https://tpmjs.com/api/mcp/YOUR_USERNAME/YOUR_COLLECTION_SLUG/http \\
|
https://tpmjs.com/api/mcp/YOUR_USERNAME/YOUR_COLLECTION_SLUG/http \\
|
||||||
--header "Authorization: Bearer YOUR_TPMJS_API_KEY"`}
|
-t http -H "Authorization: Bearer YOUR_TPMJS_API_KEY"`}
|
||||||
/>
|
/>
|
||||||
</DocSubSection>
|
</DocSubSection>
|
||||||
</DocSection>
|
</DocSection>
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,14 @@ export function InstallationSection({
|
||||||
const mcpUrl = `${baseUrl}/@${username}/collections/${collection.slug}/mcp`;
|
const mcpUrl = `${baseUrl}/@${username}/collections/${collection.slug}/mcp`;
|
||||||
|
|
||||||
// Build the claude mcp add command
|
// Build the claude mcp add command
|
||||||
// Options must come before <name> <url>
|
// Positional args (name, url) must come before flags to avoid -H swallowing them
|
||||||
const commandParts = ['claude mcp add'];
|
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(collection.slug);
|
||||||
commandParts.push(mcpUrl);
|
commandParts.push(mcpUrl);
|
||||||
|
commandParts.push('-t http');
|
||||||
|
if (isPrivate) {
|
||||||
|
commandParts.push('-H "Authorization: Bearer YOUR_TPMJS_API_KEY"');
|
||||||
|
}
|
||||||
|
|
||||||
const installCommand = commandParts.join(' \\\n ');
|
const installCommand = commandParts.join(' \\\n ');
|
||||||
|
|
||||||
|
|
@ -90,8 +90,8 @@ export function InstallationSection({
|
||||||
const copyCommand = async () => {
|
const copyCommand = async () => {
|
||||||
// Copy the flat command (without line breaks for easy pasting)
|
// Copy the flat command (without line breaks for easy pasting)
|
||||||
const flatCommand = isPrivate
|
const flatCommand = isPrivate
|
||||||
? `claude mcp add --transport http --header "Authorization: Bearer YOUR_TPMJS_API_KEY" ${collection.slug} ${mcpUrl}`
|
? `claude mcp add ${collection.slug} ${mcpUrl} -t http -H "Authorization: Bearer YOUR_TPMJS_API_KEY"`
|
||||||
: `claude mcp add --transport http ${collection.slug} ${mcpUrl}`;
|
: `claude mcp add ${collection.slug} ${mcpUrl} -t http`;
|
||||||
|
|
||||||
await navigator.clipboard.writeText(flatCommand);
|
await navigator.clipboard.writeText(flatCommand);
|
||||||
setCopiedCommand(true);
|
setCopiedCommand(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue