mcp-feedback 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -4
- package/agentdist.json +40 -0
- package/dist/cli.d.ts +5 -2
- package/dist/cli.js +26 -28
- package/dist/conformance-cases.js +15 -4
- package/dist/drizzle.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/ingest/cli.d.ts +8 -0
- package/dist/ingest/cli.js +270 -0
- package/dist/ingest/github.d.ts +40 -0
- package/dist/ingest/github.js +80 -0
- package/dist/ingest/handler.d.ts +84 -0
- package/dist/ingest/handler.js +447 -0
- package/dist/ingest/index.d.ts +3 -0
- package/dist/ingest/index.js +5 -0
- package/dist/ingest/protocol.d.ts +203 -0
- package/dist/ingest/protocol.js +78 -0
- package/dist/ingest/tokens.d.ts +84 -0
- package/dist/ingest/tokens.js +163 -0
- package/dist/install.d.ts +3 -0
- package/dist/install.js +27 -0
- package/dist/reader.js +6 -1
- package/dist/register.d.ts +36 -4
- package/dist/register.js +45 -21
- package/dist/remote.d.ts +66 -0
- package/dist/remote.js +399 -0
- package/dist/store.d.ts +17 -0
- package/dist/store.js +5 -0
- package/dist/stores/memory.js +3 -1
- package/dist/stores/sql.js +5 -0
- package/dist/tools.d.ts +8 -1
- package/dist/tools.js +18 -3
- package/dist/types.d.ts +4 -0
- package/package.json +13 -3
- package/skills/add-feedback-to-mcp-server/SKILL.md +24 -3
- package/skills/add-feedback-to-mcp-server/references/remote-ingest.md +84 -0
- package/skills/read-feedback/SKILL.md +3 -1
- package/skills/set-up-feedback-reading/SKILL.md +2 -1
- package/dist/setup.d.ts +0 -14
- package/dist/setup.js +0 -110
package/README.md
CHANGED
|
@@ -8,13 +8,13 @@ npm install mcp-feedback
|
|
|
8
8
|
|
|
9
9
|
The language-neutral spec (record schema, tool definitions, store contract, SQL layout) lives in the [repository](https://github.com/krishchow/feedback).
|
|
10
10
|
|
|
11
|
-
The package also carries agent skills for adding feedback to a server, recording a project's own facts about where its feedback is read, and reading and closing it out.
|
|
11
|
+
The package also carries agent skills for adding feedback to a server, recording a project's own facts about where its feedback is read, and reading and closing it out. Install them into a repository's agent harnesses (Claude Code, Codex, Cursor and others) with:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npx -y mcp-feedback@latest
|
|
14
|
+
npx -y mcp-feedback@latest install --local # or --user, for every project
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Run it again after upgrading
|
|
17
|
+
Run it again after upgrading. It only replaces or removes files it wrote, and backs up any you edited first; `uninstall` takes them back out and `status` shows where they are.
|
|
18
18
|
|
|
19
19
|
## Use
|
|
20
20
|
|
|
@@ -48,6 +48,88 @@ app.post("/mcp/feedback", bearer(process.env.MAINTAINER_TOKEN, "myapp-maintainer
|
|
|
48
48
|
|
|
49
49
|
The agent endpoint's `clientId` ends up in each record's `identity`, and the reader endpoint's in `triaged_by`. The repository has a [runnable example](https://github.com/krishchow/feedback/tree/main/examples/express-server).
|
|
50
50
|
|
|
51
|
+
## Servers that run on their users' machines
|
|
52
|
+
|
|
53
|
+
A stdio server started with `npx`, or any server that runs on each user's machine, has no store its maintainer can read: a SQLite file there is never seen. Send its feedback to a hub you run instead. The hub writes into an ordinary store, which the reader tools and CLI read as above.
|
|
54
|
+
|
|
55
|
+
**1. Keys and a project key**, once, on your machine:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
mcp-feedback ingest keygen --out ingest-key.json # keep this file private
|
|
59
|
+
mcp-feedback ingest issue-key --project my-server --key ingest-key.json --issuer https://feedback.example.com
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The project key is public by design: it ships in your package and can only enrol an installation.
|
|
63
|
+
|
|
64
|
+
**2. The server**, using the project key:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { registerFeedback, feedbackConfirmInstructions } from "mcp-feedback";
|
|
68
|
+
import { feedbackDisabled, remoteStore } from "mcp-feedback/remote";
|
|
69
|
+
|
|
70
|
+
if (!feedbackDisabled()) {
|
|
71
|
+
const store = remoteStore({ endpoint: "https://feedback.example.com", projectKey: "eyJhbGciOiJFZERTQSIs…" });
|
|
72
|
+
registerFeedback(server, { store, requireConfirmation: true, destination: "the my-server maintainers" });
|
|
73
|
+
void store.start(); // renews this machine's token, sends reports that could not go last time
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
On first use the installation enrols and gets its own token, kept in a per-user state directory. `start()` renews that token whenever the server starts and the token is more than a day old, so a machine in use keeps the same identity indefinitely; it contacts the hub only on a machine that has used feedback before. When the hub cannot be reached, the report is saved there and sent later, and the tool tells the agent where it is waiting; deleting the file cancels it. A report the hub refuses is not kept. `destination` adds a sentence to the tool's description saying where reports go, so the user knows before confirming. Users can turn feedback off with `MCP_FEEDBACK_DISABLED=1`.
|
|
78
|
+
|
|
79
|
+
**Reports as a GitHub user instead of an anonymous installation.** For your own and your team's tools, pass `signIn: "github"` (the hub needs GitHub sign-in turned on; see `hub/README.md`). The first report asks the user, through the agent, to open github.com/login/device and enter a code; the report waits on disk and goes out as soon as they approve. The sign-in is kept in the per-user state directory, shared by every server on the machine that reports to the same hub, and renewed by `start()`, so each machine signs in once. Reports then carry `identity.subject` = `github:<login>`. GitHub's own credential stays on the hub, which asks for no access beyond who the user is and discards it after reading their login.
|
|
80
|
+
|
|
81
|
+
**3. The hub.** One hub serves every server you distribute. Each server's reports are kept under its project name (`server.name`) in one store, and the hub accepts any project your key issued a project key for, so a new server needs a project key and nothing else. `hub/` in the repository has a Dockerfile and deployment notes; or run it directly:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
MCP_FEEDBACK_READER_TOKEN=… mcp-feedback ingest serve --postgres "$DATABASE_URL" --key ingest-key.json \
|
|
85
|
+
--issuer https://feedback.example.com --port 8787 [--project a --project b] [--trust-proxy] [--revoked revoked.txt]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`--project`, repeated, accepts only the projects listed. With `MCP_FEEDBACK_READER_TOKEN` set, the hub also serves the reader tools for every project at `/mcp`, so one URL and one credential reach all of it:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
MCP_FEEDBACK_URL=https://feedback.example.com/mcp MCP_FEEDBACK_TOKEN=… mcp-feedback stats # by_server shows each project
|
|
92
|
+
MCP_FEEDBACK_URL=https://feedback.example.com/mcp MCP_FEEDBACK_TOKEN=… mcp-feedback list --server my-server
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**No separate host? Mount the hub in a server you already host.** The hub is a request handler, so an HTTP MCP server you already run (or any web app) can be the hub, and its existing store and reader endpoint then hold your stdio servers' feedback too. For an Express app:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
import { createIngestHandler, toNodeListener } from "mcp-feedback/ingest";
|
|
99
|
+
|
|
100
|
+
const key = JSON.parse(process.env.MCP_FEEDBACK_INGEST_KEY!); // the file `mcp-feedback ingest keygen` wrote
|
|
101
|
+
const ingest = createIngestHandler({
|
|
102
|
+
issuer: "https://app.example.com/api/ingest", // any stable string; tokens name it
|
|
103
|
+
basePath: "/api/ingest", // routes: /api/ingest/v1/enroll, /api/ingest/v1/feedback
|
|
104
|
+
keyring: { keys: [{ kid: key.kid, publicKey: key.publicKey }], signer: { kid: key.kid, privateKey: key.privateKey } },
|
|
105
|
+
store: feedbackStore, // the server's own store: one queue, read through its reader endpoint
|
|
106
|
+
tokenFingerprintKey: process.env.FEEDBACK_FINGERPRINT_KEY,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
app.use("/api/ingest", toNodeListener(ingest)); // 1. first (with Express, req.ip gives the client address)
|
|
110
|
+
app.use("/api", requireBearer); // 2. the app's own auth, which ingest must not go through
|
|
111
|
+
app.use(express.json()); // 3. body parsing, which would consume the hub's request body
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
- **Order matters.** Register the hub before the app's authentication middleware, which would refuse installations (they bring their own signed tokens), and before any body parser. Or exempt its path from both.
|
|
115
|
+
- **Pick a path the deployment routes to the app.** If only `/api` reaches the server, mount under `/api/…`, with the same prefix as `basePath`.
|
|
116
|
+
- Installations use the mount point as their endpoint: `remoteStore({ endpoint: "https://app.example.com/api/ingest", … })`. Issue project keys with `--issuer` set to the same `issuer` string.
|
|
117
|
+
- Records the server's own `submit_feedback` writes keep their authenticated caller; records from installations carry an `ingest:*` scope and their project as `server.name`, so readers can tell them apart and use `--server`.
|
|
118
|
+
- Moving to a dedicated hub later means redeploying with the same key and issuer and changing the endpoint in the next release of each server. Installations on old releases keep sending to the old one, so keep it mounted until they have upgraded.
|
|
119
|
+
|
|
120
|
+
Elsewhere (Workers, Deno, Bun), the handler itself is a web-standard `(Request) => Promise<Response>`; use the `projects` option to accept only listed projects or give one a store of its own.
|
|
121
|
+
|
|
122
|
+
Read it like any other store: a reader endpoint over the same store (`registerFeedbackReader`), or `mcp-feedback list --postgres … --server my-server`.
|
|
123
|
+
|
|
124
|
+
**What a signature does and does not prove.** The hub's key signs every token, and the hub only accepts its own signatures, so forged and expired tokens are refused before anything is read. Each record says which kind of token sent it, in `identity.scopes`:
|
|
125
|
+
|
|
126
|
+
| Scope | Sent with | Means |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| `ingest:install` | The token an installation got by enrolling | Anonymous. Records with the same `identity.subject` come from one installation. Anyone with the package can enrol. |
|
|
129
|
+
| `ingest:issued` | A token naming a person: `github:<login>` after GitHub sign-in, or one you issued with `mcp-feedback ingest issue-token --project my-server --subject alice@example.com` and passed to `remoteStore` as `token` | From that person. |
|
|
130
|
+
|
|
131
|
+
The content of every report is untrusted, whichever token sent it. The hub stamps identity, project, time and status itself and ignores those fields in the request; it limits reports per installation, per issued subject and per project each day; and revoking a `jti` or a subject refuses that token from then on. The protocol is in `spec/ingest.md`.
|
|
132
|
+
|
|
51
133
|
## The feedback loop
|
|
52
134
|
|
|
53
135
|
1. **Collect.** Agents call `submit_feedback` when a tool fails them. Each record starts as `new`.
|
|
@@ -184,4 +266,4 @@ const store = defineFeedbackStore({ insert, get, list, updateTriage, stats });
|
|
|
184
266
|
await runStoreConformance(store); // rejects on the first failing case
|
|
185
267
|
```
|
|
186
268
|
|
|
187
|
-
The package does not rate-limit submissions; rely on your server's existing limits.
|
|
269
|
+
The package does not rate-limit submissions; rely on your server's existing limits. The ingest hub is the exception: it has daily quotas of its own.
|
package/agentdist.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/agentdist@0.1.0/schema/agentdist.schema.json",
|
|
3
|
+
"engine": "v1",
|
|
4
|
+
"name": "mcp-feedback",
|
|
5
|
+
"version": "0.7.0",
|
|
6
|
+
"description": "Agent feedback for MCP servers: skills for adding the mcp-feedback library to a server and updating the server's own skills to use it, for recording a project's own facts about where its feedback is read, and for reading, working through and closing out what was collected, over the mcp-feedback CLI or MCP reader tools.",
|
|
7
|
+
"skills": "./skills",
|
|
8
|
+
"namespace": "none",
|
|
9
|
+
"listing": {
|
|
10
|
+
"displayName": "mcp-feedback",
|
|
11
|
+
"shortDescription": "Collect and act on agent feedback for MCP servers",
|
|
12
|
+
"longDescription": "Adds a feedback loop to MCP servers. Agents using a server file structured feedback about failures, friction and missing capabilities; each report is tied to the authenticated caller and stored in SQLite, Postgres or a store you write. One skill covers integrating the library into a server and updating the server's own skills so agents file good feedback; one records a project's own facts about where its feedback is read; one covers reading, clustering, working through and closing out what was collected.",
|
|
13
|
+
"category": "Developer Tools",
|
|
14
|
+
"keywords": ["mcp", "feedback", "agents", "skills"],
|
|
15
|
+
"defaultPrompts": [
|
|
16
|
+
"Add agent feedback to this MCP server",
|
|
17
|
+
"Set this project up for reading its feedback",
|
|
18
|
+
"Summarize the feedback agents filed this week",
|
|
19
|
+
"Close out the feedback we fixed in the last release"
|
|
20
|
+
],
|
|
21
|
+
"author": { "name": "krishchow" },
|
|
22
|
+
"homepage": "https://github.com/krishchow/feedback",
|
|
23
|
+
"repository": "https://github.com/krishchow/feedback",
|
|
24
|
+
"license": "MIT"
|
|
25
|
+
},
|
|
26
|
+
"pack": {
|
|
27
|
+
"claude-plugin": {
|
|
28
|
+
"marketplace": {
|
|
29
|
+
"description": "Skills for adding agent feedback to an MCP server and for reading and closing out what agents report."
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"codex-plugin": {
|
|
33
|
+
"capabilities": ["Read", "Write"],
|
|
34
|
+
"marketplace": {
|
|
35
|
+
"pluginDisplayName": "mcp-feedback — agent feedback for MCP servers",
|
|
36
|
+
"policy": { "installation": "AVAILABLE" }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
package/dist/cli.d.ts
CHANGED
|
@@ -8,8 +8,11 @@ export interface CliIo {
|
|
|
8
8
|
stdin?: Readable;
|
|
9
9
|
stdout?: Writable;
|
|
10
10
|
env: Record<string, string | undefined>;
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/** Test seam for install and its siblings: the home and repository they write to. */
|
|
12
|
+
installDirs?: {
|
|
13
|
+
home: string;
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
};
|
|
13
16
|
/** Test seam: supply the store instead of opening one from flags. */
|
|
14
17
|
openStore?: () => Promise<FeedbackStore>;
|
|
15
18
|
}
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Reader CLI: the same operations as the MCP reader tools, either straight
|
|
3
|
-
// against the store or through a server's reader endpoint (--mcp). Also `
|
|
4
|
-
// which
|
|
3
|
+
// against the store or through a server's reader endpoint (--mcp). Also `install`
|
|
4
|
+
// and its siblings, which put the agent skills into a project's or the user's harnesses.
|
|
5
5
|
import { realpathSync } from "node:fs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { userInfo } from "node:os";
|
|
@@ -23,8 +23,12 @@ Commands:
|
|
|
23
23
|
reopen <id...> Set status back to new
|
|
24
24
|
serve Serve the reader tools as a stdio MCP server, for agent sessions
|
|
25
25
|
(stdout carries the protocol; messages go to stderr)
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
install Install the agent skills into this project (--local) or for you in
|
|
27
|
+
every project (--user); asks which harnesses. Run install --help.
|
|
28
|
+
uninstall Remove what install wrote
|
|
29
|
+
status Where the skills are installed
|
|
30
|
+
ingest <command> Keys, tokens and a hub for collecting feedback from installed copies
|
|
31
|
+
of a server (stdio servers). Run mcp-feedback ingest --help.
|
|
28
32
|
|
|
29
33
|
Source (one is required):
|
|
30
34
|
--mcp <url> A server's reader endpoint (or MCP_FEEDBACK_URL). Sends
|
|
@@ -35,7 +39,7 @@ Source (one is required):
|
|
|
35
39
|
--table <name> Table name, default mcp_feedback (with --db or --postgres)
|
|
36
40
|
|
|
37
41
|
Filters (stats, list, export):
|
|
38
|
-
--kind <k> --status <s> --severity <s> --subject <s> --tool <name> --tag <t>
|
|
42
|
+
--kind <k> --status <s> --severity <s> --subject <s> --server <name> --tool <name> --tag <t>
|
|
39
43
|
--since <iso> --until <iso> --ref <key=value> (an id in context.references)
|
|
40
44
|
|
|
41
45
|
Other:
|
|
@@ -46,9 +50,6 @@ Other:
|
|
|
46
50
|
--clear-note Remove the triage note
|
|
47
51
|
--dismiss With close: mark dismissed instead of resolved
|
|
48
52
|
--read-only With serve: leave out update_feedback_triage
|
|
49
|
-
--dir <path> With setup: install into this directory instead
|
|
50
|
-
--force With setup: replace skill files that were changed in the project
|
|
51
|
-
--dry-run With setup: report what would be written
|
|
52
53
|
--by <name> Recorded as triaged_by (default: your username; with --mcp
|
|
53
54
|
the server records the credential's identity instead)
|
|
54
55
|
--text Human-readable output instead of JSON
|
|
@@ -158,10 +159,24 @@ async function serve(reader, values, io) {
|
|
|
158
159
|
await server.close();
|
|
159
160
|
return 0;
|
|
160
161
|
}
|
|
162
|
+
/** Handed to agentdist, which installs the agent skills into harnesses. */
|
|
163
|
+
const INSTALL_COMMANDS = ["install", "uninstall", "status", "harnesses"];
|
|
161
164
|
/** Runs the CLI and resolves the process exit code. */
|
|
162
165
|
export async function runCli(argv, io) {
|
|
163
166
|
let reader;
|
|
164
167
|
try {
|
|
168
|
+
// agentdist parses these itself, with flags of its own.
|
|
169
|
+
if (INSTALL_COMMANDS.includes(argv[0] ?? "")) {
|
|
170
|
+
const { installCli } = await import("./install.js");
|
|
171
|
+
return await installCli(argv, io);
|
|
172
|
+
}
|
|
173
|
+
if (argv[0] === "setup") {
|
|
174
|
+
throw new FeedbackInputError("setup was replaced by install: npx -y mcp-feedback@latest install --local, or --user for every project.");
|
|
175
|
+
}
|
|
176
|
+
if (argv[0] === "ingest") {
|
|
177
|
+
const { runIngestCli } = await import("./ingest/cli.js");
|
|
178
|
+
return await runIngestCli(argv.slice(1), io);
|
|
179
|
+
}
|
|
165
180
|
let parsed;
|
|
166
181
|
try {
|
|
167
182
|
parsed = parseArgs({
|
|
@@ -177,6 +192,7 @@ export async function runCli(argv, io) {
|
|
|
177
192
|
status: { type: "string" },
|
|
178
193
|
severity: { type: "string" },
|
|
179
194
|
subject: { type: "string" },
|
|
195
|
+
server: { type: "string" },
|
|
180
196
|
tool: { type: "string" },
|
|
181
197
|
tag: { type: "string" },
|
|
182
198
|
since: { type: "string" },
|
|
@@ -190,9 +206,6 @@ export async function runCli(argv, io) {
|
|
|
190
206
|
by: { type: "string" },
|
|
191
207
|
text: { type: "boolean" },
|
|
192
208
|
"read-only": { type: "boolean" },
|
|
193
|
-
dir: { type: "string" },
|
|
194
|
-
force: { type: "boolean" },
|
|
195
|
-
"dry-run": { type: "boolean" },
|
|
196
209
|
help: { type: "boolean", short: "h" },
|
|
197
210
|
},
|
|
198
211
|
});
|
|
@@ -208,28 +221,13 @@ export async function runCli(argv, io) {
|
|
|
208
221
|
}
|
|
209
222
|
if (values["read-only"] && command !== "serve")
|
|
210
223
|
throw new FeedbackInputError("--read-only only applies to serve.");
|
|
211
|
-
if (command !== "setup" && (values.dir !== undefined || values.force || values["dry-run"])) {
|
|
212
|
-
throw new FeedbackInputError("--dir, --force and --dry-run only apply to setup.");
|
|
213
|
-
}
|
|
214
|
-
if (command === "setup") {
|
|
215
|
-
if (ids.length)
|
|
216
|
-
throw new FeedbackInputError("setup takes no arguments; use --dir <path> to choose where.");
|
|
217
|
-
const { setupSkills } = await import("./setup.js");
|
|
218
|
-
return setupSkills({
|
|
219
|
-
cwd: io.cwd ?? process.cwd(),
|
|
220
|
-
dir: values.dir,
|
|
221
|
-
force: values.force,
|
|
222
|
-
dryRun: values["dry-run"],
|
|
223
|
-
version,
|
|
224
|
-
out: io.out,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
224
|
const status = oneOf("status", values.status, FEEDBACK_STATUSES);
|
|
228
225
|
const filter = normalizeFilter({
|
|
229
226
|
kind: oneOf("kind", values.kind, FEEDBACK_KINDS),
|
|
230
227
|
status,
|
|
231
228
|
severity: oneOf("severity", values.severity, FEEDBACK_SEVERITIES),
|
|
232
229
|
subject: values.subject,
|
|
230
|
+
server: values.server,
|
|
233
231
|
tool: values.tool,
|
|
234
232
|
tag: values.tag,
|
|
235
233
|
since: values.since,
|
|
@@ -266,7 +264,7 @@ export async function runCli(argv, io) {
|
|
|
266
264
|
json(stats);
|
|
267
265
|
else {
|
|
268
266
|
io.out(`total: ${stats.total}`);
|
|
269
|
-
for (const group of ["by_status", "by_kind", "by_severity", "by_tool"]) {
|
|
267
|
+
for (const group of ["by_server", "by_status", "by_kind", "by_severity", "by_tool"]) {
|
|
270
268
|
const counts = Object.entries(stats[group]).sort((a, b) => b[1] - a[1]);
|
|
271
269
|
io.out(`${group.slice(3)}: ${counts.map(([key, count]) => `${key}=${count}`).join(", ") || "-"}`);
|
|
272
270
|
}
|
|
@@ -25,7 +25,7 @@ function record(n, created_at, fields, context = {}) {
|
|
|
25
25
|
client_version: "1.0.0",
|
|
26
26
|
user_agent: null,
|
|
27
27
|
},
|
|
28
|
-
server: { name: "conformance-server", version: "1.0.0" },
|
|
28
|
+
server: fields.server === null ? { name: null, version: null } : { name: fields.server ?? "conformance-server", version: "1.0.0" },
|
|
29
29
|
status: "new",
|
|
30
30
|
triage_note: null,
|
|
31
31
|
triaged_by: null,
|
|
@@ -46,8 +46,8 @@ export const conformanceRecords = [
|
|
|
46
46
|
server_context: { version: "1.2.3", job: { id: "job-9", state: "failed", attempts: [1, 2] } },
|
|
47
47
|
}),
|
|
48
48
|
record(3, "2026-01-03T00:00:00.000Z", { kind: "feature_request", severity: "none", tags: [], subject: "alice", tools: [] }),
|
|
49
|
-
record(4, "2026-01-03T00:00:00.000Z", { kind: "friction", severity: "minor", tags: ["docs"], subject: null, tools: ["list_orders"] }),
|
|
50
|
-
record(5, "2026-01-04T00:00:00.000Z", { kind: "praise", severity: "none", tags: [], subject: "bob", tools: [] }),
|
|
49
|
+
record(4, "2026-01-03T00:00:00.000Z", { kind: "friction", severity: "minor", tags: ["docs"], subject: null, tools: ["list_orders"], server: null }),
|
|
50
|
+
record(5, "2026-01-04T00:00:00.000Z", { kind: "praise", severity: "none", tags: [], subject: "bob", tools: [], server: "other-server" }),
|
|
51
51
|
record(6, "2026-01-05T00:00:00.000Z", { kind: "bug", severity: "minor", tags: ["timeout"], subject: "alice", tools: ["create_order"] }, { references: { documentId: "doc-1" } }),
|
|
52
52
|
];
|
|
53
53
|
const ids = (...numbers) => numbers.map(id);
|
|
@@ -61,6 +61,8 @@ export const conformanceCases = [
|
|
|
61
61
|
{ name: "filters by severity", op: "list", filter: { severity: "minor" }, limit: 10, expect_pages: [ids(6, 4)] },
|
|
62
62
|
{ name: "filters by status", op: "list", filter: { status: "resolved" }, limit: 10, expect_pages: [[]] },
|
|
63
63
|
{ name: "filters by subject", op: "list", filter: { subject: "alice" }, limit: 10, expect_pages: [ids(6, 3, 1)] },
|
|
64
|
+
{ name: "filters by server", op: "list", filter: { server: "other-server" }, limit: 10, expect_pages: [ids(5)] },
|
|
65
|
+
{ name: "a server filter leaves out records with no server", op: "list", filter: { server: "conformance-server" }, limit: 10, expect_pages: [ids(6, 3, 2, 1)] },
|
|
64
66
|
{ name: "filters by tool", op: "list", filter: { tool: "create_order" }, limit: 10, expect_pages: [ids(6, 2, 1)] },
|
|
65
67
|
{ name: "filters by tag", op: "list", filter: { tag: "timeout" }, limit: 10, expect_pages: [ids(6, 2)] },
|
|
66
68
|
{ name: "since is inclusive", op: "list", filter: { since: "2026-01-03T00:00:00.000Z" }, limit: 10, expect_pages: [ids(6, 5, 4, 3)] },
|
|
@@ -94,6 +96,7 @@ export const conformanceCases = [
|
|
|
94
96
|
by_status: { new: 6 },
|
|
95
97
|
by_severity: { major: 1, blocker: 1, none: 2, minor: 2 },
|
|
96
98
|
by_tool: { create_order: 3, list_orders: 2 },
|
|
99
|
+
by_server: { "conformance-server": 4, "other-server": 1 },
|
|
97
100
|
},
|
|
98
101
|
},
|
|
99
102
|
{
|
|
@@ -106,6 +109,7 @@ export const conformanceCases = [
|
|
|
106
109
|
by_status: { new: 3 },
|
|
107
110
|
by_severity: { major: 1, none: 1, minor: 1 },
|
|
108
111
|
by_tool: { create_order: 2 },
|
|
112
|
+
by_server: { "conformance-server": 3 },
|
|
109
113
|
},
|
|
110
114
|
},
|
|
111
115
|
{
|
|
@@ -118,13 +122,20 @@ export const conformanceCases = [
|
|
|
118
122
|
by_status: { new: 2 },
|
|
119
123
|
by_severity: { blocker: 1, minor: 1 },
|
|
120
124
|
by_tool: { create_order: 2, list_orders: 1 },
|
|
125
|
+
by_server: { "conformance-server": 2 },
|
|
121
126
|
},
|
|
122
127
|
},
|
|
128
|
+
{
|
|
129
|
+
name: "stats honour a server",
|
|
130
|
+
op: "stats",
|
|
131
|
+
filter: { server: "other-server" },
|
|
132
|
+
expect: { total: 1, by_kind: { praise: 1 }, by_status: { new: 1 }, by_severity: { none: 1 }, by_tool: {}, by_server: { "other-server": 1 } },
|
|
133
|
+
},
|
|
123
134
|
{
|
|
124
135
|
name: "stats with no matches is empty",
|
|
125
136
|
op: "stats",
|
|
126
137
|
filter: { tag: "nope" },
|
|
127
|
-
expect: { total: 0, by_kind: {}, by_status: {}, by_severity: {}, by_tool: {} },
|
|
138
|
+
expect: { total: 0, by_kind: {}, by_status: {}, by_severity: {}, by_tool: {}, by_server: {} },
|
|
128
139
|
},
|
|
129
140
|
{ name: "rejects a duplicate id", op: "insert_duplicate", id: id(1) },
|
|
130
141
|
{
|
package/dist/drizzle.js
CHANGED
|
@@ -37,6 +37,7 @@ export function feedbackTable(name = DEFAULT_TABLE) {
|
|
|
37
37
|
index(`${name}_created_idx`).on(table.createdAt.desc().nullsFirst(), table.id.desc().nullsFirst()),
|
|
38
38
|
index(`${name}_status_idx`).on(table.status),
|
|
39
39
|
index(`${name}_kind_idx`).on(table.kind),
|
|
40
|
+
index(`${name}_server_idx`).on(table.serverName),
|
|
40
41
|
]);
|
|
41
42
|
}
|
|
42
43
|
/** The default `mcp_feedback` table. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
|
-
export { defineFeedbackStore, toolNamesOf, encodeCursor, decodeCursor, compareNewestFirst, matchesFilter, type FeedbackStore, } from "./store.js";
|
|
2
|
+
export { defineFeedbackStore, toolNamesOf, encodeCursor, decodeCursor, compareNewestFirst, matchesFilter, FeedbackDeliveryError, type FeedbackReceipt, type FeedbackSink, type FeedbackStore, } from "./store.js";
|
|
3
3
|
export { defaultResolveIdentity, fingerprintToken, type ClientImplementation, type FeedbackRequestExtra, type ResolveIdentity, } from "./identity.js";
|
|
4
|
-
export { registerFeedback, registerFeedbackReader, DEFAULT_FEEDBACK_LIMITS, type FeedbackLimits, type FeedbackOptions, type FeedbackReaderOptions, } from "./register.js";
|
|
4
|
+
export { registerFeedback, registerFeedbackReader, buildRecord, validateSubmission, DEFAULT_FEEDBACK_LIMITS, type FeedbackSubmission, type FeedbackLimits, type FeedbackOptions, type FeedbackReaderOptions, } from "./register.js";
|
|
5
5
|
export { FeedbackInputError, listPage, normalizeFilter, triageMany, type TriageOutcome } from "./reader.js";
|
|
6
6
|
export { feedbackInstructions, feedbackConfirmInstructions, feedbackToolCatalog, feedbackToolCatalogFor, feedbackReaderToolCatalog, } from "./tools.js";
|
|
7
7
|
export { memoryStore } from "./stores/memory.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
|
-
export { defineFeedbackStore, toolNamesOf, encodeCursor, decodeCursor, compareNewestFirst, matchesFilter, } from "./store.js";
|
|
2
|
+
export { defineFeedbackStore, toolNamesOf, encodeCursor, decodeCursor, compareNewestFirst, matchesFilter, FeedbackDeliveryError, } from "./store.js";
|
|
3
3
|
export { defaultResolveIdentity, fingerprintToken, } from "./identity.js";
|
|
4
|
-
export { registerFeedback, registerFeedbackReader, DEFAULT_FEEDBACK_LIMITS, } from "./register.js";
|
|
4
|
+
export { registerFeedback, registerFeedbackReader, buildRecord, validateSubmission, DEFAULT_FEEDBACK_LIMITS, } from "./register.js";
|
|
5
5
|
export { FeedbackInputError, listPage, normalizeFilter, triageMany } from "./reader.js";
|
|
6
6
|
export { feedbackInstructions, feedbackConfirmInstructions, feedbackToolCatalog, feedbackToolCatalogFor, feedbackReaderToolCatalog, } from "./tools.js";
|
|
7
7
|
export { memoryStore } from "./stores/memory.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const INGEST_USAGE = "mcp-feedback ingest: run a hub that collects feedback from installed copies of a server\n\nUsage: mcp-feedback ingest <command> [options]\n\nCommands:\n keygen --out <file> Make a signing key. Writes it (private) to <file>; prints the public half\n issue-key --project <p> Print a project key: ships in the server package, can only enrol\n issue-token --project <p> --subject <s> [--days <n>]\n Print a token for a person or team you know (default 90 days)\n serve (--db <path> | --postgres <url>) [--project <p>...] [--port <n>] [--host <h>]\n Run the hub (POST /v1/enroll, POST /v1/feedback). Every project\n your key issued a project key for goes into one store, under its\n own name; --project, repeated, accepts only those listed.\n With MCP_FEEDBACK_READER_TOKEN set (32+ characters), also serves\n the reader tools for all projects at POST /mcp, behind that token\n\nOptions (serve reads each from the environment variable shown when the flag is not given):\n --key <file> The signing key MCP_FEEDBACK_INGEST_KEY (a path, or the key file's JSON)\n --issuer <url> The hub's public URL; tokens are MCP_FEEDBACK_INGEST_ISSUER\n only valid there\n --db <path> SQLite file MCP_FEEDBACK_DB\n --postgres <url> Postgres connection URL MCP_FEEDBACK_POSTGRES_URL, then DATABASE_URL\n --table <name> Table, default mcp_feedback MCP_FEEDBACK_TABLE\n --project <p> Accept only these projects (repeat) MCP_FEEDBACK_INGEST_PROJECTS (comma-separated)\n --port <n> Default 8787 PORT\n --host <h> Default 127.0.0.1 MCP_FEEDBACK_INGEST_HOST\n --trust-proxy Client address from X-Forwarded-For MCP_FEEDBACK_INGEST_TRUST_PROXY=1\n --revoked <file> Refuse tokens whose jti or subject is MCP_FEEDBACK_INGEST_REVOKED (comma-separated)\n a line of this file (read at start)\n Reader endpoint at /mcp MCP_FEEDBACK_READER_TOKEN (32+ characters)\n HMAC key for token fingerprints MCP_FEEDBACK_FINGERPRINT_KEY\n GitHub sign-in: OAuth app client id MCP_FEEDBACK_GITHUB_CLIENT_ID (device flow enabled)\n ... only members of these orgs MCP_FEEDBACK_GITHUB_ORGS (comma-separated)\n ... only these GitHub logins MCP_FEEDBACK_GITHUB_USERS (comma-separated)\n --kid <id> With keygen: the key's id (default: generated)\n\nserve also answers GET /healthz, for container health checks.\n";
|
|
2
|
+
interface IngestIo {
|
|
3
|
+
out: (line: string) => void;
|
|
4
|
+
err: (line: string) => void;
|
|
5
|
+
env: Record<string, string | undefined>;
|
|
6
|
+
}
|
|
7
|
+
export declare function runIngestCli(argv: string[], io: IngestIo): Promise<number>;
|
|
8
|
+
export {};
|