@hootlens/mcp 0.0.0-stage → 1.0.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@hootlens/mcp` are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [1.0.0] - 2026-10-07
6
+
7
+ First release on npm. The same server was available before as a single-file download from hootlens.com.
8
+
9
+ ### Added
10
+
11
+ - MCP protocol versions 2026-07-28 and 2025 (older clients keep working).
12
+ - Toolsets: `read`, `replay`, `annotate`, `install`, `feedback`, `issues`, plus `default` and `all`. Choose them with `--toolsets` or `HOOTLENS_TOOLSETS`. Toolsets the credential cannot use are not offered.
13
+ - Project pinning: `--project`, `HOOTLENS_PROJECT`, or a `.hootlens.json` file with `{"projectId": "..."}`, so tools default to one project.
14
+ - Prompts for common jobs and resources for the Hoot Lens documentation.
15
+ - Structured output for tool results, alongside the text content.
16
+ - `hootlens-mcp login`, `logout` and `whoami`: sign in with your browser (OAuth with PKCE) instead of creating an access key. The sign-in is stored in the macOS Keychain, the Linux Secret Service, or a private file, and renews itself.
17
+ - Packaging as an npm package with a `hootlens-mcp` command, no runtime dependencies, and npm provenance.
18
+
19
+ ### Changed
20
+
21
+ - The local server uses the sign-in from `login` when `HOOTLENS_PAT` is not set. `HOOTLENS_PAT` still takes priority.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Parallel Platforms
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,269 @@
1
- # Temporary Holding Version
1
+ # @hootlens/mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Hoot Lens MCP server. It lets an AI assistant (Claude, Cursor, VS Code, Codex and other MCP clients) read what Hoot Lens recorded on your websites: sessions, replays, heatmaps, funnels, traffic, findings and changes. The assistant sees only what your own Hoot Lens account can see, and only the projects and scopes you allow.
4
+
5
+ You can run it two ways:
6
+
7
+ - **Locally over stdio** with `npx -y @hootlens/mcp` (this package). Works in every MCP client.
8
+ - **Hosted** at `https://mcp.hootlens.com/mcp`, for clients that support remote MCP servers. Nothing to install; you sign in with Hoot Lens in your browser.
9
+
10
+ Both offer the same tools.
11
+
12
+ ## Requirements
13
+
14
+ - Node.js 20 or newer (local server only).
15
+ - A Hoot Lens account with at least one project.
16
+
17
+ ## Sign in
18
+
19
+ Pick one.
20
+
21
+ **Browser sign-in (recommended).** Run this once:
22
+
23
+ ```sh
24
+ npx -y @hootlens/mcp login
25
+ ```
26
+
27
+ Your browser opens Hoot Lens. Choose the projects and permissions to share, and approve. The sign-in is saved in the macOS Keychain, the Linux Secret Service (libsecret), or, where those are not available, a private file (`~/.config/hootlens-mcp/credentials.json`, or `%APPDATA%\hootlens-mcp\credentials.json` on Windows, readable only by you). Tokens are never printed.
28
+
29
+ ```sh
30
+ npx -y @hootlens/mcp whoami # who is signed in, scopes, projects, token expiry
31
+ npx -y @hootlens/mcp logout # delete the saved sign-in and end it at the server
32
+ ```
33
+
34
+ `login --scopes read,replay` asks for fewer permissions (default: `read replay annotate`). On a remote machine without a browser, `login` prints the link; open it on a machine that can reach the CLI on `127.0.0.1` (for example through an SSH port forward of the port it names).
35
+
36
+ How long it lasts: access tokens last 1 hour and are renewed automatically. The renewal token lasts 30 days from its last use, so if you do not use the server for 30 days you must run `login` again. Disconnecting the app under Connected apps in the Hoot Lens dashboard ends the sign-in immediately. When a sign-in has ended, the server tells you to run `npx -y @hootlens/mcp login`.
37
+
38
+ **Access key.** In the dashboard, open Settings, AI assistant, and create a key for one project. Set it as `HOOTLENS_PAT` in the client's environment. When `HOOTLENS_PAT` is set it is used instead of the saved sign-in. A key belongs to one project and you can revoke it in the dashboard at any time. Prefer the browser sign-in on a personal machine and keys for CI or shared setups.
39
+
40
+ ## Install in your client
41
+
42
+ The commands below use the local server. Replace `YOUR_PROJECT_ID` if you want to pin one project (optional; see Project pinning). If you did not run `login`, add your `HOOTLENS_PAT` as shown in each example.
43
+
44
+ ### Claude Code
45
+
46
+ Local:
47
+
48
+ ```sh
49
+ claude mcp add --transport stdio hootlens -- npx -y @hootlens/mcp
50
+ # with an access key instead of the saved sign-in, and a pinned project:
51
+ claude mcp add --transport stdio --env HOOTLENS_PAT=hl_pat_... hootlens -- npx -y @hootlens/mcp --project YOUR_PROJECT_ID
52
+ ```
53
+
54
+ Hosted (then run `/mcp` inside Claude Code to sign in):
55
+
56
+ ```sh
57
+ claude mcp add --transport http hootlens "https://mcp.hootlens.com/mcp"
58
+ ```
59
+
60
+ Add `--scope project` to share the entry with your team through `.mcp.json`, or `--scope user` for all your projects.
61
+
62
+ ### Cursor
63
+
64
+ Add to `.cursor/mcp.json` in a project, or `~/.cursor/mcp.json` for all projects.
65
+
66
+ Local:
67
+
68
+ ```json
69
+ {
70
+ "mcpServers": {
71
+ "hootlens": {
72
+ "type": "stdio",
73
+ "command": "npx",
74
+ "args": ["-y", "@hootlens/mcp"],
75
+ "env": { "HOOTLENS_PAT": "${env:HOOTLENS_PAT}" }
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ Leave out `env` to use the saved sign-in from `login`.
82
+
83
+ Hosted:
84
+
85
+ ```json
86
+ {
87
+ "mcpServers": {
88
+ "hootlens": { "url": "https://mcp.hootlens.com/mcp" }
89
+ }
90
+ }
91
+ ```
92
+
93
+ ### VS Code
94
+
95
+ Add to `.vscode/mcp.json` (the top-level key is `servers`, not `mcpServers`).
96
+
97
+ Local:
98
+
99
+ ```json
100
+ {
101
+ "inputs": [
102
+ { "type": "promptString", "id": "hootlens-pat", "description": "Hoot Lens access key", "password": true }
103
+ ],
104
+ "servers": {
105
+ "hootlens": {
106
+ "type": "stdio",
107
+ "command": "npx",
108
+ "args": ["-y", "@hootlens/mcp"],
109
+ "env": { "HOOTLENS_PAT": "${input:hootlens-pat}" }
110
+ }
111
+ }
112
+ }
113
+ ```
114
+
115
+ Leave out `inputs` and `env` to use the saved sign-in from `login`.
116
+
117
+ Hosted:
118
+
119
+ ```json
120
+ {
121
+ "servers": {
122
+ "hootlens": { "type": "http", "url": "https://mcp.hootlens.com/mcp" }
123
+ }
124
+ }
125
+ ```
126
+
127
+ ### Claude Desktop
128
+
129
+ Local. Open Settings, Developer, Edit Config, and add to `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`, Windows: `%APPDATA%\Claude\claude_desktop_config.json`), then quit and reopen Claude Desktop:
130
+
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "hootlens": {
135
+ "command": "npx",
136
+ "args": ["-y", "@hootlens/mcp"]
137
+ }
138
+ }
139
+ }
140
+ ```
141
+
142
+ This uses the saved sign-in from `login`. To use an access key, add `"env": { "HOOTLENS_PAT": "hl_pat_..." }`.
143
+
144
+ Hosted. Remote servers are not added in the JSON file. In Claude Desktop add a custom connector (Customize, Connectors, Add custom connector) with the URL `https://mcp.hootlens.com/mcp`, then sign in with Hoot Lens when asked. Custom connectors depend on your Claude plan.
145
+
146
+ ### Codex
147
+
148
+ Local:
149
+
150
+ ```sh
151
+ codex mcp add hootlens -- npx -y @hootlens/mcp
152
+ # with an access key:
153
+ codex mcp add hootlens --env HOOTLENS_PAT=hl_pat_... -- npx -y @hootlens/mcp
154
+ ```
155
+
156
+ The same in `~/.codex/config.toml`:
157
+
158
+ ```toml
159
+ [mcp_servers.hootlens]
160
+ command = "npx"
161
+ args = ["-y", "@hootlens/mcp"]
162
+ # env_vars = ["HOOTLENS_PAT"] # forward the key from your shell instead of saving it here
163
+ ```
164
+
165
+ Hosted:
166
+
167
+ ```toml
168
+ [mcp_servers.hootlens]
169
+ url = "https://mcp.hootlens.com/mcp"
170
+ ```
171
+
172
+ then run `codex mcp login hootlens`.
173
+
174
+ ### Other clients
175
+
176
+ Any client that can start a stdio server: command `npx`, arguments `-y @hootlens/mcp`, optional environment `HOOTLENS_PAT`. Any client that supports remote servers over Streamable HTTP with OAuth: the URL `https://mcp.hootlens.com/mcp`. The hosted endpoint advertises its sign-in through standard OAuth discovery (RFC 9728 and RFC 8414) and accepts Client ID Metadata Documents and dynamic client registration.
177
+
178
+ ## Hosted URL options
179
+
180
+ Two optional query parameters narrow what a hosted connection offers. They never widen what you approved.
181
+
182
+ | Parameter | Example | Effect |
183
+ | --- | --- | --- |
184
+ | `project` | `https://mcp.hootlens.com/mcp?project=YOUR_PROJECT_ID` | Tools default to this project. |
185
+ | `toolsets` | `https://mcp.hootlens.com/mcp?toolsets=read,replay` | Offer only these toolsets. |
186
+
187
+ Combine them with `&`: `https://mcp.hootlens.com/mcp?project=YOUR_PROJECT_ID&toolsets=read`. Put the URL in quotes in a shell.
188
+
189
+ ## Toolsets
190
+
191
+ Toolsets group tools so an assistant is offered only what it needs. Set them with `--toolsets read,replay` or `HOOTLENS_TOOLSETS=read,replay`.
192
+
193
+ | Toolset | What it offers |
194
+ | --- | --- |
195
+ | `read` | Projects, sessions, recording lists, narratives, heatmaps, findings, traffic, goals, funnels, changes, weekly summary. |
196
+ | `replay` | Raw replay events and clicks of one recording. Needs the `replay` scope. |
197
+ | `annotate` | Add notes to recordings and log changes. Needs the `annotate` scope. |
198
+ | `install` | Install snippets per platform and the install checker. |
199
+ | `feedback` | Report bugs and ideas to the Hoot Lens team and follow your reports. |
200
+ | `issues` | Hoot Lens staff triage tools. Needs the `triage` scope. |
201
+ | `default` | `read`, `replay`, `install`, `feedback`, plus `annotate` when your credential holds that scope. |
202
+ | `all` | Every toolset your credential can use. |
203
+
204
+ A toolset your credential cannot use is not offered, and the server says so on stderr.
205
+
206
+ ## Project pinning
207
+
208
+ By default tools take a `projectId`. To work in one project, pin it. The first of these that is set wins:
209
+
210
+ 1. `--project YOUR_PROJECT_ID`
211
+ 2. `HOOTLENS_PROJECT=YOUR_PROJECT_ID`
212
+ 3. A `.hootlens.json` file in the working directory or any parent: `{"projectId": "YOUR_PROJECT_ID"}`. Project IDs are public, so the file is safe to commit.
213
+
214
+ Pinning sets a default. The API still checks every call against what your credential may reach.
215
+
216
+ ## Configuration
217
+
218
+ | Variable | Purpose |
219
+ | --- | --- |
220
+ | `HOOTLENS_PAT` | Access key. Overrides the saved sign-in. |
221
+ | `HOOTLENS_API_URL` | API origin (default: the Hoot Lens production API). Used by `login`, `whoami` and the server. |
222
+ | `HOOTLENS_PROJECT` | Pinned project. |
223
+ | `HOOTLENS_TOOLSETS` | Comma separated toolsets. |
224
+
225
+ The server writes messages to stderr only. Standard output carries the MCP protocol.
226
+
227
+ ## Troubleshooting
228
+
229
+ - **"No credential"**: run `npx -y @hootlens/mcp login`, or set `HOOTLENS_PAT`.
230
+ - **"The sign-in has ended"**: it was unused for 30 days or was disconnected in the dashboard. Run `login` again.
231
+ - **A tool says a scope is missing**: the credential lacks that permission. Run `login --scopes read,replay,annotate`, or add the scope to your access key in the dashboard.
232
+ - **A project is not found**: you did not share it when signing in, or you are not a member. Run `whoami` to list what the credential can reach.
233
+ - **`npx` is not found by Claude Desktop or an editor**: those apps start with a short `PATH`. Use the absolute path to `npx` (`which npx`) as the command, or install Node from nodejs.org.
234
+ - **No keychain on Linux (headless server, container)**: the sign-in falls back to the private file. Install `libsecret-tools` and run a Secret Service to use the keychain.
235
+ - **`login` says all ports are in use**: login listens on 127.0.0.1 ports 28731 to 28735. Close what is using them and run `login` again.
236
+ - **Behind a proxy or offline**: the server needs HTTPS access to the API (or `HOOTLENS_API_URL`).
237
+ - **Show the version**: `npx -y @hootlens/mcp --version`.
238
+
239
+ ## Versions
240
+
241
+ The package follows Semantic Versioning. Tool names and arguments do not change within a major version; new tools and optional arguments can appear in a minor version. See `CHANGELOG.md`. `npx -y @hootlens/mcp` always runs the latest 1.x; pin with `npx -y @hootlens/mcp@1.0.0` if you need a fixed version. The server supports MCP protocol versions 2026-07-28 and 2025.
242
+
243
+ ## Privacy
244
+
245
+ The server only forwards your requests to the Hoot Lens API with your own credential. It stores nothing except the sign-in described above. Hoot Lens never captures password, payment or one-time-code values, and replays mask other form values unless a site allowlists them.
246
+
247
+ ## License
248
+
249
+ See `LICENSE`.
250
+
251
+ ## Verification notes
252
+
253
+ The client instructions above were checked against each tool's documentation on 2026-10-07.
254
+
255
+ Confirmed from official documentation:
256
+
257
+ - Claude Code: `claude mcp add --transport stdio ... -- <command>`, `--env`, `--transport http`, `--scope`, and signing in with `/mcp` (https://code.claude.com/docs/en/mcp).
258
+ - Cursor: `.cursor/mcp.json` and `~/.cursor/mcp.json`, `mcpServers` with `command`/`args`/`env` (with `type: "stdio"`) and `url` (https://cursor.com/docs/context/mcp).
259
+ - VS Code: `.vscode/mcp.json` with `servers`, `type` `stdio` and `http`, and `inputs` with `${input:id}` (https://code.visualstudio.com/docs/copilot/customization/mcp-servers).
260
+ - Claude Desktop: `claude_desktop_config.json` locations and `mcpServers` for local servers (https://modelcontextprotocol.io/docs/develop/connect-local-servers); remote servers are added as custom connectors, not in the file (https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp).
261
+ - Codex: `codex mcp add <name> --env K=V -- <command>`, `[mcp_servers.<name>]` with `command`, `args`, `env_vars`, `url`, and `codex mcp login <name>` (https://developers.openai.com/codex/mcp).
262
+
263
+ Not confirmed, so treat as likely but check if it fails:
264
+
265
+ - Cursor and VS Code starting a browser sign-in themselves for a remote server without extra configuration. Their documentation describes OAuth settings only for pre-registered clients, so if the sign-in does not start, use the local server.
266
+ - Codex adding a remote server with `codex mcp add hootlens --url ...`. The `config.toml` form above is the documented one.
267
+ - The `env = { HOOTLENS_PAT = "..." }` inline table in Codex `config.toml`; the documented key is `env_vars`.
268
+ - Claude Desktop extension (`.mcpb`) packaging. This package does not provide one.
269
+ - Plans that include Claude Desktop custom connectors.