跳到主要內容

Mcporter

使用 mcporter CLI 直接列出、配置、認證和調用 MCP 服務器/工具(通過 HTTP 或 stdio),包括臨時服務器、配置編輯以及 CLI/類型生成。

技能元數據

來源可選 — 使用 hermes skills install official/mcp/mcporter 安裝
路徑optional-skills/mcp/mcporter
版本1.0.0
作者community
許可證MIT
標籤MCP, Tools, API, Integrations, Interop

參考:完整 SKILL.md

信息

以下是 Hermes 在觸發此技能時加載的完整技能定義。這是技能激活時代理所看到的指令。

mcporter

使用 mcporter 從終端直接發現、調用和管理 MCP(模型上下文協議) 服務器和工具。

前置條件

需要 Node.js:

# No install needed (runs via npx)
npx mcporter list

# Or install globally
npm install -g mcporter

快速開始

# List MCP servers already configured on this machine
mcporter list

# List tools for a specific server with schema details
mcporter list <server> --schema

# Call a tool
mcporter call <server.tool> key=value

發現 MCP 服務器

mcporter 會自動發現機器上由其他 MCP 客戶端(Claude Desktop、Cursor 等)配置的服務器。要查找新的可用服務器,可以瀏覽 mcpfinder.devmcp.so 等註冊表,然後進行臨時連接:

# Connect to any MCP server by URL (no config needed)
mcporter list --http-url https://some-mcp-server.com --name my_server

# Or run a stdio server on the fly
mcporter list --stdio "npx -y @modelcontextprotocol/server-filesystem" --name fs

調用工具

# Key=value syntax
mcporter call linear.list_issues team=ENG limit:5

# Function syntax
mcporter call "linear.create_issue(title: \"Bug fix needed\")"

# Ad-hoc HTTP server (no config needed)
mcporter call https://api.example.com/mcp.fetch url=https://example.com

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

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

# Machine-readable output (recommended for Hermes)
mcporter call <server.tool> key=value --output json

認證與配置

# OAuth login for a server
mcporter auth <server | url> [--reset]

# Manage config
mcporter config list
mcporter config get <key>
mcporter config add <server>
mcporter config remove <server>
mcporter config import <path>

配置文件位置:./config/mcporter.json(可使用 --config 覆蓋)。

守護進程

用於持久化服務器連接:

mcporter daemon start
mcporter daemon status
mcporter daemon stop
mcporter daemon restart

代碼生成

# Generate a CLI wrapper for an MCP server
mcporter generate-cli --server <name>
mcporter generate-cli --command <url>

# Inspect a generated CLI
mcporter inspect-cli <path> [--json]

# Generate TypeScript types/client
mcporter emit-ts <server> --mode client
mcporter emit-ts <server> --mode types

注意事項

  • 使用 --output json 獲取更易於解析的結構化輸出
  • 臨時服務器(HTTP URL 或 --stdio 命令)無需任何配置即可工作 — 適用於一次性調用
  • OAuth 認證可能需要交互式瀏覽器流程 — 如有需要,請使用 terminal(command="mcporter auth <server>", pty=true)