AIGC-Hackers/mcpx

Token-efficient MCP client: TypeScript schemas instead of JSON, LLM-friendly syntax, batch calls, TOON output. Built for Claude/GPT automations.

License:MITLanguage:TypeScript172
anthropic自动化batch-operationsClaudeclaude-skills命令行codexcursordeveloper-toolsllm-toolsmcpmcp-clientmodel-context-protocoloauthtoken-efficientTypeScript

Deep Analysis

为 LLM 优化的 Token 高效 MCP 客户端,使用 TypeScript 签名替代 JSON Schema,支持批量调用和 TOON 输出格式

Core Features

Technical Implementation

Highlights
  • 首次运行自动迁移 Cursor/Claude/Codex/Windsurf/VS Code 的 MCP 配置
  • 智能拼写纠正(输入 listIssue 自动建议 list_issues)
  • 支持环境变量插值(${VAR}、${VAR:-fallback}、$env:VAR)
  • 可通过 Homebrew 或 bunx 快速安装
  • 为 LLM 代理和自动化工作流优化设计
Use Cases
  • LLM 代理自动化工作流(Claude/GPT 集成)
  • 批量 MCP 工具调用脚本
  • 数据迁移任务(跨系统导入导出)
  • 日常自动化任务(每日站会、状态报告)
  • 快速测试和探索 MCP 服务器功能
Limitations
  • 相对较新的项目(2025年11月创建),生态成熟度有待观察
  • 依赖 Bun 运行时(bunx)
  • Star 数较少(17),社区支持有限
  • 部分高级功能文档分散在多个 docs 文件中
Tech Stack
TypeScriptBunMCP (Model Context Protocol)OAuthHomebrew

MCPX 🧳

Token-efficient MCP client built for LLMs and humans.

Why MCPX? Other MCP clients dump giant JSON schemas that waste tokens and confuse humans. MCPX returns TypeScript signatures instead—Claude and developers instantly understand tool signatures. Call tools with LLM-native syntax (server.func({ args })), run batch operations via stdin, and get TOON output (90% fewer tokens than JSON).

MCPX 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, and compose richer automations in TypeScript. All of that works out of the box -- no boilerplate, no schema spelunking.

Installation

Homebrew

# Add the tap
brew tap AIGC-Hackers/mcpx

# Install mcpx
brew install mcpx

# Or install in one command
brew install AIGC-Hackers/mcpx/mcpx

Run without installing

bunx mcpx list

Alternate tap (steipete)

brew tap steipete/tap
brew install steipete/tap/mcpx

The steipete tap publishes alongside MCPX 0.3.2. Run brew update before reinstalling if you see an older build.

MCPX vs Other MCP Clients

Feature MCPX Typical MCP Client
Schema output TypeScript (readable, token-efficient) JSON Schema (verbose, token-heavy)
Call syntax linear.createIssue({ title: "Bug" }) Manual JSON construction
Batch calls ✅ Multi-line, stdin, comments ❌ One call at a time
Output format TOON (90% fewer tokens) Raw JSON
OAuth flow ✅ Auto-triggered, bug-free Manual or buggy
LLM-ready ✅ Designed for Claude/GPT workflows ⚠️ Requires token budget

Key Capabilities

  • Zero-config discovery. createRuntime() merges ./mcp.json with ~/.mcpx/mcp.json, expands ${ENV} placeholders, and pools connections so you can reuse transports across multiple calls. First run migrates Cursor/Claude/Codex/Windsurf/VS Code configs into ~/.mcpx/mcp.json automatically.
  • Flexible data formats. Call tools with function syntax or structured JSON/JSON5/YAML/TOML data. Output defaults to TOON (LLM-friendly), with --output flags for raw/JSON/text formats.
  • Friendly composable API. createServerProxy() exposes tools as ergonomic camelCase methods, automatically applies JSON-schema defaults, validates required arguments, and hands back a CallResult with .text(), .json(), and .content() helpers.
  • OAuth and stdio ergonomics. Built-in OAuth caching, log tailing, and stdio wrappers let you work with HTTP, SSE, and stdio transports from the same interface.
  • Ad-hoc connections. Point the CLI at any MCP endpoint (HTTP or stdio) without touching config, then persist it later if you want. Hosted MCPs that expect a browser login (Supabase, Vercel, etc.) are auto-detected and OAuth is triggered automatically when needed. See docs/adhoc.md.

Quick Start

MCPX auto-discovers the MCP servers you already configured in Cursor, Claude Code/Desktop, Codex, or local overrides. Install via Homebrew or run instantly with bunx mcpx. Need a full command reference (flags, modes, return types)? Check out docs/cli-reference.md.

Call MCP tools

# Function syntax - natural for agents and interactive use
mcpx call 'linear.create_comment({ issueId: "ENG-123", body: "Great!" })'

# Data format - explicit and structured (JSON5/YAML/TOML also supported)
mcpx call '{ tool: "linear.create_comment", args: { issueId: "ENG-123", body: "Great!" } }'

List your MCP servers

mcpx list
mcpx list context7
mcpx list https://mcp.linear.app/mcp --all-parameters
mcpx list shadcn.io/api/mcp.getComponents           # URL + tool suffix auto-resolves
mcpx list --stdio "bun run ./local-server.ts" --env TOKEN=xyz
  • Add --output json to emit a machine-readable summary with per-server statuses (auth/offline/http/error counts) and, for single-server runs, the full tool schema payload.

You can now point mcpx list at ad-hoc servers: provide a URL directly or use the new --http-url/--stdio flags (plus --env, --cwd, --name, or --persist) to describe any MCP endpoint. Until you persist that definition, you still need to repeat the same URL/stdio flags for mcpx call—the printed slug only becomes reusable once you merge it into a config via --persist or mcpx config add. OAuth is triggered automatically when servers require authentication. Full details live in docs/adhoc.md.

Single-server listings now show TypeScript Spec format so you can copy/paste the signature straight into mcpx call:

linear - Hosted Linear MCP
  23 tools · 1654ms · HTTP https://mcp.linear.app/mcp

/**
 * Create a comment on a specific Linear issue
 */
type CreateCommentSpec = {
  tool: 'create_comment'
  args: {
    issueId: string
    body: string
    parentId?: string
    notifySubscribers?: boolean
    labelIds?: string[]
    mentionIds?: string[]
  }
}

/**
 * List documents in the user's Linear workspace
 */
type ListDocumentsSpec = {
  tool: 'list_documents'
  args: {
    query?: string
    limit?: number
    before?: string
    after?: string
    orderBy?: 'createdAt' | 'updatedAt'
    projectId?: string
    initiativeId?: string
    creatorId?: string
    includeArchived?: boolean
  }
}

Here's what that looks like for Vercel when you run mcpx list vercel:

vercel - Vercel MCP (requires OAuth)

/**
 * Search the Vercel documentation.
 * Use this tool to answer any questions about Vercel's platform, features, and best practices.
 */
type SearchVercelDocumentationSpec = {
  tool: 'search_vercel_documentation'
  args: {
    topic: string
    tokens?: number
  }
}

/**
 * Deploy the current project to Vercel
 */
type DeployToVercelSpec = {
  tool: 'deploy_to_vercel'
  args: Record<string, unknown>
}

Context7: fetch docs (no auth required)

mcpx call 'context7.resolve-library-id({ libraryName: "react" })'
mcpx call 'context7.get-library-docs({ path: "/websites/react_dev", topic: "hooks" })'

Linear: search documentation (requires LINEAR_API_KEY)

LINEAR_API_KEY=sk_linear_example mcpx call 'linear.search_documentation({ query: "automations" })'

Chrome DevTools: snapshot the current tab

mcpx call 'chrome-devtools.take_snapshot()'
mcpx call 'linear.create_comment({ issueId: "LNR-123", body: "Hello world" })'

Call Syntax: Function syntax server.tool({ args }) or data format { tool: "server.tool", args: {...} }. Both are parsed (not executed as JS). Supports JSON5/YAML/TOML.

Helpful flags:

  • --config <path> -- custom config file (overrides the default ./mcp.json + ~/.mcpx/mcp.json merge).
  • --root <path> -- working directory for stdio commands.
  • --log-level <debug|info|warn|error> -- adjust verbosity (respects MCPX_LOG_LEVEL).
  • --oauth-timeout <ms> -- shorten/extend the OAuth browser wait; same as MCPX_OAUTH_TIMEOUT_MS / MCPX_OAUTH_TIMEOUT.
  • --tail-log -- stream the last 20 lines of any log files referenced by the tool response.
  • --output <format> -- control output format: toon (default, LLM-friendly), json, text, or raw.
  • --http-url <https://…> / --stdio "command …" -- describe an ad-hoc MCP server inline (pair with --env KEY=value, --cwd, --name, and --persist <config.json> as needed).
  • OAuth-protected servers trigger authentication automatically on first use.

Tip: You can skip the verb entirely—mcpx firecrawl automatically runs mcpx list firecrawl, and dotted tokens like mcpx linear.list_issues dispatch to the call command (typo fixes included).

Timeouts default to 30 s; override with MCPX_LIST_TIMEOUT or MCPX_CALL_TIMEOUT when you expect slow startups. OAuth browser handshakes get a separate 60 s grace period; pass --oauth-timeout <ms> (or export MCPX_OAUTH_TIMEOUT_MS) when you need the CLI to bail out faster while you diagnose stubborn auth flows.

Try an MCP without editing config

# Point at an HTTPS MCP server directly
mcpx list --http-url https://mcp.linear.app/mcp --name linear

# Run a local stdio MCP server via Bun
mcpx call --stdio "bun run ./local-server.ts" --name local-tools
  • Add --persist ~/.mcpx/mcp.json (or any path) to save the inferred definition for future runs.
  • Use --allow-http if you truly need to hit a cleartext endpoint.
  • See docs/adhoc.md for a deep dive (env overrides, cwd, OAuth).

Call Syntax

Two formats, both parsed (not executed as JavaScript):

Function syntax (natural for agents):

mcpx call 'linear.create_issue({ title: "Bug", priority: 2, labels: ["urgent"] })'

Data format (explicit, supports JSON5/YAML/TOML):

mcpx call '{ tool: "linear.create_issue", args: { title: "Bug", priority: 2 } }'

Features:

  • Auto-correct. Typo listIssue? MCPX suggests list_issues automatically.
  • Type specs. mcpx list <server> prints TypeScript specs—copy/paste directly into calls.

Batch Calling

Execute multiple MCP tool calls in one shot from stdin or a file. Perfect for LLM-driven workflows, automation scripts, and data migrations.

# From file
cat batch-calls.txt | mcpx call

# From heredoc (function syntax)
mcpx call << 'EOF'
linear.list_issues({ limit: 5 })
github.search_repos({ query: "mcp" })
EOF

# Data format also works
mcpx call << 'EOF'
[
  { tool: "linear.list_issues", args: { limit: 5 } },
  { tool: "github.search_repos", args: { query: "mcp" } }
]
EOF

Input format supports function syntax and structured data:

// Function syntax (one per line, natural for agents)
linear.create_issue({ title: "Fix bug", priority: 2, labels: ["bug", "urgent"] })
github.search_repos({ query: "mcp" })

// Data format (explicit structure)
[
  { tool: "linear.create_issue", ar
Highly Recommended
agents

wshobson/agents

wshobson

Intelligent automation and multi-agent orchestration for Claude Code

The most comprehensive Claude Code plugin ecosystem, covering full-stack development scenarios with a three-tier model strategy balancing performance and cost.

25.6k2.8k3 days ago
Highly Recommended
awesome-claude-skills

ComposioHQ/awesome-claude-skills

ComposioHQ

A curated list of awesome Claude Skills, resources, and tools for customizing Claude AI workflows

The most comprehensive Claude Skills resource list; connect-apps is a killer feature.

19.9k2.0k3 days ago
Recommended
oh-my-opencode

code-yeongyu/oh-my-opencode

code-yeongyu

The Best Agent Harness. Meet Sisyphus: The Batteries-Included Agent that codes like you.

Powerful multi-agent coding tool, but note OAuth limitations.

17.5k1.2k3 days ago
Highly Recommended
ui-ux-pro-max-skill

nextlevelbuilder/ui-ux-pro-max-skill

nextlevelbuilder

An AI SKILL that provide design intelligence for building professional UI/UX multiple platforms

Essential for designers; comprehensive UI/UX knowledge base.

15.3k1.5k3 days ago
Recommended
claude-mem

thedotmack/claude-mem

thedotmack

A Claude Code plugin that automatically captures everything Claude does during your coding sessions, compresses it with AI (using Claude's agent-sdk), and injects relevant context back into future sessions.

A practical solution for Claude's memory issues.

14.0k9143 days ago
Highly Recommended
planning-with-files

OthmanAdi/planning-with-files

OthmanAdi

Claude Code skill implementing Manus-style persistent markdown planning — the workflow pattern behind the $2B acquisition.

Context engineering best practices; an open-source implementation of Manus mode.

9.3k8113 days ago