@papervault/mcp 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 +18 -7
- package/package.json +3 -3
- package/src/tools.js +19 -2
package/README.md
CHANGED
|
@@ -16,37 +16,48 @@ An agent is about to do something it can't undo. Before it does, it asks PaperVa
|
|
|
16
16
|
|
|
17
17
|
## 🚀 Quick Start
|
|
18
18
|
|
|
19
|
+
### Claude Code (one command)
|
|
20
|
+
|
|
19
21
|
```bash
|
|
20
|
-
|
|
22
|
+
claude mcp add -s user papervault -- npx -y @papervault/mcp
|
|
23
|
+
claude mcp list # confirm it's registered
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
`-s user` makes the server available across all your projects. Drop the flag for current-project-only. Start a new Claude Code conversation to use it.
|
|
27
|
+
|
|
28
|
+
### Other MCP clients (Cursor, Claude Desktop, manual config)
|
|
29
|
+
|
|
30
|
+
The server runs over stdio, so any MCP client works. Add this to the client's MCP config file:
|
|
24
31
|
|
|
25
32
|
```json
|
|
26
33
|
{
|
|
27
34
|
"mcpServers": {
|
|
28
35
|
"papervault": {
|
|
29
|
-
"command": "
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "@papervault/mcp"]
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
```
|
|
34
42
|
|
|
35
|
-
For
|
|
43
|
+
For faster startup on each call (skips the `npx` lookup), install globally and use the binary directly:
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g @papervault/mcp
|
|
47
|
+
```
|
|
38
48
|
|
|
39
49
|
```json
|
|
40
50
|
{
|
|
41
51
|
"mcpServers": {
|
|
42
52
|
"papervault": {
|
|
43
|
-
"command": "
|
|
44
|
-
"args": ["-y", "@papervault/mcp"]
|
|
53
|
+
"command": "papervault-mcp"
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
57
|
```
|
|
49
58
|
|
|
59
|
+
Restart the client to load the new server.
|
|
60
|
+
|
|
50
61
|
Requires Node.js ≥ 24.
|
|
51
62
|
|
|
52
63
|
## 🔑 Tools Advertised
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papervault/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "MCP server for PaperVault. Lets AI agents trigger paper-based secret backups as a safety step before sensitive operations — agents never see secret values.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
49
|
-
"@papervault/cli": "^0.1.
|
|
50
|
-
"@papervault/core": "^0.1.
|
|
49
|
+
"@papervault/cli": "^0.1.1",
|
|
50
|
+
"@papervault/core": "^0.1.1"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/src/tools.js
CHANGED
|
@@ -11,7 +11,7 @@ import { homedir } from 'node:os';
|
|
|
11
11
|
import { dirname, join } from 'node:path';
|
|
12
12
|
import { createHash } from 'node:crypto';
|
|
13
13
|
|
|
14
|
-
import { createKit } from '@papervault/core';
|
|
14
|
+
import { createKit, LIMITS } from '@papervault/core';
|
|
15
15
|
import { resolveSource, SUPPORTED_SOURCES } from '@papervault/cli/sources';
|
|
16
16
|
import { audit } from '@papervault/cli/audit';
|
|
17
17
|
|
|
@@ -21,6 +21,21 @@ import {
|
|
|
21
21
|
makeGlobFilter,
|
|
22
22
|
} from './safety.js';
|
|
23
23
|
|
|
24
|
+
// Rough per-secret value-length guess. Conservative; real values vary
|
|
25
|
+
// widely (passwords ~16, BIP39 seeds ~100+, JWTs >150). Used only to give
|
|
26
|
+
// agents a "will this fit?" signal in dry_run before they fetch values.
|
|
27
|
+
const TYPICAL_VALUE_CHAR_GUESS = 60;
|
|
28
|
+
|
|
29
|
+
function estimateChars(refs) {
|
|
30
|
+
const lower = refs.reduce((sum, r) => sum + (r.name?.length ?? 0), 0);
|
|
31
|
+
return {
|
|
32
|
+
lower_bound: lower,
|
|
33
|
+
rough_estimate: lower + refs.length * TYPICAL_VALUE_CHAR_GUESS,
|
|
34
|
+
max_allowed: LIMITS.MAX_STORAGE,
|
|
35
|
+
note: `lower_bound is exact (sum of secret-name lengths). rough_estimate adds ~${TYPICAL_VALUE_CHAR_GUESS} chars per secret as a value-length guess. Actual count is only known after fetch; backup will refuse if over max_allowed.`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
24
39
|
/** Helper: wrap structured data in MCP's content-array format. */
|
|
25
40
|
function ok(data) {
|
|
26
41
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
@@ -212,8 +227,10 @@ export async function handleDryRun(args) {
|
|
|
212
227
|
secret_count: selectedRefs.length,
|
|
213
228
|
name_fingerprint: fp,
|
|
214
229
|
kinds_summary: summarizeKinds(selectedRefs),
|
|
230
|
+
char_estimate: estimateChars(selectedRefs),
|
|
215
231
|
note: 'Run papervault_backup_from_source with the same source_uri and select to commit. ' +
|
|
216
|
-
'Compare name_fingerprint between runs to confirm the same set of secrets.'
|
|
232
|
+
'Compare name_fingerprint between runs to confirm the same set of secrets. ' +
|
|
233
|
+
'If rough_estimate is near or above max_allowed, tighten select before backup.',
|
|
217
234
|
});
|
|
218
235
|
} catch (err) {
|
|
219
236
|
try { await src.close(); } catch {}
|