返回市场
MCP代理PII编辑服务器

MCP代理PII编辑服务器

作者:growthspace-engineering11 星标更新:2025-11-20

项目介绍

<p align="center"> <a href="https://github.com/growthspace-engineering" target="blank"><img src="GS-logo.svg" width="250" alt="GrowthSpace Logo" /> </a> <h2 align="center"> @growthspace-engineering/gs-mcp-proxy-pii-redactor </h2> </p> <p align="center"> <a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/releases"> <img src="https://img.shields.io/github/v/release/growthspace-engineering/gs-mcp-proxy-pii-redactor?display_name=tag&label=latest&logo=npm&color=CB3837&style=for-the-badge"> </a> </p> <p align="center"> <a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/tags"> <img src="https://img.shields.io/github/v/tag/growthspace-engineering/gs-mcp-proxy-pii-redactor?filter=*-beta*&label=beta&logo=npm&color=CB3837&style=flat-square"> </a> <a href="https://growthspace-engineering.github.io/gs-mcp-proxy-pii-redactor/tests/branch/beta/combined-coverage/"> <img src="https://img.shields.io/endpoint?url=https://growthspace-engineering.github.io/gs-mcp-proxy-pii-redactor/tests/branch/beta/combined-coverage/badge.json&label=coverage&style=flat-square"> </a> <a href="https://github.com/semantic-release/semantic-release"><img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg"></a> <a href="#contributors-"><img src="https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square" alt="All Contributors"></a> </p> <p align="center"> MCP代理程序,具备PII信息屏蔽功能 </p> <hr>

一个MCP代理程序,通过单一HTTP入口点聚合多个MCP服务器,并内置了PII信息屏蔽功能。

功能

  • 代理多个MCP服务器:通过单一HTTP端点聚合来自多个服务器的工具、提示和资源。
  • 多种传输类型:支持stdiossestreamable-http客户端传输方式。
  • 服务器传输选项:通过Server-Sent Events (SSE)或可流式传输的HTTP提供服务。
  • PII信息屏蔽:使用基于GCS的词典和通用模式匹配自动屏蔽PII信息。
  • 工具过滤:根据服务器配置允许或阻止特定工具。
  • 认证:支持基于Bearer Token的认证,可以进行全局或每个服务器的配置。
  • 审计日志:可选的详细审计日志记录屏蔽操作。
  • 灵活配置:带有环境变量插值的JSON配置。

文档

快速开始

先决条件

  • Node.js >= 20(或等效的bun或pnpm)

方案1 — 使用stdio运行(推荐)

直接与您的IDE通过stdio集成。无需全局安装。

在配置IDE之前,初始化默认配置文件(默认创建~/gs-mcp-proxy/config.json):

gs-mcp-proxy --init
# 或不进行全局安装
npx -y @growthspace-engineering/gs-mcp-proxy-pii-redactor --init

参见使用以通过--init-dest自定义目标位置。

方案2 — 在IDE集成前本地运行(SSE/HTTP)

  1. 全局安装模块:
    npm install -g @growthspace-engineering/gs-mcp-proxy-pii-redactor
    
  2. 初始化默认配置文件(默认创建~/gs-mcp-proxy/config.json):
    gs-mcp-proxy --init
    
    参见使用以通过--init-dest自定义目标位置。
  3. 运行CLI(有或无配置文件):
    gs-mcp-proxy --config ~/gs-mcp-proxy/config.json
    # 或(如果存在则默认使用`./config.json`)
    gs-mcp-proxy
    
  4. 使用mcp-remote连接IDE(SSE或可流式传输的HTTP):

开发者设置(克隆、构建、本地运行)已移至CONTRIBUTING.md

最小配置(用于本地服务器)

{
  "mcpProxy": {
    "baseURL": "http://localhost:8084",
    "addr": ":8084",
    "name": "MCP代理程序,具备PII信息屏蔽功能",
    "version": "1.0.0",
    "type": "sse"
  },
  "mcpServers": {
    "github": {
      "transportType": "streamable-http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_TOKEN}"
      }
    }
  }
}

参见配置以获取完整的配置参考和示例。

测试

# 单元测试
npm test

# 端到端测试(需要GITHUB_TOKEN)
export GITHUB_TOKEN=your_token_here
npm run test:e2e

注意:所有端到端测试都需要有效的GITHUB_TOKEN环境变量。测试套件验证了SSE和可流式传输的HTTP传输选项。

贡献

欢迎贡献!请参阅CONTRIBUTING.md了解指南。

此项目遵循all-contributors规范。欢迎任何形式的贡献!

行为准则

本项目遵守行为准则。请在贡献前阅读CODE_OF_CONDUCT.md

贡献者

感谢以下这些杰出的人士(表情符号键):

<!-- ALL-CONTRIBUTORS-LIST:START - 不要删除或修改此部分 --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="http://thatkookooguy.kibibit.io/"><img src="https://avatars.githubusercontent.com/u/10427304?v=4?s=100" width="100px;" alt="Neil Kalman"/><br /><sub><b>Neil Kalman</b></sub></a><br /><a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/commits?author=thatkookooguy" title="代码">💻</a> <a href="#question-thatkookooguy" title="回答问题">💬</a> <a href="#blog-thatkookooguy" title="博客文章">📝</a> <a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/commits?author=thatkookooguy" title="文档">📖</a> <a href="#ideas-thatkookooguy" title="想法、规划及反馈">🤔</a> <a href="#infra-thatkookooguy" title="基础设施(托管、构建工具等)">🚇</a> <a href="#maintenance-thatkookooguy" title="维护">🚧</a> <a href="#research-thatkookooguy" title="研究">🔬</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Romarionijim"><img src="https://github.com/Romarionijim.png?s=100" width="100px;" alt="Romario Nijim"/><br /><sub><b>Romario Nijim</b></sub></a><br /><a href="#ideas-Romarionijim" title="想法、规划及反馈">🤔</a> <a href="#maintenance-Romarionijim" title="维护">🚧</a> <a href="#research-Romarionijim" title="研究">🔬</a> <a href="#question-Romarionijim" title="回答问题">💬</a></td> <td align="center" valign="top" width="1_28%"><a href="http://shaieliyahu.com"><img src="https://avatars.githubusercontent.com/u/74975334?v=4?s=100" width="100px;" alt="shai eliyahu"/><br /><sub><b>shai eliyahu</b></sub></a><br /><a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/pulls?q=is%3Apr+reviewed-by%3Aaheua10" title="审核拉取请求">👀</a></td> <td align="center" valign="top" width="14.28%"><a href="http://www.gla.co.il"><img src="https://avatars.githubusercontent.com/u/23203489?v=4?s=100" width="100px;" alt="Gal Amitai"/><br /><sub><b>Gal Amitai</b></sub></a><br /><a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/pulls?q=is%3Apr+reviewed-by%3AGalAmitai" title="审核拉取请求">👀</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/yevgenim"><img src="https://avatars.githubusercontent.com/u/29144954?v=4?s=100" width="100px;" alt="Yevgeni Mumblat"/><br /><sub><b>Yevgeni Mumblat</b></sub></a><br /><a href="#ideas-yevgenim" title="想法、规划及反馈">🤔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Utkarsh9571"><img src="https://avatars.githubusercontent.com/u/205407787?v=4?s=100" width="100px;" alt="Utkarsh9571"/><br /><sub><b>Utkarsh9571</b></sub></a><br /><a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/commits?author=Utkarsh9571" title="代码">💻</a> <a href="#example-Utkarsh9571" title="示例">💡</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/mNarraMine"><img src="https://avatars.githubusercontent.com/u/45209420?v=4?s=100" width="100px;" alt="Mr. Narra Mine"/><br /><sub><b>Mr. Narra Mine</b></sub></a><br /><a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/pulls?q=is%3Apr+reviewed-by%3AmNarraMine" title="审核拉取请求">👀</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/apps/allcontributors"><img src="https://avatars.githubusercontent.com/in/23186?v=4?s=100" width="100px;" alt="allcontributors[bot]"/><br /><sub><b>allcontributors[bot]</b></sub></a><br /><a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/commits?author=allcontributors[bot]" title="代码">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/gr0wth-b0t"><img src="https://avatars.githubusercontent.com/u/94817429?v=4?s=100" width="100px;" alt="gr0wth-b0t"/><br /><sub><b>gr0wth-b0t</b></sub></a><br /><a href="https://github.com/growthspace-engineering/gs-mcp-proxy-pii-redactor/commits?author=gr0wth-b0t" title="代码">💻</a></td> </tr> </tbody> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

工作原理

当您合并拉取请求时,我们的GitHub Actions工作流程会自动:

  • 将贡献者添加到.all-contributorsrc配置中
  • 更新此README中的贡献者部分
  • 创建一个包含更改的提交

您也可以手动添加贡献者:

npm run contributors:add

然后,allcontributors CLI会提示您输入贡献详情。

致谢

此项目受到以下项目的启发:

  • TBXark/mcp-proxy:一个Go语言编写的MCP代理服务器,通过单一HTTP端点聚合多个MCP服务器。
  • nestjs/nest:一个用于构建服务器端应用程序的渐进式Node.js框架。

许可证

MIT 2025