XU

xuleileon/utcp-mcp-gateway

API 开发

本页由 AI 翻译,技术细节请以原文为准。 查看原文

11 stars 3 forks 质量 65 趋势 18MIT

Save 90%+ Token Cost with Smart MCP Proxy

概览

🚀 The Smarter Way to Use MCP — Save 90%+ Tokens with Code Mode Inspired by Claude Skills' Progressive Disclosure claude skills alternative · mcp token optimization · progressive tool discovery · mcp response filtering I noticed Claude Skills works amazingly well — Claude dynamically discovers and loads only the skills it needs, avoiding context overload. But most agent frameworks? They dump 500+ tool definitions into the context at once. And MCP responses? Often 10,000+ chars of raw data that waste your tokens. Then I discovered UTCP — exactly what I needed! Progressive tool discovery built-in. And Cloudflare's Code Mode? One code block executes everything. Brilliant! So I built on top of UTCP: — the smarter way to use MCP. The best part? Just add one config block. Works with Claude Desktop, Windsurf, Cursor, Dify, and any MCP-compatible client. No extra servers needed.

README

以下为原文 README 节选,完整内容请查看原文。

utcp-mcp-gateway

🚀 The Smarter Way to Use MCP — Save 90%+ Tokens with Code Mode

English | 中文

Inspired by Claude Skills’ Progressive Disclosure

claude skills alternative · mcp token optimization · progressive tool discovery · mcp response filtering


The Story / 故事

I noticed Claude Skills works amazingly well — Claude dynamically discovers and loads only the skills it needs, avoiding context overload.

But most agent frameworks? They dump 500+ tool definitions into the context at once. And MCP responses? Often 10,000+ chars of raw data that waste your tokens.

Then I discovered UTCP — exactly what I needed! Progressive tool discovery built-in. And Cloudflare’s Code Mode? One code block executes everything. Brilliant!

So I built on top of UTCP: Progressive Discovery + Code Mode + LLM Filtering — the smarter way to use MCP.

The best part? Just add one config block. Works with Claude Desktop, Windsurf, Cursor, Dify, and any MCP-compatible client. No extra servers needed.

Looking for…?

  • ✅ Claude Skills alternative for your MCP setup
  • ✅ Better MCP tool management without context overload
  • ✅ Progressive tool discovery — load tools on demand
  • ✅ OpenAPI/Swagger to tools — register REST APIs as tools
  • ✅ MCP token optimization — reduce 90%+ token waste
  • ✅ MCP response filtering — smart summarization

You’re in the right place.

What is this?

LLMs are great at writing code, but terrible at tool calling.

Traditional MCP exposes tools directly to LLMs — but LLMs struggle with:

  • Too many tools (500+ definitions = confusion)
  • Huge responses (10,000+ chars = wasted tokens)
  • Multiple round trips (15+ API calls = slow & expensive)

utcp-mcp-gateway fixes all of this:

Problem Solution
500+ tool definitions Progressive Discovery — load only what’s needed
10,000+ char responses LLM Filtering — smart summarization (97% smaller!)
15+ API round trips Code Mode — one code block, one execution
Traditional:  User → LLM → Tool1 → LLM → Tool2 → LLM → Tool3 → Result
              (15+ calls, $26/day, slow)

Code Mode:    User → LLM writes code → Execute all at once → Result  
              (1 call, $0.87/day, fast)

Result: $9,536/year savings (benchmark source)

Features

Feature Description
🔌 Universal MCP Connect any HTTP or stdio MCP server
📜 OpenAPI Support Register REST APIs directly from OpenAPI/Swagger specs
在 GitHub 查看完整 README

安装

npx -y utcp-mcp-gateway
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "gateway": { "command": "npx", "args": ["-y", "utcp-mcp-gateway"], "env": { "MCP_URL": "https://mcp.context7.com/mcp", "MCP_NAME": "context7", "LLM_API_KEY": "sk-xxx", "LLM_BASE_URL": "https://api.openai.com/v1", "LLM_MODEL": "gpt-4o-mini" } } } }