@counterfact-labs/cli 0.1.0 → 0.1.1
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 +3 -3
- package/dist/mcp.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ The console is at `https://app.counterfactlabs.com`. Sign in again after moving
|
|
|
25
25
|
Add the local MCP server to Codex:
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
codex mcp add counterfact -- npx -y @counterfact-labs/cli mcp
|
|
28
|
+
codex mcp add counterfact -- npx -y @counterfact-labs/cli@latest mcp
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Checks can take several minutes. Codex has a [60-second tool timeout by default](https://learn.chatgpt.com/docs/extend/mcp?surface=cli). In `~/.codex/config.toml`, add `tool_timeout_sec = 900` to the existing `[mcp_servers.counterfact]` section. It should look like this; keep any other settings already in that section:
|
|
@@ -33,7 +33,7 @@ Checks can take several minutes. Codex has a [60-second tool timeout by default]
|
|
|
33
33
|
```toml
|
|
34
34
|
[mcp_servers.counterfact]
|
|
35
35
|
command = "npx"
|
|
36
|
-
args = ["-y", "@counterfact-labs/cli", "mcp"]
|
|
36
|
+
args = ["-y", "@counterfact-labs/cli@latest", "mcp"]
|
|
37
37
|
tool_timeout_sec = 900
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -51,7 +51,7 @@ After editing prompts, skills or tool definitions, suggest a check and wait for
|
|
|
51
51
|
me to ask for it.
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
The MCP server reads local files and communicates over stdin and stdout. Its tools are `check_agent(path, confirm?)`, `get_finding(id)` and `get_balance()`.
|
|
54
|
+
The MCP server reads local files and communicates over stdin and stdout. Its tools are `check_agent(path, confirm?)`, `get_finding(id)` and `get_balance()`. Each result's structured content repeats the tool's text, and completed checks add their finding ids. Keep the preview and confirmation in the same MCP session.
|
|
55
55
|
|
|
56
56
|
Privacy: only files requested by the server are uploaded. The tool skips `.git`, `node_modules`, `.gitignore` matches, symlinks and secret file names such as `.env` and private keys. Uploaded files are kept with the check while the workspace exists, and deleted with the check or workspace. Sign-in is saved in `~/.config/counterfact-labs/credentials` with owner-only permissions. `logout` removes that local sign-in; revoke the token from your account to disable it elsewhere.
|
|
57
57
|
|
package/dist/mcp.js
CHANGED
|
@@ -76,8 +76,10 @@ export async function serveMcp(input, output, options = {}) {
|
|
|
76
76
|
text += errorText(error) + "\n";
|
|
77
77
|
exitCode = errorCode(error);
|
|
78
78
|
}
|
|
79
|
+
// Some clients (Claude Code among them) give the model only the structured result when one is present, so it
|
|
80
|
+
// repeats the text: without it the model sees no files, price or results.
|
|
79
81
|
return { content: [{ type: "text", text }], isError: exitCode !== 0,
|
|
80
|
-
structuredContent: { exitCode, ...(findingIds ? { findingIds } : {}) } };
|
|
82
|
+
structuredContent: { text, exitCode, ...(findingIds ? { findingIds } : {}) } };
|
|
81
83
|
}
|
|
82
84
|
async function respond(message, id, signal) {
|
|
83
85
|
if (signal.aborted)
|
|
@@ -88,7 +90,7 @@ export async function serveMcp(input, output, options = {}) {
|
|
|
88
90
|
if (message.method === "initialize") {
|
|
89
91
|
const requested = object(message.params) ? message.params.protocolVersion : undefined;
|
|
90
92
|
result = { protocolVersion: ["2024-11-05", "2025-03-26", "2025-06-18"].includes(requested) ? requested : "2025-06-18",
|
|
91
|
-
capabilities: { tools: {} }, serverInfo: { name: "counterfact-labs", version: "0.1.
|
|
93
|
+
capabilities: { tools: {} }, serverInfo: { name: "counterfact-labs", version: "0.1.1" } };
|
|
92
94
|
}
|
|
93
95
|
else if (message.method === "ping")
|
|
94
96
|
result = {};
|