HH

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

842 stars 65 forks 质量 64 趋势 42MIT

hoophq/hoop 是从 https://github.com/hoophq/hoop. 导入的 MCP 服务器候选

概览

hoophq/hoop 是从 https://github.com/hoophq/hoop. 导入的 MCP 服务器候选

概述(AI 翻译)

代理的运行时控制

数据和上下文使代理变得有用。运行时控制使它们安全。 一个开源的边车。一个二进制文件,一个配置文件,MIT。

你的经纪人所见

查询运行。敏感字段保持隐藏。

掩蔽会在内存中重写响应。请求本身永远不会被触及。

该声明从未进入数据库。

这是真正的pgwire错误,带有你配置中写的消息。代理会读取拒绝原因,而不是猜断连接。

代理永远不知道sidecar的存在。没有SDK,没有提示更改,也没有代理端配置。

安装

配置

一个文件。这个文件会涂黑邮件,并拒绝破坏性SQL代码。

跑

完全没有配置的情况下,边车还是会启动:一个环回URL, 转发到入门指南。它检查 没有交通——它存在,所以你的第一次运行是正常的——终端会告诉你怎么做 用真正的配置替换它。

把你的代理指向127.0.0.1:15432,而不是数据库。你的代理只改变一件事:连接字符串中的端口。边车运行在你的数据库旁边,而不是替代它。

四大控制

**数据掩蔽。

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

README

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

Runtime control for agents

Data and context make agents useful. Runtime controls make them safe. An open-source sidecar. One binary, one config file, MIT.

What Your Agent Sees

The query runs. The sensitive fields stay hidden.

> pull the customer list for the churn report

● postgres(SELECT name, email FROM customers)
  ⎿  name           email
     Ada Lovelace   [REDACTED:EMAIL_ADDRESS]
     Grace Hopper   [REDACTED:EMAIL_ADDRESS]
     hoop.dev · emails redacted at the wire

Masking rewrites the response in memory. The request itself is never touched.

The statement never reaches the database.

> clean up the old test rows in customers

● postgres(DELETE FROM customers WHERE id = 1)
  ⎿  FATAL:  destructive statements are not permitted
     hoop.dev · guardrail: no-destructive-sql

A real pgwire error carrying the message you wrote in the config. The agent reads why it was refused instead of guessing at a dropped connection.

The agent never knows the sidecar exists. No SDK, no prompt changes, no agent-side config.

Install

brew tap hoophq/brew https://github.com/hoophq/brew.git
brew install hoop

Configure

One file. This one redacts emails and refuses destructive SQL.

log_level: info

admin:
  listen: 127.0.0.1:19000        # /healthz /stats /config /events

mask:                            # Data Masking
  enabled: true
  rules:
    - {name: emails, entity: EMAIL_ADDRESS, strategy: redact}

policy:                          # Guardrails
  enforce: true
  rules:
    - name: no-destructive-sql
      type: operation
      operations: [drop, delete, truncate]
guardails:
  rules:
    - name: no-destructive-sql
      type: operation
      operations: [drop, delete, truncate]
      message: destructive statements are not permitted

listeners:
  - name: localdb
    protocol: postgres           # postgres | mssql | http
    listen: 127.0.0.1:15432      # where clients connect
    upstream: 127.0.0.1:5432     # your real resource
    connection: localdb

Run

hoop start sidecar                                # no config: a built-in default
hoop start sidecar --config config.yaml           # start
hoop start sidecar --config config.yaml --validate # check the config, then exit
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →