Token导航 LogoToken导航TokenDH.com
mcpblox (Vivekhaldar) logo
AI代理stdio官方级别未说明来源级核验

mcpblox (Vivekhaldar)

MCP Server

mcpblox

mcpblox是一个可编程的MCP代理,通过自然语言转换提示重塑现有MCP服务器的工具功能,包括重命名、隐藏、组合工具等。

工具数

0

提示词数

0

GitHub Stars

4

资源数

0
TypeScriptClaude自然语言处理Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

vivekhaldar

提供方

vivekhaldar

最后核验

2026/5/17 20:22

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx mcpblox --upstream "your-mcp-server" --prompt "your transform"

详细介绍

mcpblox

一个可编程的MCP代理,可以使用任何现有的MCP服务器和自然语言 转换提示,并生成一个新的MCP服务器,其工具由该提示重塑。

  • 重命名 工具, 重新格式化 输出, 更改架构
  • 隐藏 你不需要的工具
  • 编排 将多种上游工具整合到新的 合成工具
  • 通过Unix管道将实例转换为多级转换管道

所有这些都不需要修改原始服务器。

安装

# Run directly with npx
npx mcpblox --upstream "your-mcp-server" --prompt "your transform"

# Or install globally
npm install -g mcpblox

快速开始

# 1. Proxy an MCP server unchanged (transparent pass-through)
mcpblox --upstream "npx @modelcontextprotocol/server-filesystem /tmp" --api-key $ANTHROPIC_API_KEY

# 2. Preview what transforms the LLM would apply (no server started)
mcpblox \
  --upstream "npx @modelcontextprotocol/server-filesystem /tmp" \
  --prompt "Rename read_file to cat and hide write_file" \
  --api-key $ANTHROPIC_API_KEY \
  --dry-run

# 3. Run with transforms applied
mcpblox \
  --upstream "npx @modelcontextprotocol/server-filesystem /tmp" \
  --prompt "Rename read_file to cat and hide write_file" \
  --api-key $ANTHROPIC_API_KEY

# 4. Point any MCP host at http://localhost:8000/mcp
curl http://localhost:8000/health

# 5. Chain transforms via Unix pipes
mcpblox --upstream "npx @modelcontextprotocol/server-filesystem /tmp" --prompt "Hide write_file" \
  | mcpblox --prompt "Rename read_file to cat" \
  | mcpblox --prompt "Format outputs as markdown"

运作原理

┌──────────┐      ┌──────────────────────────────────────────┐      ┌───────────┐
│          │      │               mcpblox                     │      │           │
│   MCP    │◄────►│  ┌────────┐  ┌───────────┐  ┌─────────┐ │◄────►│ Upstream  │
│   Host   │ HTTP │  │Exposed │  │ Transform │  │Upstream │ │stdio/│ MCP       │
│          │      │  │Server  │──│ Engine    │──│Client   │ │ HTTP │ Server    │
└──────────┘      │  └────────┘  └─────┬─────┘  └─────────┘ │      └───────────┘
                  │                    │                      │
                  │              ┌─────▼─────┐               │
                  │              │    LLM    │               │
                  │              │ (startup  │               │
                  │              │  codegen) │               │
                  │              └───────────┘               │
                  └──────────────────────────────────────────┘

在启动时,mcpblox:

  1. 连接到上游MCP服务器并发现其工具
  2. 将转换提示+工具定义发送到LLM
  3. LLM产生 改造计划 (哪些工具可以修改、隐藏、传递或组合成新的 synthetic 工具)
  4. 对于每个修改过的工具,LLM都会生成JavaScript转换函数
  5. 生成的代码在沙盒中运行 vm 上下文(无文件系统/网络访问)
  6. 结果被缓存——后续具有相同提示的启动程序将完全跳过LLM

在运行时,工具调用流经转换管道:输入参数被转换,上游工具被调用,输出在返回主机之前被转换。直通工具直接代理,没有开销。

CLI参考

mcpblox [options]

Upstream (required unless stdin is a pipe):
  --upstream          Upstream MCP server as stdio command
                               e.g., "npx @modelcontextprotocol/server-filesystem /tmp"
  --upstream-url          Upstream MCP server as HTTP/SSE URL
  --upstream-token      Bearer token for HTTP upstream (env: MCP_UPSTREAM_TOKEN)

Transform:
  --prompt               Transform prompt (inline)
  --prompt-file 
         Transform prompt from file

LLM:
  --provider             LLM provider: anthropic | openai (default: anthropic)
  --model                  LLM model ID (default: claude-sonnet-4-20250514 / gpt-4o)
  --api-key               LLM API key (env: ANTHROPIC_API_KEY | OPENAI_API_KEY)

Server:
  --port               HTTP server port (default: 8000, or 0 for OS-assigned when piped)

Cache:
  --cache-dir 
           Cache directory (default: .mcpblox-cache)
  --no-cache                   Disable caching, regenerate on every startup

Other:
  --dry-run                    Show the transform plan as JSON without starting the server
  --verbose                    Verbose logging (generated code, cache keys, tool call details)

没有 --prompt,mcpblox作为透明代理运行——所有工具都会原封不动地通过。

例子

重命名和重构工具:

mcpblox \
  --upstream "npx @mcp/server-github" \
  --prompt "Rename search_repositories to find_repos. For list_issues, add a max_results parameter (default 10) that truncates the output."

格式化输出:

mcpblox \
  --upstream "uvx mcp-server-yfinance" \
  --prompt "Format all numeric values in tool outputs with thousand separators and 2 decimal places. Prefix currency values with $."

隐藏不需要的工具:

mcpblox \
  --upstream "npx @modelcontextprotocol/server-filesystem /tmp" \
  --prompt "Hide write_file, create_directory, and move_file. Only expose read-only tools."

合成工具(将上游工具组合成新工具):

mcpblox \
  --upstream "uvx yfinance-mcp" \
  --prompt-file period-returns.txt \
  --port 18500

提示创建了一个 get_period_returns 调用工具 yfinance_get_price_history 四次(1个月、3个月、6个月和12个月),解析结果,并返回给定股票代码的计算回报——所有这些都是在一次工具调用中编排的。

连接到HTTP/SSE上游而不是stdio:

# Proxy an already-running MCP server over HTTP
mcpblox --upstream-url http://localhost:3000/mcp --api-key $ANTHROPIC_API_KEY

# With bearer token authentication
mcpblox --upstream-url http://localhost:3000/mcp \
  --upstream-token $MCP_TOKEN \
  --prompt "Hide admin tools" \
  --api-key $ANTHROPIC_API_KEY

从文件加载复杂提示:

mcpblox \
  --upstream "uvx yfinance-mcp" \
  --prompt-file transforms.txt \
  --api-key $ANTHROPIC_API_KEY

通过Unix管道链实例:

# Each instance reads its upstream URL from stdin and writes its own URL to stdout.
# Only the first instance needs --upstream.
mcpblox --upstream "node stock-server.js" --prompt "Add a max_results param to search" \
  | mcpblox --prompt "Format prices as USD with commas" \
  | mcpblox --prompt "Add caching hints to descriptions"

# Or feed an upstream URL via echo:
echo "http://localhost:3000/mcp" \
  | mcpblox --prompt "Hide admin tools" \
  | mcpblox --prompt "Format outputs as markdown"

当stdout是一个管道时,mcpblox绑定到操作系统分配的端口并写入其URL(例如。 http://localhost:57403/mcp)到stdout。下一个实例从stdin读取该URL。使用 --port 以覆盖自动分配的端口。

使用显式端口手动链接:

# First instance: modify tool schemas
mcpblox --upstream "node stock-server.js" --prompt "Add a max_results param to search" --port 8001 &

# Second instance: format the output of the first
mcpblox --upstream-url http://localhost:8001/mcp --prompt "Format prices as USD with commas" --port 8002

端点

端点方法描述
/mcpPOSTMCP协议(流式HTTP)
/healthGET健康检查--返回 {"status":"ok","tools":}

缓存

转换已缓存到磁盘中 .mcpblox-cache/ (可配置为 --cache-dir).缓存键是转换提示的哈希值与上游工具模式的哈希值的组合。如果任一更改,缓存将自动失效。

使用 --no-cache 以强制再生。使用 --dry-run 在不启动服务器的情况下预览计划。

安全

LLM生成的转换代码在受限的Node.js中运行 vm 无法访问文件系统、网络、进程环境或模块系统的上下文。沙盒仅提供数据操作原语(JSON、Math、String、Array等),输入/输出转换的执行超时为5秒,合成工具编排的执行超时则为30秒。

合成工具编排代码接收 callTool 桥接函数将调用限制为仅限于工具计划中声明的上游工具——它不能调用任意工具或访问沙盒之外的任何东西。

注:Node.js vm 不是一个完整的安全边界——对于受信任的用户上下文中的LLM生成的代码来说,这已经足够了,而不是对于任意不受信任的输入。

目录标签

目录标签

TypeScriptClaude自然语言处理MCP代理本地部署工具转换服务器代理LLM集成

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

mcpblox

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP