phaedo-mcp 0.3.2 → 0.3.3
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 +37 -7
- package/fingerprint-source.js +65 -4
- package/package.json +1 -1
- package/pull.js +7 -0
- package/server.js +7 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -18,12 +18,15 @@ when your phone is offline, is encrypted too.
|
|
|
18
18
|
|
|
19
19
|
## What you need
|
|
20
20
|
|
|
21
|
-
1. **
|
|
22
|
-
|
|
21
|
+
1. **A profile**, from either:
|
|
22
|
+
- **the Phaedo phone app** — your full profile lives there. The app isn't open
|
|
23
|
+
to the public yet; [phaedo.so](https://phaedo.so) has a link to hear when it is.
|
|
24
|
+
- **your own Claude Code sessions** — no phone needed. Phaedo builds a starter
|
|
25
|
+
profile on this computer from how you work in Claude Code (see below).
|
|
23
26
|
2. **Node.js**, free from [nodejs.org](https://nodejs.org) (the LTS button).
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
With neither, there is no profile, and the server says so plainly rather than
|
|
29
|
+
guessing. You can still try Phaedo with a made-up example profile.
|
|
27
30
|
|
|
28
31
|
## Try it with the example profile (no phone needed)
|
|
29
32
|
|
|
@@ -63,6 +66,31 @@ example, delete the `env` line in Claude Desktop, or in Claude Code run
|
|
|
63
66
|
`claude mcp remove -s user phaedo` and add it again without `-e …`. The server
|
|
64
67
|
will then tell you there's no profile until you pair your phone.
|
|
65
68
|
|
|
69
|
+
## Start a profile from your Claude Code sessions (no phone needed)
|
|
70
|
+
|
|
71
|
+
If you use Claude Code, Phaedo can learn from how you work there and build a
|
|
72
|
+
starter profile on this computer — for example, that you want short answers
|
|
73
|
+
without headers. It starts thin and grows as you work.
|
|
74
|
+
|
|
75
|
+
1. **Get this folder** as in step 1 below (Code → Download ZIP, unzip, open the
|
|
76
|
+
`mcp` folder).
|
|
77
|
+
2. **Install the Claude Code hook.** In Terminal, from the `mcp` folder:
|
|
78
|
+
```bash
|
|
79
|
+
npm install
|
|
80
|
+
```
|
|
81
|
+
```bash
|
|
82
|
+
npm run setup:code-hook
|
|
83
|
+
```
|
|
84
|
+
This adds Phaedo to your AI apps and turns on three things in Claude Code:
|
|
85
|
+
loading your profile when a session starts, checking with you before it merges
|
|
86
|
+
or publishes, and learning from your sessions.
|
|
87
|
+
3. **Quit and reopen Claude Code**, then keep working. The first sessions build the
|
|
88
|
+
profile, and each later session picks up what's been learned.
|
|
89
|
+
|
|
90
|
+
What it reads stays on this computer: each session is reduced to counts (like "asked
|
|
91
|
+
for a shorter answer, 4 times"), and the text itself is discarded. If you pair the
|
|
92
|
+
phone app later, your full profile replaces the starter one and keeps what it learned.
|
|
93
|
+
|
|
66
94
|
## Use your own profile (with the phone app)
|
|
67
95
|
|
|
68
96
|
1. **Get this folder.** On [the GitHub page](https://github.com/phaedo-labs/phaedo-mcp),
|
|
@@ -219,9 +247,11 @@ if you prefer.)*
|
|
|
219
247
|
|
|
220
248
|
**Phase 1a — local JSON.** With no pairing record, reads a **vault payload**
|
|
221
249
|
from `PHAEDO_FINGERPRINT` (a path, or the word `sample` for the shipped
|
|
222
|
-
`mcp/sample-fingerprint.json`), then `mcp/fingerprint.json`. With neither,
|
|
223
|
-
|
|
224
|
-
|
|
250
|
+
`mcp/sample-fingerprint.json`), then `mcp/fingerprint.json`. With neither, a
|
|
251
|
+
**starter profile**: the Claude Code capture state on this computer folded onto an
|
|
252
|
+
empty fingerprint (id `starter-local`), served only if it learned something. With
|
|
253
|
+
nothing captured, there is **no profile**: every tool returns a plain-language
|
|
254
|
+
`decryption_failed` error saying so. The sample is never served unless asked for by name — until 0.3.1 it
|
|
225
255
|
was the silent fallback, so a fresh `npx phaedo-mcp` injected a made-up person's
|
|
226
256
|
style without saying so. The file looks like this:
|
|
227
257
|
```json
|
package/fingerprint-source.js
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
// Phase 1b (phone): if a pairing record is configured (PHAEDO_PAIRING or
|
|
6
6
|
// mcp/pairing.json), authorize → pull /v1/profile → unwrap the §7.2 envelope
|
|
7
7
|
// from the paired phone (phone-source.js). Spec-faithful; no plaintext at rest.
|
|
8
|
-
// Phase 1a (local): otherwise read a local vault-payload JSON. With neither,
|
|
9
|
-
//
|
|
8
|
+
// Phase 1a (local): otherwise read a local vault-payload JSON. With neither, a STARTER
|
|
9
|
+
// profile from this computer's own capture (loadStarterProfile), else no profile — tools
|
|
10
|
+
// say so (NO_PROFILE_MESSAGE). The shipped sample is opt-in only.
|
|
10
11
|
|
|
11
12
|
import { readFile } from 'fs/promises';
|
|
13
|
+
import { existsSync } from 'fs';
|
|
12
14
|
import { resolve, dirname } from 'path';
|
|
13
15
|
import { fileURLToPath } from 'url';
|
|
14
16
|
import { hasPairingRecord, loadPairingRecord, loadFingerprintFromPhone, PhoneError } from './phone-source.js';
|
|
@@ -78,6 +80,7 @@ export function foldConfigHome(vd) {
|
|
|
78
80
|
// Resolution order for the local fixture (1a):
|
|
79
81
|
// 1. PHAEDO_FINGERPRINT env var (absolute or cwd-relative path, or `sample`)
|
|
80
82
|
// 2. ./fingerprint.json next to the server
|
|
83
|
+
// 3. a starter profile folded from this computer's capture state (see loadStarterProfile)
|
|
81
84
|
// — nothing else. There is deliberately NO silent fallback to the shipped sample.
|
|
82
85
|
//
|
|
83
86
|
// NO PROFILE IS AN ANSWER, NOT A DEMO. Until 2026-10-20 an unpaired install with no file fell
|
|
@@ -100,8 +103,52 @@ function resolveSourcePath(baseDir) {
|
|
|
100
103
|
export const NO_PROFILE_MESSAGE =
|
|
101
104
|
'No Phaedo profile is set up on this computer, so there is nothing to load and Phaedo has ' +
|
|
102
105
|
'not changed how the assistant responds. A profile comes from the Phaedo phone app, which is ' +
|
|
103
|
-
'not open to the public yet (https://phaedo.so to hear when it is).
|
|
104
|
-
'
|
|
106
|
+
'not open to the public yet (https://phaedo.so to hear when it is). Without the phone, Phaedo ' +
|
|
107
|
+
'can start one from your own Claude Code sessions on this computer once its Claude Code hook ' +
|
|
108
|
+
'is installed (see the README). To try a made-up example profile instead, set ' +
|
|
109
|
+
'PHAEDO_FINGERPRINT=sample in this server\'s settings.';
|
|
110
|
+
|
|
111
|
+
// The same news for the server's log (Claude Desktop's MCP log shows stderr), one line.
|
|
112
|
+
const NO_PROFILE_LOG =
|
|
113
|
+
'no profile is set up on this computer, so Phaedo will not change how the assistant responds. ' +
|
|
114
|
+
'Pair the Phaedo phone app, install the Claude Code hook to start one from your own sessions, ' +
|
|
115
|
+
'or set PHAEDO_FINGERPRINT=sample to try the example.';
|
|
116
|
+
|
|
117
|
+
// STARTER PROFILE — the phone-less path.
|
|
118
|
+
//
|
|
119
|
+
// Someone without the phone app has no fingerprint to pull, but if they turned on the Claude
|
|
120
|
+
// Code capture hook, this computer already holds their own signal counts (capture-local.js, the
|
|
121
|
+
// tier-3 owner). Folding those onto an EMPTY fingerprint gives a profile made only of what they
|
|
122
|
+
// did — never the sample's invented traits, which is what this branch fell back to until 0.3.0.
|
|
123
|
+
// It is thin by construction (persona_strength 0; the projection's confidence section says
|
|
124
|
+
// "treat all signals as preliminary"), and that is the honest label for it.
|
|
125
|
+
//
|
|
126
|
+
// Served only when the fold learned something: zero signals is still "no profile". The id is a
|
|
127
|
+
// constant so receipts and the agreement metric stay on one subject across loads; pairing a
|
|
128
|
+
// phone later replaces it (the phone inherits the cumulative counts — capture-local.js §5).
|
|
129
|
+
export const STARTER_FINGERPRINT_ID = 'starter-local';
|
|
130
|
+
|
|
131
|
+
async function loadStarterProfile(now = new Date().toISOString()) {
|
|
132
|
+
if (!await isLocalCaptureOwner(false)) return null;
|
|
133
|
+
const base = { phaedo_fingerprint: { fingerprint_id: STARTER_FINGERPRINT_ID, updated_at: now, layers: {} } };
|
|
134
|
+
const vd = await foldLocalCapture(base, { now });
|
|
135
|
+
const layers = (vd && vd.phaedo_fingerprint && vd.phaedo_fingerprint.layers) || {};
|
|
136
|
+
if (!Object.values(layers).some((l) => Array.isArray(l?.signals) && l.signals.length)) return null;
|
|
137
|
+
return markStarter(foldConfigHome(normalizeIdentity(vd)));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** One line for the server log describing where the profile will come from, or null when there
|
|
141
|
+
* is nothing a person needs told. Never touches the phone: a pull at startup would put an
|
|
142
|
+
* "authorize" card on it with nobody asking. */
|
|
143
|
+
export async function profileStatusLine(baseDir) {
|
|
144
|
+
const env = process.env.PHAEDO_FINGERPRINT;
|
|
145
|
+
if (env === SAMPLE_KEYWORD) return 'using the made-up example profile (PHAEDO_FINGERPRINT=sample).';
|
|
146
|
+
if (env) return null;
|
|
147
|
+
if (hasPairingRecord(baseDir)) return null;
|
|
148
|
+
if (existsSync(resolve(baseDir, 'fingerprint.json'))) return null;
|
|
149
|
+
if (await loadStarterProfile()) return 'no phone paired; using a starter profile built from your own sessions on this computer.';
|
|
150
|
+
return NO_PROFILE_LOG;
|
|
151
|
+
}
|
|
105
152
|
|
|
106
153
|
// Returns the vault payload:
|
|
107
154
|
// { phaedo_fingerprint, phaedo_behavioral_signals, phaedo_linguistic_profile,
|
|
@@ -131,6 +178,18 @@ function stamp(vd, cached) {
|
|
|
131
178
|
return vd;
|
|
132
179
|
}
|
|
133
180
|
|
|
181
|
+
// A starter profile is read fresh every load (live), but it did not come from a phone —
|
|
182
|
+
// `pull.js` must not say it did.
|
|
183
|
+
function markStarter(vd) {
|
|
184
|
+
try {
|
|
185
|
+
Object.defineProperty(vd, SOURCE, {
|
|
186
|
+
value: { live: true, cachedAt: null, ageMs: 0, starter: true },
|
|
187
|
+
enumerable: false, configurable: true, writable: true,
|
|
188
|
+
});
|
|
189
|
+
} catch { /* frozen object — provenance is best-effort, never fatal */ }
|
|
190
|
+
return vd;
|
|
191
|
+
}
|
|
192
|
+
|
|
134
193
|
/** Provenance of a loaded fingerprint. Absent marker → a live read. */
|
|
135
194
|
export function sourceOf(vd) {
|
|
136
195
|
const s = vd && vd[SOURCE];
|
|
@@ -179,6 +238,8 @@ export async function loadFingerprint(baseDir) {
|
|
|
179
238
|
// Only the default location may be absent quietly. A path the user NAMED that doesn't
|
|
180
239
|
// read is their mistake to see, not "no profile".
|
|
181
240
|
if (!process.env.PHAEDO_FINGERPRINT && err?.code === 'ENOENT') {
|
|
241
|
+
const starter = await loadStarterProfile();
|
|
242
|
+
if (starter) return starter;
|
|
182
243
|
throw new PhaedoError('decryption_failed', NO_PROFILE_MESSAGE);
|
|
183
244
|
}
|
|
184
245
|
throw new PhaedoError('decryption_failed', `Could not read the Phaedo profile at ${path} (${err?.code || err?.message || err}).`);
|
package/package.json
CHANGED
package/pull.js
CHANGED
|
@@ -21,6 +21,13 @@ loadFingerprint(BASE_DIR)
|
|
|
21
21
|
// profile went unnoticed while the agent answered authorization questions from it. The
|
|
22
22
|
// whole point of this command is to verify the pairing works, so it has to distinguish
|
|
23
23
|
// "your phone answered" from "your phone didn't, here's an old copy".
|
|
24
|
+
if (src.starter) {
|
|
25
|
+
process.stdout.write(
|
|
26
|
+
`✓ No phone paired — serving a starter profile built from your own sessions on this computer, ${layers} layer(s).\n` +
|
|
27
|
+
` Pair the Phaedo phone app (npm run pair) to replace it with your full profile.\n`
|
|
28
|
+
);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
24
31
|
if (src.live) {
|
|
25
32
|
process.stdout.write(
|
|
26
33
|
`✓ Read your profile from the phone — fingerprint ${fp.fingerprint_id || '(no id)'}, ${layers} layer(s).\n`
|
package/server.js
CHANGED
|
@@ -16,7 +16,7 @@ import { z } from 'zod';
|
|
|
16
16
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
17
17
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
18
18
|
|
|
19
|
-
import { loadFingerprint, sourceOf } from './fingerprint-source.js';
|
|
19
|
+
import { loadFingerprint, sourceOf, profileStatusLine } from './fingerprint-source.js';
|
|
20
20
|
import { hasPairingRecord, loadPairingRecord } from './phone-source.js';
|
|
21
21
|
import { depositDelegationSuggestions } from './delegation-sync.js';
|
|
22
22
|
import { depositReceiptsDigest, drainAndApplyMarks } from './receipts-sync.js';
|
|
@@ -892,6 +892,12 @@ async function main() {
|
|
|
892
892
|
await server.connect(transport);
|
|
893
893
|
// stdio transport owns stdout for protocol framing — never console.log here.
|
|
894
894
|
process.stderr.write('[phaedo-mcp] ready on stdio\n');
|
|
895
|
+
// Where the profile will come from, in one line, after the handshake so startup never waits
|
|
896
|
+
// on it. stderr is what Claude Desktop's MCP log shows — the one place a person debugging
|
|
897
|
+
// "why isn't Phaedo doing anything" will look. Best-effort: a failure here says nothing.
|
|
898
|
+
profileStatusLine(BASE_DIR)
|
|
899
|
+
.then((line) => { if (line) process.stderr.write(`[phaedo-mcp] ${line}\n`); })
|
|
900
|
+
.catch(() => {});
|
|
895
901
|
}
|
|
896
902
|
|
|
897
903
|
main().catch((err) => {
|
package/server.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.phaedo-labs/phaedo-mcp",
|
|
4
4
|
"description": "Make AI apps answer your way, check with you before acting, and get approvals on your phone.",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.3",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/phaedo-labs/phaedo-mcp",
|
|
8
8
|
"source": "github",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "phaedo-mcp",
|
|
16
|
-
"version": "0.3.
|
|
16
|
+
"version": "0.3.3",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
}
|