M

MCP Gateway Ygi

MCP Gateway是一個先進的AI基礎設施中間件解決方案,作為模型上下文協議(MCP)服務器的代理網關,提供統一接口、敏感信息過濾和生命週期管理功能。
3分
632

什麼是MCP網關?

MCP網關作為一箇中介,連接LLMs和其他MCP服務器。它管理服務器配置文件(mcp.json),攔截請求和響應以保護敏感信息,並提供統一的接口來發現和交互所有代理的MCP。

如何使用MCP網關?

通過安裝MCP網關並配置其插件,您可以輕鬆地管理和保護您的MCP服務器。只需幾步即可開始使用。

適用場景

MCP網關非常適合需要集中管理多個MCP服務器的企業環境,確保數據安全和操作效率。

主要功能

讀取服務器配置自動讀取位於根目錄下的mcp.json配置文件。
管理MCP服務器生命週期集中管理所有已配置的MCP服務器。
請求和響應攔截對敏感信息進行清理和保護。
統一接口提供一個統一的接口來發現和交互所有代理的MCP。

優勢與侷限性

優勢
集中管理多個MCP服務器。
保護敏感信息不被洩露。
提供統一的接口簡化操作流程。
侷限性
可能增加一定的系統複雜度。
依賴於正確的配置文件設置。

如何使用

安裝MCP網關
通過pip安裝MCP網關。
配置MCP網關
編輯mcp.json文件以添加您的MCP服務器配置。
啟動MCP網關
運行MCP網關服務。

使用案例

案例1:基本安全防護使用basic插件保護敏感信息。
案例2:Xetrack插件使用Xetrack插件跟蹤工具調用。

常見問題

如何安裝MCP網關?
MCP網關支持哪些插件?

相關資源

官方文檔
MCP協議的官方文檔。
GitHub倉庫
MCP網關的源碼倉庫。
安裝
複製以下命令到你的Client進行配置
{
  "mcpServers": {
      "mcp-gateway": {
          "command": "mcp-gateway",
          "args": [
              "--mcp-json-path",
              "~/.cursor/mcp.json",
              "--plugin",
              "basic",
              "--plugin",
              "xetrack"
          ],
          "servers": {
              "filesystem": {
                  "command": "npx",
                  "args": [
                      "-y",
                      "@modelcontextprotocol/server-filesystem",
                      "."
                  ]
              }
          }
      }
  }
}

{
  "mcpServers": {
      "mcp-gateway": {
          "command": "<python path>",
          "args": [
            "-m",
            "mcp_gateway.server",
            "--mcp-json-path",
            "<path to claude_desktop_config>",
            "--plugin",
            "basic"
          ],
          "servers": {
              "filesystem": {
                  "command": "npx",
                  "args": [
                      "-y",
                      "@modelcontextprotocol/server-filesystem",
                      "."
                  ]
              }
          }
      }
  }
}

{
  "mcpServers": {
      "mcp-gateway": {
          "command": "docker",
          "args": [
            "run",
            "--rm",
            "--mount", "type=bind,source=/Users/oro/Projects/playground/mcp-gateway,target=/app",
            "-i",
            "-v", "/Users/oro/.cursor/mcp.json:/config/mcp.json:ro",
            "-e", "LASSO_API_KEY=<LASSO_API_KEY>",
            "-v", "mcp-gateway-logs:/logs",
            "mcp/gateway:latest",
            "--mcp-json-path", "/config/mcp.json",
            "--plugin", "basic",
            "--plugin", "lasso"
          ],
          "servers": {
              "filesystem": {
                  "command": "npx",
                  "args": [
                      "-y",
                      "@modelcontextprotocol/server-filesystem",
                      "."
                  ]
              }
          }
      }
  }
}

{
  "mcpServers": {
      "mcp-gateway": {
          "command": "mcp-gateway",
          "args": [
              "--mcp-json-path",
              "~/.cursor/mcp.json",
              "-p",
              "lasso"
          ],
          "env": {
              "LASSO_API_KEY": "<lasso_token>"
          },
          "servers": {
              "filesystem": {
                  "command": "npx",
                  "args": [
                      "-y",
                      "@modelcontextprotocol/server-filesystem",
                      "."
                  ]
              }
          }
      }
  }
}

{
    "mcpServers": {
        "mcp-gateway": {
            "command": "mcp-gateway",
            "args": [
                "--mcp-json-path",
                "~/.cursor/mcp.json",
                "-p",
                "xetrack"
            ],
            "env": {
                "XETRACK_DB_PATH": "tracing.db",
                "XETRACK_LOGS_PATH": "logs/"                
            },
            "servers": {
                "filesystem": {
                    "command": "npx",
                    "args": [
                        "-y",
                        "@modelcontextprotocol/server-filesystem",
                        "."
                    ]
                }
            }
        }
    }
}
注意:您的密鑰屬於敏感信息,請勿與任何人分享。
精選MCP服務推薦
B
Baidu Map
已認證
百度地圖MCP Server是國內首個兼容MCP協議的地圖服務,提供地理編碼、路線規劃等10個標準化API接口,支持Python和Typescript快速接入,賦能智能體實現地圖相關功能。
Python
695
4.5分
M
Markdownify MCP
Markdownify是一個多功能文件轉換服務,支持將PDF、圖片、音頻等多種格式及網頁內容轉換為Markdown格式。
TypeScript
1.7K
5分
F
Firecrawl MCP Server
Firecrawl MCP Server是一個集成Firecrawl網頁抓取能力的模型上下文協議服務器,提供豐富的網頁抓取、搜索和內容提取功能。
TypeScript
3.8K
5分
S
Sequential Thinking MCP Server
一個基於MCP協議的結構化思維服務器,通過定義思考階段幫助分解複雜問題並生成總結
Python
245
4.5分
N
Notion Api MCP
已認證
一個基於Python的MCP服務器,通過Notion API提供高級待辦事項管理和內容組織功能,實現AI模型與Notion的無縫集成。
Python
111
4.5分
C
Context7
Context7 MCP是一個為AI編程助手提供即時、版本特定文檔和代碼示例的服務,通過Model Context Protocol直接集成到提示中,解決LLM使用過時信息的問題。
TypeScript
5.2K
4.7分
M
Magic MCP
Magic Component Platform (MCP) 是一個AI驅動的UI組件生成工具,通過自然語言描述幫助開發者快速創建現代化UI組件,支持多種IDE集成。
JavaScript
1.7K
5分
E
Edgeone Pages MCP Server
EdgeOne Pages MCP是一個通過MCP協議快速部署HTML內容到EdgeOne Pages並獲取公開URL的服務
TypeScript
244
4.8分
AIbase
智啟未來,您的人工智慧解決方案智庫
© 2025AIbase