Back to Tools & Extensions
mcporter logo
tools395

mcporter

MCPorter 是 Model Context Protocol (MCP) 的 TypeScript 運行環境、CLI 工具與程式碼生成工具套件。透過零配置發現功能,探索、呼叫任何 MCP 伺服器,將其轉化為獨立 CLI 或類型化 API。

概述

mcporter (MCPorter 🧳) 是一個開源的 TypeScript 運行時環境、CLI 工具和程式碼生成套件,專為 Model Context Protocol (MCP) 而設計。它讓開發者和 AI 代理程式能夠發現已配置的 MCP 伺服器、直接呼叫工具、以 TypeScript 組合自動化流程,並從任何 MCP 端點生成單一用途的 CLI。

本專案旨在支援 Anthropic 的「使用 MCP 執行程式碼」指引,透過讓 AI 代理程式透過輕量級 CLI 二進位檔來呼叫工具,而非載入龐大的 JSON 架構,從而消除了樣板程式碼並減少了情境視窗的膨脹。

最新版本:0.8.2 (2026年3月)。採用 MIT 授權。

功能特色

.

  • 零配置探索:自動從 ~/.mcporter/mcporter.json、專案配置以及與 Claude、Cursor、Codex、VS Code、Windsurf 和 OpenCode 的整合中找到 MCP 伺服器。
  • CLI 優先的工具呼叫:使用自然語法 (mcporter call linear.create_comment ...) 或函式呼叫風格來執行工具 — 無需了解架構。
  • 一鍵生成 CLImcporter generate-cli 能從任何 MCP 伺服器建立獨立、自包含的 CLI (Bun/Node),便於分享和代理程式使用。
  • 強型別的 TypeScript APImcporter emit-ts 生成 .d.ts 介面或完整的用戶端封裝,並具備強型別、預設值和驗證。
  • 可組合的運行時環境createRuntime() + createServerProxy(),包含連線池、OAuth 快取、日誌追蹤,並支援 HTTP/SSE/stdio 傳輸協定。
  • 即時與常駐模式:立即連線到任何 MCP 端點;使用常駐指令讓有狀態的伺服器 (例如 chrome-devtools) 保持活躍。
  • AI 代理程式友善:減少情境膨脹 — 代理程式呼叫一個微小的 CLI 二進位檔,而非嵌入完整的 MCP 架構。
  • 穩健的工具集:自動校正、豐富的輸出格式 (text()json())、配置管理以及除錯輔助工具。

使用案例

  • AI 代理程式工具整合:讓 Claude/Cursor 透過生成的 CLI 呼叫複雜的 MCP 伺服器,而無需擴展情境視窗。
  • 快速自動化腳本編寫:建構能組合多個 MCP 工具並具備完整型別安全性的 TypeScript 工作流程。
  • 工具分享:為團隊或公眾使用生成並分發單一用途的 CLI (例如 linear-comment)。
  • 開發與除錯:在原型設計期間,即時檢查任何 MCP 伺服器架構或即時呼叫工具。
  • 減少 MCP 膨脹:在編輯器/代理程式中,以輕量級 CLI 呼叫取代繁重的架構載入。

安裝與快速入門

立即執行 (無需安裝)

npx mcporter list
npx mcporter list linear --schema

全域安裝

npm install -g mcporter
# 或使用 Homebrew
brew tap steipete/tap && brew install steipete/tap/mcporter

範例呼叫

# 冒號語法
mcporter call linear.create_comment issueId:ENG-123 body:'Looks good!'

# 函式呼叫語法
mcporter call 'linear.create_comment(issueId: "ENG-123", body: "Looks good!")'

生成 CLI

mcporter generate-cli --command https://mcp.context7.com/mcp

TypeScript 使用方式

import { createRuntime } from "mcporter";
const runtime = await createRuntime();
const result = await runtime.callTool("context7", "resolve-library-id", {
  args: { libraryName: "react" }
});
console.log(result.text());
await runtime.close();

完整的文件說明、CLI 參考資料和範例都在儲存庫中 。

為什麼選擇 mcporter?

MCP 透過工具賦予 AI 代理超能力,但管理架構和連接過程繁瑣。mcporter 讓 MCP 變得更順手 — 一次探索、即刻呼叫、為代理生成 CLI,並撰寫乾淨的類型化程式碼。它是終極的 MCP 瑞士軍刀。

相關連結

完美搭配任何 MCP 驅動的 AI 工作流程。

Tags

MCP協議TypeScript命令行介面MCP客戶端AI代理工具呼叫程式碼生成運行環境ClaudeCursorContext7

Related Entries

Keep exploring similar tools and resources in this category.

Browse Tools & Extensions
mcporter logo

mcporter

Tools & Extensions

MCPorter is a TypeScript runtime, CLI, and code-generation toolkit for the Model Context Protocol (MCP). Discover, call, and turn any MCP server into a standalone CLI or typed API with zero-config discovery.

CamoFox 瀏覽器 logo

CamoFox 瀏覽器

Tools & Extensions

CamoFox 瀏覽器是一款無介面的反偵測瀏覽器自動化伺服器,以 Camoufox(具有 C++ 層級指紋偽造功能的 Firefox 分支)驅動。它使 AI 代理能夠可靠地瀏覽被 Cloudflare、Google 及其他機器人偵測系統封鎖的網站。

CamoFox Browser logo

CamoFox Browser

Tools & Extensions

CamoFox Browser is a headless anti-detection browser automation server powered by Camoufox (Firefox fork with C++-level fingerprint spoofing). It enables AI agents to reliably browse sites blocked by Cloudflare, Google, and other bot detection systems.

LobeHub logo

LobeHub

Tools & Extensions

LobeHub is a modern AI agent platform and marketplace for discovering, building, and collaborating with intelligent agent teammates. It features native Model Context Protocol (MCP) integration and the world's largest curated MCP Servers Marketplace with tens of thousands of ready-to-use integrations.