@askthew/mcp-plugin 0.4.10 → 0.4.11

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 CHANGED
@@ -1,214 +1,78 @@
1
- # Ask The W Plugin
1
+ # Ask The W MCP Plugin
2
2
 
3
- Connect a local coding agent to Ask The W. The fastest path is free and local-first:
3
+ Cloud-first MCP capture for Claude Code, Codex, and Cursor.
4
4
 
5
5
  ```bash
6
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp install --host claude_code --free --email you@founder.com
6
+ npx -y --package @askthew/mcp-plugin askthew-mcp install --host claude_code
7
7
  ```
8
8
 
9
- This captures decisions and session signals to `~/.askthew/store.sqlite` and lets your agent list the trail, keep decisions, and get limited local recap and coaching without onboarding into the web app.
9
+ Use `--host codex` or `--host cursor` for the other supported clients.
10
10
 
11
- Founder-friendly promise: install from npm, then ask your coding agent to review the last session. You should see value in under 60 seconds.
12
-
13
- This package runs a small MCP server that lets Codex, Claude Code, Cursor, and other MCP-capable tools send compact work-session signals to an Ask The W workspace.
11
+ The installer walks email OTP, stores a device token in `~/.askthew/cloud-token.json`, writes the host MCP config, and adds a marked Ask The W block to `CLAUDE.md` or `AGENTS.md` so future sessions capture automatically.
14
12
 
15
13
  ## What It Does
16
14
 
17
- - Installs an Ask The W plugin server entry into a supported local client.
18
- - Preserves existing MCP servers and settings.
19
- - Adds marked project instructions so future coding-agent sessions know when to send Ask The W updates.
20
- - Free mode stores full-fidelity signals and decisions locally in SQLite.
21
- - Paid workspace mode sends a startup heartbeat so Ask The W can show the plugin as installed.
22
- - Exposes a small MCP surface for capture, signals, decisions, recap, and coaching.
23
- - Redacts obvious secrets from summaries, evidence excerpts, commands, and metadata before sending.
24
- - Adds lightweight workspace metadata such as host type, repo name, app path, and server name.
25
-
26
- ## What It Does Not Do
27
-
28
- - It does not send full transcripts by default.
29
- - It does not send local free-tier content to Ask The W unless you upgrade and run sync upload.
30
- - It does not expose internal workspace APIs through the plugin.
31
- - It does not include the Ask The W app, private server code, Supabase code, or internal analytics code.
32
-
33
- Ask The W keeps the local plugin focused on the trail your agent can use while it works.
34
-
35
- ## Free Local Install
36
-
37
- ```bash
38
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp install \
39
- --host claude_code \
40
- --free \
41
- --email you@founder.com
42
- ```
43
-
44
- Free install is local-first: it generates `~/.askthew/identity.json`, writes MCP config and agent instructions immediately, and never requires an email code before local capture works. The email is an unverified claim used for upgrade onboarding only; data is keyed by the generated install ID, not email alone.
45
-
46
- Installer bookkeeping is separate from local capture data: install receipts live under `~/.local/state/askthew/install-receipts.json` by default, or `$XDG_STATE_HOME/askthew/install-receipts.json` when `XDG_STATE_HOME` is set. This lets `uninstall` remove host config and repo instruction blocks even after `~/.askthew` has been wiped.
47
-
48
- Telemetry is aggregate-only and opt-out. Ask The W does not receive code, file contents, file paths, file names, command text, summaries, or decision content in free mode telemetry. Aggregate summaries are signed by the local install identity and stored under the generated install ID. Opt out with `--no-telemetry`, `ASKTHEW_TELEMETRY=off`, or `askthew-mcp telemetry opt-out`.
49
-
50
- ## Refresh vs Uninstall
51
-
52
- Use `refresh` when you want the latest installed MCP config and instruction blocks without touching local identity or local data:
53
-
54
- ```bash
55
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp refresh --host claude_code
56
- ```
57
-
58
- `refresh` preserves `~/.askthew/identity.json` and `~/.askthew/store.sqlite`, reuses any existing email claim silently, rewrites the host MCP config, and rewrites the marked Ask The W blocks in `CLAUDE.md` and `AGENTS.md`. This is the recommended QA update path after a plugin publish.
59
-
60
- Use `uninstall` when you want to remove the plugin from a host:
61
-
62
- ```bash
63
- npx -y @askthew/mcp-plugin@latest uninstall --host claude_code --keep-local-data --keep-auth
64
- ```
65
-
66
- Without `--keep-local-data`, uninstall removes `~/.askthew`; without `--keep-auth`, it removes the local install identity. Uninstall does not clear npm's cache.
15
+ - Runs a local MCP stdio server in one mode: cloud shim.
16
+ - Captures compact signals through `POST /api/v1/agent/signals`.
17
+ - Buffers captures in `~/.askthew/outbox.sqlite` when the network is down.
18
+ - Redacts obvious secrets before queueing and sending.
19
+ - Lists signals and decisions, creates decisions, and calls cloud recap/coach.
20
+ - Exposes `askthew_start_signup` and `askthew_complete_signup` when no token file exists, for manual MCP config users.
67
21
 
68
- ## Workspace Install
22
+ ## Paid Workspace Install
69
23
 
70
- Create a workspace token in Ask The W at `/decisions/settings/connectors`, then run the installer from your coding agent or terminal. Treat the token like a password; anyone with it can write compact source signals into that workspace.
71
-
72
- Use setup tokens promptly. They expire after 24 hours if the connector never sends activity. Once connected, active tokens renew while in use and expire after 90 days without activity. Rotate the token in Ask The W if it is exposed or if the connector reports an expired or revoked token.
73
-
74
- Codex:
75
-
76
- ```bash
77
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp install \
78
- --host codex \
79
- --token "<ASKTHEW_INSTALL_TOKEN>" \
80
- --api-url "https://app.askthew.com/" \
81
- --server-name "askthew"
82
- ```
83
-
84
- Claude Code:
24
+ Paid users install from the workspace settings page. The page issues a short-lived paid bind token and shows:
85
25
 
86
26
  ```bash
87
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp install \
88
- --host claude_code \
89
- --token "<ASKTHEW_INSTALL_TOKEN>" \
90
- --api-url "https://app.askthew.com/" \
91
- --server-name "askthew"
27
+ npx -y --package @askthew/mcp-plugin askthew-mcp install --host claude_code --bind <paid_bind_token>
92
28
  ```
93
29
 
94
- Cursor:
95
-
96
- ```bash
97
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp install \
98
- --host cursor \
99
- --token "<ASKTHEW_INSTALL_TOKEN>" \
100
- --api-url "https://app.askthew.com/" \
101
- --server-name "askthew"
102
- ```
103
-
104
- After install, restart or reload your coding agent if needed. At the start of every new coding-agent session in this repo, before plan mode or exploration, call `capture_session_signal` with `kind: "setup_complete"` and choose "Always allow" if the host prompts for tool permission. If you realize later that the startup call was missed, send it immediately with `metadata.recovered_missed_startup=true`.
105
-
106
- Claude Desktop and Cowork custom connectors use Ask The W's hosted Remote MCP URL instead of this local `npx` installer. In Ask The W, create a Claude Remote URL from the plugin source, then paste it into Claude's custom connector form as the Remote MCP server URL. The URL must be public HTTPS; `localhost`, `127.0.0.1`, LAN IPs, VPN-only hosts, and firewall-blocked servers will fail because Claude connects from Anthropic's cloud. Treat the URL like a password and rotate it if it leaks.
30
+ The CLI exchanges that token for a device token already bound to the workspace. No OTP is needed because the web session proved workspace authority.
107
31
 
108
- The installer also adds safe, marked project instructions to both markdown convention files plus any host-specific rule file:
32
+ ## Free To Paid Bind
109
33
 
110
- - Codex: `AGENTS.md`
111
- - Claude Code: `CLAUDE.md`
112
- - Cursor: `.cursor/rules/askthew.mdc`
113
-
114
- These instructions tell the coding agent to send compact Ask The W updates at the start of every new repo session, after meaningful direction changes, implementation work, verification, long-session checkpoints, and final summaries. Existing instruction files are preserved.
115
-
116
- To skip this behavior, pass:
34
+ Users who started free can later run:
117
35
 
118
36
  ```bash
119
- --no-agent-instructions
37
+ askthew-mcp bind
120
38
  ```
121
39
 
122
- ## Configuration
123
-
124
- The installer writes the MCP server into the host's native MCP configuration so it appears in that host's MCP server list:
40
+ The CLI flushes the outbox first, prints a short display code, opens the browser bind URL, and polls until the workspace confirms the bind. Existing install identity stays stable.
125
41
 
126
- - Codex: `~/.codex/config.toml`
127
- - Claude Code: `~/.claude.json`, scoped to the current project
128
- - Cursor: `~/.cursor/mcp.json`
42
+ ## Tool Surface
129
43
 
130
- Codex example:
44
+ The v1 MCP tools are:
131
45
 
132
- ```toml
133
- [mcp_servers.askthew]
134
- command = "npx"
135
- args = ["-y", "--prefer-online", "--package", "@askthew/mcp-plugin@latest", "askthew-mcp"]
136
- env = { ASKTHEW_INSTALL_TOKEN = "<ASKTHEW_INSTALL_TOKEN>", ASKTHEW_HOST_TYPE = "codex", ASKTHEW_API_URL = "https://app.askthew.com/", ASKTHEW_SERVER_NAME = "askthew" }
137
- ```
46
+ - `capture_session_signal`
47
+ - `list_signals`
48
+ - `create_decision`
49
+ - `list_decisions`
50
+ - `recap`
51
+ - `coach`
52
+ - `askthew_start_signup` and `askthew_complete_signup` when a token file is missing
138
53
 
139
- Claude Code and Cursor use an MCP JSON entry like this:
140
-
141
- ```json
142
- {
143
- "mcpServers": {
144
- "askthew": {
145
- "command": "npx",
146
- "args": ["-y", "--prefer-online", "@askthew/mcp-plugin@latest"],
147
- "env": {
148
- "ASKTHEW_INSTALL_TOKEN": "<ASKTHEW_INSTALL_TOKEN>",
149
- "ASKTHEW_HOST_TYPE": "codex",
150
- "ASKTHEW_API_URL": "https://app.askthew.com/",
151
- "ASKTHEW_SERVER_NAME": "askthew"
152
- }
153
- }
154
- }
155
- }
156
- ```
54
+ `get_decision` and `promote_signal_to_decision` are intentionally not exposed in v1. Use `list_decisions` and `create_decision` with `sourceSignalIds`.
157
55
 
158
- Optional environment variables:
159
-
160
- - `ASKTHEW_CLIENT_ID`
161
- - `ASKTHEW_CLIENT_LABEL`
162
-
163
- ## Tool Contract
164
-
165
- The session-signal tool remains the main automatic capture path.
166
-
167
- ```json
168
- {
169
- "name": "capture_session_signal",
170
- "input": {
171
- "sessionId": "string",
172
- "sequence": "number",
173
- "kind": "setup_complete | session_checkpoint | direction_change | implementation_update | verification_result | final_summary",
174
- "summary": "string",
175
- "evidence": [{ "role": "user | assistant | system", "excerpt": "string" }],
176
- "filesTouched": ["string"],
177
- "commandsRun": ["string"],
178
- "metadata": {},
179
- "echo": "summary | full"
180
- }
181
- }
182
- ```
56
+ ## Local Files
183
57
 
184
- Use compact summaries and short evidence excerpts. Do not send full transcripts. By default, write tools return compact responses; use `echo: "full"` only when you need the larger payload for debugging.
58
+ - `~/.askthew/cloud-token.json` - bearer token, install id, tier, and API URL; mode `0600`
59
+ - `~/.askthew/install.json` - install diagnostics
60
+ - `~/.askthew/outbox.sqlite` - pending capture buffer
185
61
 
186
- The plugin exposes a small public tool surface:
187
-
188
- | Tool | Purpose |
189
- |---|---|
190
- | `capture_session_signal`, `list_signals` | Capture and list the local signal trail. |
191
- | `list_decisions`, `get_decision`, `create_decision`, `promote_signal_to_decision` | Keep the decisions worth remembering. |
192
- | `recap`, `coach` | Get up to three local recaps and three coaching nudges. After that, the plugin returns `Limit reached. Upgrade to the paid plan.` |
193
-
194
- Free PLG helpers:
62
+ ## CLI
195
63
 
196
64
  ```bash
197
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp install-hook --pre-commit
198
- npx -y --prefer-online --package @askthew/mcp-plugin@latest askthew-mcp digest --weekly
65
+ askthew-mcp # stdio MCP server
66
+ askthew-mcp install --host claude_code
67
+ askthew-mcp install --host claude_code --bind <paid_bind_token>
68
+ askthew-mcp bind
69
+ askthew-mcp token rotate
70
+ askthew-mcp token revoke
71
+ askthew-mcp export
72
+ askthew-mcp delete-me --confirm
199
73
  ```
200
74
 
201
- The hook prompts when staged files recently had implementation signals but no linked decision. The weekly digest writes `~/Documents/askthew-digest-YYYY-WW.md`.
202
-
203
- Decision writes are text-only and are recorded with the local trail.
204
-
205
- ## Troubleshooting
206
-
207
- - Empty `list_mcp_resources` or `list_mcp_resource_templates` results are normal. This connector is tool-driven.
208
- - If Ask The W shows "Waiting for install", restart or reload your coding agent.
209
- - If Ask The W shows "Installed", restart or reload your coding agent if it was already open. At the start of the next repo session, the coding agent should call `capture_session_signal` with `kind: "setup_complete"` before plan mode; choose "Always allow" if it asks for tool permission.
210
- - For Claude Desktop or Cowork, set `capture_session_signal` to "Always allow" in connector Tool permissions when that panel is available, or choose "Allow always" on the first tool prompt.
211
- - If a token fails, check whether the error says missing, malformed, expired, or revoked. Copy the full token if it is malformed; rotate it in Ask The W and rerun the installer if it expired or was revoked.
75
+ `token revoke` revokes only the current token. Install-level revocation is handled by the workspace web endpoint or `delete-me`.
212
76
 
213
77
  ## Development
214
78
 
package/dist/cli.d.ts CHANGED
@@ -1,8 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import { tryRegisterFreeInstall } from "./lib/free-install-registration.js";
3
- type AuthCommandDeps = {
4
- log?: (message: string) => void;
5
- registerFreeInstall?: typeof tryRegisterFreeInstall;
6
- };
7
- export declare function runAuthCommand(argv: string[], deps?: AuthCommandDeps): Promise<void>;
8
2
  export {};