Skip to content
AddHunt
MCP servers

mcporter

TypeScript runtime and CLI for calling any MCP server

Open source

  • Open source
  • Licence: MIT

In short

mcporter is an open-source TypeScript toolkit with a runtime, a CLI and code generators for the Model Context Protocol. It is aimed at developers and AI agent builders who want to call MCP servers like ordinary functions without writing glue code.

What you get

  • Finds MCP servers already configured in Cursor, Claude, Codex and VS Code
  • Tool calls with flags, function-call syntax or positional values
  • generate-cli turns an MCP server into a standalone CLI
  • emit-ts produces .d.ts types or a typed client
  • Proxy API that exposes tools as camelCase methods
  • Ad-hoc HTTP, SSE and stdio connections with automatic OAuth

The details

mcporter wraps the Model Context Protocol in a TypeScript package that can be used three ways: as a command-line tool, as a programmatic API, and as a generator of new CLIs and typed clients. It follows the code-execution approach to MCP, where an agent works with a small typed surface instead of loading a large tool-schema prompt.

Discovery and calls

On first run it looks for servers already set up in editors and agent tools such as VS Code, Cursor, Codex, Windsurf, OpenCode and Claude, next to its own config files, and expands environment placeholders. Tools can be called with colon flags, a function-call style or positional values, and MCP resources can be listed or read. A JSON mode keeps stdout machine-readable while progress messages and prompts go to stderr.

Generators

  • generate-cli builds a standalone CLI for a chosen server, with embedded schemas and optional bundling or compiled Bun binaries
  • emit-ts writes .d.ts interfaces or a ready client for agents and tests

Runtime API

createServerProxy() exposes the tools of a server as camelCase methods, fills in schema defaults, checks required arguments and returns results with helpers for text, markdown, JSON and images. Ad-hoc connections work over HTTP, SSE and stdio without editing config, and hosted servers that need a browser login are handled through OAuth. The project is MIT-licensed and can be tried with npx before installing.

Alternatives to mcporter

All alternatives

Questions

Does mcporter have to be installed before use?

No. The site shows it running through npx, for example npx mcporter list, which lists the MCP servers that are already configured on the machine.

Where does mcporter find MCP server settings?

It reads its own config files first and then imports servers configured in tools such as Cursor, Claude Code and Claude Desktop, Codex, Windsurf, OpenCode and VS Code.

Can mcporter produce typed code for agents?

Yes. The emit-ts command writes TypeScript declaration files or a client built on createServerProxy(), so MCP tools can be called with full types.

More like this