Token导航 LogoToken导航TokenDH.com
MCP Agent Proxy logo
AI代理stdio官方级别未说明来源级核验

MCP Agent Proxy

MCP Server

clear-npx-cache

MCP代理工具,用于连接任何MCP客户端到任何代理服务器,通过简单的可组合原语创建“代理互联网”。

工具数

5

提示词数

0

GitHub Stars

10

资源数

0
TypeScriptAI代理工作流自动化

安装说明

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

作者 / 组织

mashh-lab

提供方

mashh-lab

最后核验

2026/5/17 20:19

运行时

Node.js

快速接入

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

命令预览

npx clear-npx-cache

详细介绍

MCP代理

](https://badge.fury.io/js/mcp-agent-proxy) ![License: MIT](https://opensource.org/licenses/MIT) ![CI](https://github.com/mashh-lab/mcp-agent-proxy/actions)

将任何MCP客户端连接到任何代理服务器,通过简单、可组合的原语创建“代理互联网”。

快速开始

将此添加到MCP客户端的配置中:

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "npx",
      "args": ["mcp-agent-proxy@latest"]
    }
  }
}

就是这样! 代理允许您的MCP客户端连接到不同的代理服务器,并将代理交互作为MCP工具公开。它会自动检测代理服务器类型并相应地进行调整。

https://github.com/user-attachments/assets/9eaf1d36-298f-430f-b9e8-37e921cce2d1

这有什么作用

我们提供 5个简单工具 让代理在无限的网络上发现、连接和编排:

工具目的
listAgents发现所有服务器上的可用代理
describeAgent获取智能路由的详细代理功能
callAgent使用智能冲突解决执行任何代理
connectServer在运行时动态添加新的代理服务器
disconnectServer删除动态连接的服务器

支持的服务器类型

  • 马斯特拉:支持本地和远程Mastra服务器
  • LangGraph:支持本地和远程LangGraph实例
  • 可扩展:插件架构使添加对其他代理框架的支持变得容易

网络效应

代理服务器本身可以是MCP客户端,创建递归代理网络:

Your MCP Client → MCP Proxy → Agent Server (Mastra/LangGraph) → Agents -> MCP Proxy -> Other Agent Servers → 🚀 Agents

一条配置线解锁了整个AI功能生态系统。

MCP合规性和功能

✅ 完全符合MCP 2025-03-26标准

  • 完成最新模型上下文协议规范的实现

🚀 多运输支持

  • 标准运输:标准MCP客户端集成(npx mcp-agent-proxy)
  • 流式HTTP:具有会话管理的现代基于HTTP的传输
  • 传统SSE:与现有SSE实现向后兼容
  • 自动检测:根据客户端功能在传输之间无缝切换

常见配置

多台服务器(混合类型)

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "npx",
      "args": ["mcp-agent-proxy"],
      "env": {
        "AGENT_SERVERS": "http://localhost:4111 http://localhost:2024"
      }
    }
  }
}

云+本地(混合Mastra和LangGraph)

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "npx",
      "args": ["mcp-agent-proxy"],
      "env": {
        "AGENT_SERVERS": "https://my-mastra.vercel.app http://localhost:2024"
      }
    }
  }
}

来源(发展)

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "node",
      "args": ["/path/to/mcp-agent-proxy/dist/mcp-server.js"],
      "env": {
        "AGENT_SERVERS": "http://localhost:4111"
      }
    }
  }
}

使用示例

基本代理呼叫:

Can you call the weatherAgent to get the current weather in New York City?

网络探索

Explore the agents you're connected to

智能冲突解决:

I need to use the weatherAgent from server1 specifically, not the default one

动态网络扩展:

Connect to the ML specialists at https://ml-specialists.vercel.app and then use their modelTrainer agent

环境变量

变量默认值描述
AGENT_SERVERS_(无)_空格/逗号分隔的服务器URL(支持Mastra和LangGraph)
MCP_SERVER_PORT3001代理服务器端口
MCP_TRANSPORThttp传输方式(stdio/http)

示例和高级用法

中的即用型配置 examples/ 目录:

有关高级配置选项,请参阅 配置.md.

故障排除

NPX问题:

npx clear-npx-cache
npx mcp-agent-proxy@latest

端口冲突:

"env": { "MCP_SERVER_PORT": "3002" }

连接问题:

  • 确保代理服务器正在运行且可访问
  • 检查防火墙设置和服务器URL
  • 对于LangGraph:默认端口通常为2024(langgraph dev)
  • 对于Mastra:默认端口通常为4111

调试模式:

DEBUG=mastra:* npx mcp-agent-proxy

开发与测试

验证工作流

我们实施了全面的验证工作流程,以确保代码质量和MCP协议合规性:

快速命令

# Quick validation (build + test + lint + format)
pnpm validate:quick

# Full validation (includes integration tests + health checks)
pnpm validate:full

# CI validation (includes coverage + dead code analysis)
pnpm validate:ci

单个命令

# Build and test
pnpm build
pnpm test
pnpm test:integration

# Code quality
pnpm lint
pnpm format
pnpm format:check

MCP协议测试

# Test MCP protocol compliance
pnpm mcp:test

# Test security features
pnpm security:test

# Manual server testing
pnpm start           # Start server
pnpm check          # Check running server (requires jq)

测试覆盖率

  • 总共355次测试 覆盖所有组件
  • 单元测试 适用于所有工具、插件和配置
  • 集成测试 符合MCP协议
  • 安全测试 用于源验证和会话管理
  • 健康检查 用于服务器监控

可用脚本

使用 pnpm run 查看所有可用脚本,或使用以下常见脚本:

pnpm dev             # Build and start development server
pnpm test            # Run all tests
pnpm test:watch      # Run tests in watch mode
pnpm build           # Build for production
pnpm lint            # Run ESLint
pnpm format          # Format code with Prettier

贡献

我们欢迎捐款!请查看我们的 贡献指南 了解详情。

许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。

______________________________________________________________________

_构建代理互联网,一次一个连接。_

目录标签

目录标签

TypeScriptAI代理工作流自动化代理连接本地部署MCP协议多传输支持智能路由动态网络扩展

接入字段

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

stdio

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

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

clear-npx-cache

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdionone部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP