Call Syntax Reference
mcporter call now understands two complementary styles:
| Style | Example | Notes |
|---|---|---|
| Flag-based (compatible) | mcporter call linear.create_comment --issue-id LNR-123 --body "Hi" | Use --key value, --key=value, key=value, key:value, or key: value pairs—ideal for shell scripts. |
| Function-call (expressive) | mcporter call 'linear.create_comment(issueId: "LNR-123", body: "Hi")' | Mirrors the pseudo-TypeScript signature shown by mcporter list; unlabeled values map to schema order. |
| Structured output | mcporter call 'linear.create_comment(...)' --output json | Successful calls emit JSON bodies; failures emit { server, tool, issue } envelopes so automation can react to auth/offline/http errors. |
Both forms share the same validation pipeline, so required parameters, enums, and formats behave identically.
#Reading the CLI Signatures
mcporter list <server> prints each tool as a compact TypeScript declaration:
/**
* Create a comment on a specific Linear issue.
* @param issueId The issue ID
* @param body The content of the comment as Markdown
* @param parentId? A parent comment ID to reply to
*/
function create_comment(issueId: string, body: string, parentId?: string): Comment;
// optional (3): notifySubscribers, labelIds, mentionIds, ...
Key details:
- Doc blocks use
@paramlines so every parameter description (even optional ones) stays in view. - Required parameters appear without
?; optional parameters use?and inherit enum literals (e.g."json" | "markdown"). - Known format hints are appended inline:
dueDate?: string /* ISO 8601 */(we suppress the hint when the description already calls it out). - When a tool exposes more than two optional parameters (or has ≥4 required parameters), the default output hides the extras and replaces them with an inline summary like
// optional (8): limit, before, after, orderBy, projectId, .... - Run
mcporter list <server> --all-parameterswhenever you want the full signature; the footer repeatsOptional parameters hidden; run with --all-parameters to view all fields.any time truncation occurs. - Return types come from each tool’s output schema, so you’ll see concrete names when providers include
titlemetadata (e.g.DocumentConnection). When no schema is advertised we omit the: Typesuffix entirely instead of showingunknown. - Each server concludes with a short
Examples:block that mirrors the preferred function-call syntax. - Run
mcporter list <server> --brief(or--signatures) when you only want the compact signatures and optional summaries without doc blocks or examples.
#Function-Call Syntax Details
- Named arguments preferred:
issueId: "123"keeps calls self-documenting. When labels are omitted, mcporter falls back to positional order defined by the tool schema. - Optional positional fallback: omit labels when calling
mcporter 'context7.resolve-library-id("react")'—arguments map to the schema order after any explicitly named parameters. - Literals supported: strings, numbers, booleans,
null, arrays, and nested objects. For strings containing spaces or commas, wrap the entire call in single quotes to keep the shell happy. - Error feedback: invalid keys, unsupported expressions, or parser failures bubble up with actionable messages (
Unsupported argument expression: Identifier,Unable to parse call expression: …). - Server selection: You can embed the server in the expression (
linear.create_comment(...)) or pass it separately (--server linear create_comment(...)).
#HTTP Selectors & Ad-hoc URLs
- You can skip
--serverentirely by pasting the MCP endpoint + tool name directly:mcporter call 'https://www.shadcn.io/api/mcp.getComponent(component: "vortex")'. - Mcporter strips the
.toolsuffix to derive the base server URL, reuses any configured definition that already points at that endpoint, and only registers a new ad-hoc server when necessary (--allow-httpstill guards plain HTTP URLs). - Function-call arguments continue to work in this form; if you omit parentheses you can still append
key=valuepairs (https://.../mcp.getComponent component=vortex). - This is especially handy for copy/pasting tool listings or experimenting with anonymous HTTP MCP servers—you get the same parsing, auto-correction, and logging pipeline as the regular
server.toolsyntax. - Protocols are optional; bare domains such as
shadcn.io/api/mcp.getComponentsautomatically assumehttps://. If you really need plain HTTP, spell outhttp://and pass--allow-http. - Hostname comparisons ignore a leading
www.sohttps://shadcn.io/api/mcpandhttps://www.shadcn.io/api/mcpresolve to the same configured server when possible.
#Tips
- Use
--args '{ "issueId": "LNR-123" }',--json '{ "issueId": "LNR-123" }', or--json -if you already have JSON payloads. - The new syntax respects all existing features (timeouts,
--output, auto-correction). - Required fields show by default; pass
--all-parameterswhen you want the full parameter list (or--schemafor raw JSON schemas). - When in doubt, run
mcporter list <server>to see the current signature and sample invocation.
#Flag-Based Syntax Details
--key value,--key=value,key=value,key:value,key: value, andkey:=valueall map to the same named-argument handling, so you can type whichever feels most natural for your shell. Long flag keys convert kebab-case to camelCase (--save-to-drafts truebecomessaveToDrafts: true). The:=form is accepted as a compatibility alias for=.- By default, arguments keep the same validation pipeline as the function-call syntax—enums, numbers, and booleans are coerced automatically, and missing required fields raise errors.
--args -and--json -read a JSON object from stdin.- Bare string values supplied via long flags wrap into one-item arrays when the tool schema declares that field as an array.
- Numeric-looking
key=valuearguments are restored to their original string spelling when the tool schema declares that parameter as a string, which keeps timestamp-like IDs such as Slackthread_ts=1234567890.123456intact. --raw-stringsdisables numeric coercion for flag-style and positional values so IDs/codes stay literal strings (code=12345stays"12345").--no-coercedisables all coercion for flag-style and positional values (true,null, and JSON-like values remain strings).- Long flags without values fail fast. Insert
--before literal positional values that start with--. --save-images <dir>keeps stdout formatting untouched while writing image content blocks to disk when a tool response includestype: "image"entries.tool=value/tool:valueandserver=valuestill act as aliases for--tool/--serverwhen you need to override the selector.