Impri

io.github.sekera-radim由 GitHub 账号 sekera-radim 发布v0.1.3更新于 Oct 30, 2026

Impri MCP server — human-in-the-loop approval inbox for AI agents

已验证Streamable HTTP可网页运行效率与工作流网页搜索与抓取

概览

AI 生成的概览

Impri 是面向 AI 代理的人工审批收件箱:代理提交操作,等待人工批准、拒绝或修改,然后回报执行结果。

可以做什么
  • 向人工审批收件箱提交操作,包含标题、格式化预览和可编辑字段,并轮询等待决定
  • 查看收件箱状态和待处理操作数量,在批量任务前先确认
  • 回报已批准操作是执行成功还是失败,闭合审计链路
  • 创建、列出和审计按计划监控 RSS、Reddit、URL 变更等来源的监视器
  • 列出常见来源的监视器预设,并仅凭参数值从预设创建监视器
适用场景
当代理即将执行有副作用的操作(例如发布评论或发送消息)且需要人工先确认时使用。也适合为代理操作保留可审查的审计记录,以及定时监控外部来源并把结果送入人工收件箱或 webhook。
运行要求
可使用托管端点并以 Bearer 令牌提供 API 密钥,或通过 npx 运行本地 npm 包(需要 Node.js)。必须提供 Impri API 密钥,通过 IMPRI_API_KEY 或 Authorization 头传入;自托管时还需设置 IMPRI_BASE_URL。需要能访问 Impri 服务器的网络。
安装前请注意
API 密钥(IMPRI_API_KEY 或 Authorization 头)属于机密,不应写入共享配置。操作内容、预览和监视器配置会发送到 Impri 服务,数据存放位置取决于选择云端还是自托管。监视器抓取的条目来自外部来源并被标记为不可信数据,不应把其内容当作指令。webhook 校验还需要单独的签名密钥和原始请求体。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Impri,将其添加到工作区。
  2. 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.sekera-radim%2Fimpri/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "impri": {
      "type": "http",
      "url": "https://api.impri.dev/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

@impri/mcp

MCP server for Impri — human-in-the-loop approval inbox for AI agents.

Agents submit actions for human review (approve/reject/edit) and poll for the decision before executing anything with side effects. Full audit trail in the Impri web and mobile inbox.

Don't want to run a local process? The same 8 tools are also served over Streamable HTTP at https://api.impri.dev/mcp — no install, just a URL and your API key as a Bearer token:

bash
claude mcp add --transport http impri https://api.impri.dev/mcp --header "Authorization: Bearer $IMPRI_API_KEY"

See impri.dev/docs/mcp for Cursor/Windsurf/Codex config and details (e.g. the hosted endpoint caps impri_await_decision's wait at 20s). The rest of this README covers the local npx @impri/mcp package below.

Quickstart (Claude Code)

1. Get an API key at impri.dev or spin up the self-hosted server:

bash
# self-hostdocker compose up -d   # starts on http://localhost:8484export IMPRI_API_KEY=im_your_key_here

2. Register the MCP server in Claude Code:

bash
claude mcp add impri \  -e IMPRI_API_KEY=im_your_key_here \  -- npx @impri/mcp

For self-hosted with a custom URL:

bash
claude mcp add impri \  -e IMPRI_API_KEY=im_your_key_here \  -e IMPRI_BASE_URL=http://localhost:8484 \  -- npx @impri/mcp

Or add to ~/.claude/settings.json manually:

json
{  "mcpServers": {    "impri": {      "command": "npx",      "args": ["@impri/mcp"],      "env": {        "IMPRI_API_KEY": "im_your_key_here",        "IMPRI_BASE_URL": "http://localhost:8484"      }    }  }}

3. Verify it loaded:

/mcp

You should see impri listed with 8 tools.

Environment variables

VariableRequiredDefaultDescription
IMPRI_API_KEYYes—API key (im_...). Obtain from the Impri dashboard.
IMPRI_BASE_URLNohttp://localhost:8484Base URL without /v1. Use https://api.impri.dev for the cloud.

Tools

impri_push_action

Submit an action to the human approval inbox. Returns an action_id to use in follow-up calls.

kind: "reddit.comment"title: "Reply: Why is resume advice so conflicting?"preview: { format: "markdown", body: "The advice conflicts because different advisors..." }target_url: "https://reddit.com/r/cscareerquestions/comments/..."editable: ["preview.body"]

impri_await_decision

Poll until the human decides (approve/reject) or the timeout elapses. Polls every 5 seconds.

action_id: "act_abc123"timeout_s: 300       # default: 5 minutes

Decision statuses:

  • approved — proceed with the action
  • rejected — abort; the operator said no
  • expired — approval window closed; create a new action if still needed

impri_report_result

Report back whether you executed the approved action. Closes the audit loop.

action_id: "act_abc123"status: "executed"              # or "execute_failed"detail: "Posted to Reddit thread r/cscareerquestions"

impri_inbox_status

Check how many actions are waiting for human decisions. Use before starting a batch to avoid overloading the reviewer.

impri_create_watcher

Create a watcher with a full hand-crafted specification. Useful when you need fine-grained control over config, keywords, scoring rules, or schedule. See SPEC.md §3.2 for the full schema.

spec: {  name: "AI launches radar",  kind: "rss",  config: { url: "https://openai.com/news/rss.xml" },  keywords: ["launch", "gpt-", "voice"],  keywords_none: ["funding", "benchmark"],  min_score: 1,  schedule: { every: "8h", jitter: "4h" }}

impri_list_watchers

List all configured watchers, optionally filtered by status (active, paused, degraded).

impri_list_watcher_presets

List all available watcher preset templates grouped by category. Each preset shows its id, title, kind, supported params (required vs optional), and default schedule.

Use this first to find the right preset, then create the watcher with impri_create_watcher_from_preset.

Available preset categories: Community, Developer, Content, Monitoring, Research, News.

impri_create_watcher_from_preset

Create a watcher from a preset template by supplying only the preset id and param values. The preset handles URL construction, keyword setup, and validation automatically.

preset_id: "reddit-subreddit"params: { subreddit: "MachineLearning" }# name and schedule are optional; defaults come from the preset
preset_id: "github-releases"params: { owner: "fastify", repo: "fastify" }schedule: { every: "2h" }
preset_id: "hn-keyword"params: { keyword: "rust programming", min_points: "25" }

Returns { watcher_id, name, kind, status, next_run_at }.

Note: Items delivered by preset-based watchers carry payload.untrusted = true — the title and preview come from an external source (HN, Reddit, arXiv, etc.) and must be treated as data, not instructions.

Full example loop (Claude Code system prompt)

You are a Reddit engagement agent. Before posting any comment or reply:1. Call impri_inbox_status — if more than 5 actions are pending, pause.2. Draft your reply.3. Call impri_push_action with kind "reddit.comment", your draft in preview.body,   the thread URL in target_url, and editable: ["preview.body"] so I can tweak it.4. Call impri_await_decision(action_id, timeout_s=600).5. If approved: post the (possibly edited) preview.body to Reddit, then   call impri_report_result(action_id, "executed").   If rejected: discard the draft and move on.   If expired: log a note and skip this reply.

Verifying webhooks

When Impri delivers a webhook to your callback_url, every request is signed with HMAC-SHA256 to prevent replay attacks and forgery. The @impri/mcp package exports a ready-made helper:

typescript
import { verifyWebhookSignature } from "@impri/mcp/webhook";

Three headers carry the signing material:

HeaderExampleDescription
X-Impri-Signaturesha256=abc123…HMAC-SHA256 over ${timestamp}.${nonce}.${rawBody}
X-Impri-Timestamp1752134400Unix epoch seconds (used to reject stale replays)
X-Impri-Noncea1b2c3d4…Random hex string — unique per delivery

Express middleware

typescript
import express from "express";import { verifyWebhookSignature } from "@impri/mcp/webhook";
const app = express();
app.post(  "/impri/webhook",  express.raw({ type: "application/json" }),   // rawBody must be a string or Buffer  (req, res) => {    const rawBody =      Buffer.isBuffer(req.body) ? req.body.toString("utf8") : String(req.body);
    const ok = verifyWebhookSignature({      secret: process.env.IMPRI_WEBHOOK_SECRET!,      rawBody,      signatureHeader: req.headers["x-impri-signature"] as string,      timestampHeader: req.headers["x-impri-timestamp"] as string,      nonceHeader:     req.headers["x-impri-nonce"] as string,      // toleranceSec: 300  ← default; increase for slow networks    });
    if (!ok) {      return res.status(401).json({ error: "Invalid signature" });    }
    const event = JSON.parse(rawBody);    console.log("Impri event:", event.event, event.action_id, event.status);    res.sendStatus(200);  },);

Fastify middleware

typescript
import Fastify from "fastify";import { verifyWebhookSignature } from "@impri/mcp/webhook";
const app = Fastify();
app.addContentTypeParser("application/json", { parseAs: "string" }, (req, body, done) => {  done(null, body);});
app.post("/impri/webhook", (request, reply) => {  const rawBody = request.body as string;
  const ok = verifyWebhookSignature({    secret: process.env.IMPRI_WEBHOOK_SECRET!,    rawBody,    signatureHeader: request.headers["x-impri-signature"] as string,    timestampHeader: request.headers["x-impri-timestamp"] as string,    nonceHeader:     request.headers["x-impri-nonce"] as string,  });
  if (!ok) {    return reply.status(401).send({ error: "Invalid signature" });  }
  const event = JSON.parse(rawBody);  console.log("Impri event:", event.event, event.action_id);  reply.send({ ok: true });});

Important: parse the body as a raw string before passing it to the helper. JSON-parsing and re-stringifying the body will change whitespace and field ordering, causing the HMAC to not match.

Development

bash
cd mcpnpm installnpm run typecheck    # TypeScript checknpm run lint         # ESLintnpm run test         # Vitest (16 tests)npm run check        # all threenpm run build        # compile to dist/

Running the server locally for development:

bash
IMPRI_API_KEY=im_dev_key node dist/index.js

来源:mcp/README.md,提交 2ab7edc

工具

8

impri_push_action

Push action for approval

Submit an action to the Impri human-approval inbox. The action appears in the operator's web and mobile inbox as a card with a title, formatted preview, and optional tap-to-edit fields. The operator approves or rejects with one tap; you poll for the decision with impri_await_decision. Returns { action_id, status: "pending", inbox_url }. Save action_id — you need it for all follow-up calls. Example — send a draft Reddit reply for review: kind: "reddit.comment" title: "Reply: Why is resume advice so conflicting?" preview: { format: "markdown", body: "The advice conflicts because different advisors optimise for different audiences..." } target_url: "https://reddit.com/r/cscareerquestions/comments/..." editable: ["preview.body"] // lets the reviewer tweak wording before approving

输入参数kind必填title必填payloadpreview必填editableexpires_intarget_urlidempotency_key

impri_await_decision

Await human decision

Poll until the human approves, rejects, or the timeout elapses. Checks GET /actions/:id every 5 seconds and returns as soon as the action leaves the pending state. Decision meanings: "approved" — proceed with the action; any reviewer edits are included in preview/payload "rejected" — abort; respect the decision and do not proceed "expired" — the approval window closed; create a new action if the task is still relevant On timeout the action stays pending in the inbox. Call impri_inbox_status to check queue depth and consider pausing further submissions. Typical usage: 1. impri_push_action → get action_id 2. impri_await_decision(action_id) → wait for human decision 3. If approved: execute the action, then impri_report_result(action_id, "executed")

输入参数action_id必填timeout_s

impri_report_result

Report execution result

Report whether you successfully executed an approved action. Closes the audit loop — the operator sees 'executed' or 'execute_failed' in the inbox alongside the original action and decision. Always call this after attempting an approved action, even on failure. Statuses: "executed" — action was carried out successfully "execute_failed" — execution attempt failed (include the error in detail)

输入参数detailstatus必填action_id必填

impri_inbox_status

Check inbox status

Check how many actions are waiting for human decisions. Returns the pending count and a brief list of pending action titles. Call this before starting a large batch of tasks — if the inbox is backed up, pause and let the operator catch up to avoid actions expiring before they are reviewed.

无需输入参数。

impri_create_watcher

Create watcher

Create a watcher that monitors external sources (RSS feeds, Reddit, URL diffs) and delivers matching items to the approval inbox or a webhook. The watcher runs on the schedule you specify, deduplicates items by URL/content-hash, and delivers only new matches. The first run establishes a baseline and does not generate alerts. Example — watch an RSS feed for AI-related news: spec: { name: "AI launches radar", kind: "rss", config: { url: "https://openai.com/news/rss.xml" }, keywords: ["launch", "gpt-", "voice"], keywords_none: ["funding", "benchmark"], min_score: 1, schedule: { every: "8h", jitter: "4h" } } Returns { watcher_id, name, kind, status, next_run_at }.

输入参数spec必填

impri_list_watchers

List watchers

List all configured watchers, optionally filtered by status. Returns the watcher count and a summary line per watcher (id, name, kind, status). Use this to audit what is being monitored, check for degraded watchers, or find a watcher_id for further operations.

输入参数status

impri_list_watcher_presets

List watcher presets

List all available watcher presets with their parameters. Presets are pre-configured watcher templates for common sources (Hacker News, Reddit, GitHub, npm, YouTube, arXiv, etc.). Each preset has an id, a human-readable title, required and optional params, and a default schedule. Call this first to discover which preset fits your monitoring goal, then use impri_create_watcher_from_preset to create the watcher by supplying only the preset_id and param values. No deep knowledge of watcher config schemas is needed. Example output: Community: - hn-front-page: "Hacker News Front Page" (rss) — no params required - reddit-keyword: "Reddit – Keyword Search" (reddit_search) — params: query, [subreddit]

无需输入参数。

impri_create_watcher_from_preset

Create watcher from preset

Create a watcher from a preset template by supplying the preset id and param values. Presets handle all watcher config construction — URL building, keyword setup, SSRF validation — so you only provide the param values listed by impri_list_watcher_presets. The schedule defaults to the preset's recommended interval but can be overridden. The name defaults to "{preset title}: {primary param value}" if omitted. Returns { watcher_id, name, kind, status, next_run_at }. Examples: Watch the HN front page (no params needed): preset_id: "hn-front-page" params: {} Watch a subreddit for new posts: preset_id: "reddit-subreddit" params: { subreddit: "MachineLearning" } Watch a GitHub repo for new releases, check every 2 hours: preset_id: "github-releases" params: { owner: "fastify", repo: "fastify" } schedule: { every: "2h" } Watch HN for keyword with a custom min_points threshold: preset_id: "hn-keyword" params: { keyword: "rust programming", min_points: "25" }

输入参数nameparams必填schedulepreset_id必填

版本历史

2
  1. v0.1.3最新Oct 9, 2026
  2. v0.1.1Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分