mcporter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

mcporter

mcporter

Use the
mcporter
CLI to interact with MCP servers directly via HTTP or stdio.
使用
mcporter
CLI通过HTTP或stdio直接与MCP服务器交互。

Quick Start

快速开始

  1. List available servers:
    mcporter list
  2. View tools for a server:
    mcporter list <server> --schema
  3. Call a tool:
    mcporter call <server.tool> key=value
  1. 列出可用服务器:
    mcporter list
  2. 查看服务器的工具:
    mcporter list <server> --schema
  3. 调用工具:
    mcporter call <server.tool> key=value

Calling Tools

调用工具

Multiple syntaxes are supported for calling MCP tools:
调用MCP工具支持多种语法:

Selector syntax

选择器语法

bash
mcporter call linear.list_issues team=ENG limit:5
bash
mcporter call linear.list_issues team=ENG limit:5

Function syntax

函数语法

bash
mcporter call "linear.create_issue(title: \"Bug\")"
bash
mcporter call "linear.create_issue(title: \"Bug\")"

Full URL

完整URL

bash
mcporter call https://api.example.com/mcp.fetch url:https://example.com
bash
mcporter call https://api.example.com/mcp.fetch url:https://example.com

Stdio mode (ad-hoc servers)

Stdio模式(临时服务器)

bash
mcporter call --stdio "bun run ./server.ts" scrape url=https://example.com
bash
mcporter call --stdio "bun run ./server.ts" scrape url=https://example.com

JSON payload

JSON负载

bash
mcporter call <server.tool> --args '{"limit":5}'
bash
mcporter call <server.tool> --args '{"limit":5}'

Authentication and Configuration

认证与配置

OAuth authentication

OAuth认证

bash
mcporter auth <server | url>        # Authenticate with a server
mcporter auth <server> --reset      # Reset authentication
bash
mcporter auth <server | url>        # 与服务器进行认证
mcporter auth <server> --reset      # 重置认证

Configuration management

配置管理

bash
mcporter config list                # List all configured servers
mcporter config get <key>           # Get a config value
mcporter config add <server>        # Add a server
mcporter config remove <server>     # Remove a server
mcporter config import <file>       # Import configuration
mcporter config login               # Login to mcporter cloud
mcporter config logout              # Logout from mcporter cloud
bash
mcporter config list                # 列出所有已配置的服务器
mcporter config get <key>           # 获取配置值
mcporter config add <server>        # 添加服务器
mcporter config remove <server>     # 删除服务器
mcporter config import <file>       # 导入配置
mcporter config login               # 登录mcporter云
mcporter config logout              # 退出mcporter云登录

Daemon Management

守护进程管理

bash
mcporter daemon start               # Start the daemon
mcporter daemon status              # Check daemon status
mcporter daemon stop                # Stop the daemon
mcporter daemon restart             # Restart the daemon
bash
mcporter daemon start               # 启动守护进程
mcporter daemon status              # 检查守护进程状态
mcporter daemon stop                # 停止守护进程
mcporter daemon restart             # 重启守护进程

Code Generation

代码生成

Generate CLI wrapper

生成CLI包装器

bash
mcporter generate-cli --server <name>
mcporter generate-cli --command <url>
bash
mcporter generate-cli --server <name>
mcporter generate-cli --command <url>

Inspect generated CLI

检查生成的CLI

bash
mcporter inspect-cli <path>
mcporter inspect-cli <path> --json  # JSON output
bash
mcporter inspect-cli <path>
mcporter inspect-cli <path> --json  # JSON格式输出

Generate TypeScript types

生成TypeScript类型

bash
mcporter emit-ts <server> --mode client   # Generate client code
mcporter emit-ts <server> --mode types    # Generate type definitions
bash
mcporter emit-ts <server> --mode client   # 生成客户端代码
mcporter emit-ts <server> --mode types    # 生成类型定义

Tips

提示

  • Configuration file defaults to
    ./config/mcporter.json
    . Override with
    --config <path>
    .
  • Use
    --output json
    for machine-readable output when parsing results programmatically.
  • When calling tools, both
    key=value
    and
    key:value
    syntaxes work for arguments.
  • 配置文件默认路径为
    ./config/mcporter.json
    ,可通过
    --config <path>
    覆盖。
  • 当以编程方式解析结果时,使用
    --output json
    获取机器可读的输出。
  • 调用工具时,
    key=value
    key:value
    两种语法均可用于传递参数。