MCPorter CLI
Overview
Use MCPorter as the default terminal interface for MCP-first workflows. Prefer shell-safe calls and small script files over long escaped inline strings.
If deeper details are needed for specific flags or edge cases, read references/command-cookbook.md.
If this skill is being edited, review references/validation-scenarios.md before changing examples.
Quick Start
- •Discover servers and tools:
npx mcporter list - •Inspect one server:
npx mcporter list <server> --schema - •Authenticate protected servers:
npx mcporter auth <server-or-url> - •Call a tool:
npx mcporter call <server.tool> key=value - •Move repeated calls into
.shor.tsfiles
Decision Guide
- •Need tool signatures or optional params:
mcporter list <server> --all-parameters - •Need one-shot MCP call:
mcporter call <server.tool> key=value - •Need ad-hoc URL or stdio server:
mcporter list --http-url <url>ormcporter call --stdio "<cmd>" - •Need persistence for ad-hoc server aliases:
--persist <config-path>ormcporter config add - •Need reusable TypeScript types/clients:
mcporter emit-ts - •Need shareable generated CLI artifact:
mcporter generate-cli - •Need keep-alive stateful stdio transport:
mcporter daemon startandmcporter daemon status
Quick Reference
| Goal | Command |
|---|---|
| List all discovered servers | npx mcporter list |
| Show one server + schema | npx mcporter list context7 --schema |
| Authenticate OAuth server | npx mcporter auth vercel |
| Call with shell-safe args | npx mcporter call linear.search_documentation query=automations |
| Ad-hoc HTTPS server | npx mcporter list --http-url https://mcp.linear.app/mcp --name linear |
| Generate types only | npx mcporter emit-ts linear --mode types --out types/linear-tools.d.ts |
| Generate standalone CLI | npx mcporter generate-cli --server linear --bundle dist/linear.js |
| Inspect daemon status | npx mcporter daemon status |
Atlassian OAuth Runbook
Use this exact flow for https://mcp.atlassian.com/v1/mcp.
- •Register a named server in project config:
{
"mcpServers": {
"mcp-atlassian-com-mcp": {
"baseUrl": "https://mcp.atlassian.com/v1/mcp",
"auth": "oauth",
"oauthRedirectUrl": "http://localhost:3334/callback"
}
}
}
- •
Run a clean auth attempt:
npx mcporter auth mcp-atlassian-com-mcp --reset --oauth-timeout 300000 --log-level debug - •
If auth exits non-zero, verify token state before retry loops:
cat ~/.mcporter/credentials.json - •
Validate connectivity with sequential commands:
npx mcporter list mcp-atlassian-com-mcp --jsonnpx mcporter call mcp-atlassian-com-mcp.atlassianUserInfo - •
When using fixed redirect port
3334, avoid parallellist/call/authruns to prevent port collisions.
Escape-Safe Calling Pattern
Prefer key-value calls and variables in scripts:
#!/usr/bin/env bash set -euo pipefail issue_id="ENG-123" comment_body="Looks good!" npx mcporter call linear.create_comment issueId="$issue_id" body="$comment_body"
When payloads become nested or hard to quote, switch to TypeScript runtime calls instead of escaping JSON in shell.
TypeScript Runtime Pattern
import { createRuntime, createServerProxy } from "mcporter";
const runtime = await createRuntime();
const context7 = createServerProxy(runtime, "context7");
const lib = await context7.resolveLibraryId({ libraryName: "react" });
console.log(lib.text());
await runtime.close();
Common Mistakes
- •Calling OAuth-protected servers before
mcporter auth: run auth first. - •Using ad-hoc slugs without
--persist: reuse the original--http-urlor--stdioflags until persisted. - •Expecting daemon keep-alive for ad-hoc targets: only configured named servers are daemon-managed.
- •Debugging with default output only: add
--json,--output json, or--tail-logfor scriptable diagnostics. - •Running
--resetwithout understanding it clears~/.mcporter/credentials.jsonentries. - •Running multiple Atlassian commands in parallel while using
oauthRedirectUrlon a fixed port.
Rationalization Table
| Excuse | Reality | Correct action |
|---|---|---|
| "One escaped inline call is faster" | Nested escaping fails often and is hard to debug | Move command into .sh or .ts file |
| "Auth errors mean server is down" | OAuth and transport failures are distinct | Run mcporter auth <server> and retry |
| "Ad-hoc alias should work forever" | Alias is reusable only after persistence | Use --persist or config add |
| "Any stdio target should stay warm" | Daemon ignores ad-hoc targets | Persist config entry and set lifecycle |
| "Auth exited 1 so no token was saved" | Atlassian flow can save tokens before later transport fallback fails | Check ~/.mcporter/credentials.json, then test with list and call |
| "Parallel checks are faster" | Fixed OAuth callback ports can collide (EADDRINUSE) | Run Atlassian auth/list/call sequentially |
Red Flags
- •Shell command contains many backslashes or nested quotes
- •Same auth/offline failure repeated without checking
--jsonenvelope - •Repeated ad-hoc calls without persisting a stable server definition
- •Generating typed clients manually instead of using
emit-ts - •
StreamableHTTPClientTransport already startedfollowed by SSE 400 during auth - •
EADDRINUSEonlocalhost:3334
Common Failure Recovery
- •Re-run with diagnostics:
--json(list/auth) or--output json(call) - •Re-check server visibility:
mcporter list <server> --schema - •Re-run auth:
mcporter auth <server-or-url> - •Persist ad-hoc definitions if repeatedly used
- •Inspect OAuth cache entry:
cat ~/.mcporter/credentials.json - •For Atlassian with fixed redirect port, run one command at a time
- •Use runtime API for complex payload construction