Main
Treat MCP calls as an API: wrap tool invocations behind typed functions so your agent/app logic stays readable.
Start with the CLI when prototyping; switch to a library import once the tool surface stabilizes.
Keep transport concerns separate: use mcporter to standardize how you connect to MCP providers across environments.
Document your tool contracts in code: types + examples reduce agent hallucinations about tool params.
README (excerpt)
MCPorter 🧳 - Call MCPs from TypeScript or as CLI
TypeScript runtime, CLI, and code-generation toolkit for the Model Context Protocol.
MCPorter helps you lean into the "code execution" workflows highlighted in Anthropic's Code Execution with MCP guidance: discover the MCP servers already configured on your system, call them directly, compose richer automations in TypeScript, and mint single-purpose CLIs when you need to share a tool. All of that works out of the box -- no boilerplate, no schema spelunking.
Key Capabilities
- Zero-config discovery.
createRuntime()merges your home config (~/.mcporter/mcporter.json[c], or$XDG_CONFIG_HOME/mcporter/mcporter.json[c]when set) first, thenconfig/mcporter.json, plus Cursor/Claude/Codex/Windsurf/OpenCode/VS Code imports, expands${ENV}placeholders, and pools connections so you can reuse transports across multiple calls. - One-command CLI generation.
mcporter generate-cliturns any MCP server definition into a ready-to-run CLI, with optional bundling/compilation and metadata for easy regeneration. - Typed tool clients.
mcporter emit-tsemits.d.tsinterfaces or ready-to-run client wrappers so agents/tests can call MCP servers with strong TypeScript types without hand-writing plumbing. - Friendly composable API.
createServerProxy()exposes tools as ergonomic camelCase methods, automatically applies JSON-schema defaults, validates required arguments, and hands back aCallResultwith.text(),.markdown(),.json(),.images(), and.content()helpers.
Source-backed notes
- README shows install options including
pnpm add mcporter,npm install -g mcporter, and a Homebrew tap. - GitHub topics include
mcpandcli(verified via GitHub API). - Repo is MIT licensed and recently pushed (verified via GitHub API).
FAQ
- Is there a CLI?: Yes—README includes
npm install -g mcporterandmcporter --helpusage. - Do I need TypeScript?: TypeScript is the primary target, but CLI usage works from any shell environment with Node installed.
- What license is it under?: MIT (verified via GitHub license metadata).