Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Current public state:

- Published on npm: [`premature-contribution-firewall`](https://www.npmjs.com/package/premature-contribution-firewall) with the `pcf` CLI, including `lifecycle`, and the `pcf-mcp` stdio server bin.
- Published on the GitHub Marketplace as a read-only Action with two modes: `workflow_dispatch` queue artifact and `pull_request` PR gate (step-summary verdict, optional `fail-on` blocking, no GitHub writes).
- MCP server: `pcf-mcp` / `npm run mcp` exposes default-safe agent tools for scout, policy, repro, diff-shape, lane status/resume, evidence drafts, fixed local lane storage, and registry-readiness self-audit. Current release gates install the actual tarball and exercise its CLI/MCP command shims before publish. See [docs/MCP.md](docs/MCP.md).
- MCP server: `pcf-mcp` / `npm run --silent mcp` exposes default-safe agent tools for scout, policy, repro, diff-shape, lane status/resume, evidence drafts, fixed local lane storage, and registry-readiness self-audit. Current release gates install the actual tarball and exercise its CLI/MCP command shims before publish. See [docs/MCP.md](docs/MCP.md).
- Contributor preflight: `pcf preflight` checks a draft PR or patch before submission, with a stable exit-code contract for hooks and CI.
- Public contribution replay: [actual signals, misses, and source-versus-npm differences](docs/examples/public-contributions/README.md), with frozen public inputs and an offline runner.
- Initial release post: [v0.1.0 read-only maintainer queue pilot](docs/RELEASE_POST_V0_1_0.md).
Expand Down
6 changes: 5 additions & 1 deletion docs/MCP.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ Published v0.2.0 does not contain this validation. See the
Run it from a source checkout:

```bash
npm run mcp
npm run --silent mcp
```

Keep `--silent` when a client launches through npm: it suppresses npm's lifecycle
banners so stdout contains only MCP messages. The server can also be launched
directly with `node src/mcp/server.mjs` from the checkout root.

Smoke-check the stdio server before wiring an agent:

```bash
Expand Down
2 changes: 1 addition & 1 deletion src/core/mcp-submission.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function buildMcpServerCard({ packageInfo, tools, resources, prompts }) {
},
install: {
npmPackage: packageInfo.name,
localCommand: "npm run mcp",
localCommand: "npm run --silent mcp",
smokeCommand: "npm run mcp:smoke",
clientConfig: {
command: "npx",
Expand Down
33 changes: 33 additions & 0 deletions test/mcp.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,39 @@ test("submission readiness and server card expose registry-safe MCP posture", as
assert.ok(card.submissionNotes.some((note) => /Glama/.test(note)));
});

test("server card source launch keeps stdout limited to MCP responses", {
skip: !process.env.npm_execpath && "Run with npm test to exercise the advertised npm launch"
}, async () => {
const card = JSON.parse((await readPcfMcpResource("pcf://mcp/server-card")).text);
const [command, ...args] = card.install.localCommand.split(/\s+/);
assert.equal(command, "npm");
const requests = [
{ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-06-18" } },
{ jsonrpc: "2.0", id: 2, method: "ping", params: {} }
];
// Windows environment keys are case-insensitive. Remove every spelling so an
// inherited silent setting cannot hide lifecycle banners in the regression.
const launchEnv = Object.fromEntries(Object.entries(process.env)
.filter(([key]) => key.toLowerCase() !== "npm_config_loglevel"));
launchEnv.npm_config_loglevel = "notice";
const launch = spawnSync(process.execPath, [process.env.npm_execpath, ...args], {
cwd: repoRoot,
env: launchEnv,
input: requests.map((request) => JSON.stringify(request)).join("\n") + "\n",
encoding: "utf8",
timeout: 15_000,
windowsHide: true
});
assert.ifError(launch.error);
assert.equal(launch.status, 0, launch.stderr);
const responses = launch.stdout.trim().split(/\r?\n/).map((line) => JSON.parse(line));
assert.equal(responses.length, requests.length);
assert.ok(responses.every((response) => response.jsonrpc === "2.0" && !response.error));
assert.deepEqual(responses.map((response) => response.id), [1, 2]);
assert.equal(responses[0].result.serverInfo.name, card.packageName);
assert.deepEqual(responses[1].result, {});
});

test("scout ranks supplied contributor candidates without network collection", async () => {
const scout = await callPcfMcpTool("pcf_scout", {
generatedAt: "2026-06-11T20:00:00Z",
Expand Down
Loading