@ls.graphics/connect 0.1.1 → 0.1.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 +161 -5
- package/dist/ls-graphics-connect.mjs +11986 -3667
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -17,8 +17,13 @@ local stdio package.
|
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
-y, --yes no questions: set up every detected tool and install the skill
|
|
20
|
-
--client LIST only these tools, even if not detected: claude-code, cursor, vscode, codex, windsurf, zed, claude-desktop, claude-desktop-bridge
|
|
21
|
-
--
|
|
20
|
+
--client LIST only these tools, even if not detected: claude-code, cursor, vscode, codex, windsurf, zed, pi, hermes, claude-desktop, claude-desktop-bridge, other
|
|
21
|
+
--config FILE an agent that is not listed: its MCP config file (JSON, JSONC, YAML or TOML); implies --client other
|
|
22
|
+
--shape KEY:KIND what that file leaves open, e.g. mcpServers:url, servers:http, mcp_servers:command
|
|
23
|
+
--print print ready-to-paste configs and the ChatGPT / claude.ai steps; changes nothing
|
|
24
|
+
--no-telemetry send no anonymous setup stats (also LSG_TELEMETRY=0 or DO_NOT_TRACK=1; off by default in CI)
|
|
25
|
+
--skill-dir DIR also write the skill to DIR/ls-graphics (for an agent that is not listed)
|
|
26
|
+
--skill LIST where to install the skill: claude, universal, hermes (default: claude and universal, plus hermes when Hermes is set up)
|
|
22
27
|
--no-skill do not install the skill
|
|
23
28
|
--helper also offer to render on this computer (not public yet)
|
|
24
29
|
--dry-run show what would change, write nothing
|
|
@@ -36,10 +41,12 @@ Without `--yes`, or without a terminal, the wizard is not interactive: it takes
|
|
|
36
41
|
| VS Code | user `mcp.json` (`Code/User/mcp.json` in the app-data folder): `servers` → `{"type": "http", "url": "…"}` | code.visualstudio.com/docs/agents/reference/mcp-configuration |
|
|
37
42
|
| Windsurf | `~/.codeium/windsurf/mcp_config.json`: `mcpServers` → `{"serverUrl": "…"}` | docs.windsurf.com/windsurf/cascade/mcp |
|
|
38
43
|
| Zed | `settings.json`: `context_servers` → `{"enabled": true, "url": "…"}` | zed.dev/docs/ai/mcp |
|
|
44
|
+
| Pi | `~/.pi/agent/mcp.json` (or `$PI_CODING_AGENT_DIR`): `mcpServers` → `{"url": "…"}`. Needs a pi with built-in MCP (`pi update`); older pi ignores the file. Sign in with `pi mcp login ls-graphics`. The skill is read from `~/.agents/skills`. | pi.dev, packages/coding-agent/docs/mcp.md |
|
|
45
|
+
| Hermes Agent | `~/.hermes/config.yaml` (`$HERMES_HOME`; `%LOCALAPPDATA%\hermes` on Windows): `mcp_servers` → `{url, auth: oauth}`. YAML is edited in place (comments and other keys stay). Sign in with `hermes mcp login ls-graphics` (on a host without a browser: `hermes mcp login ls-graphics --flow device`), then `/reload-mcp`. An existing `ls-graphics` entry keeps your other keys (`timeout`, `tools`, ...) and stays disabled if it has `enabled: false`; an entry using YAML anchors/aliases is refused and the manual lines are printed. The folder variables `HERMES_HOME` and `PI_CODING_AGENT_DIR` may use `~` and `$VAR`. Skill in `~/.hermes/skills/ls-graphics`. | hermes-agent.nousresearch.com/docs/user-guide/features/mcp |
|
|
39
46
|
| Claude Desktop | No file edit. The wizard prints Settings → Connectors → Add custom connector and offers to open the page; a connector added on claude.ai also shows in Desktop. `--client claude-desktop-bridge` instead edits `claude_desktop_config.json` to run `npx -y mcp-remote@<exact version>` (Desktop needs Node.js on its PATH). The Microsoft Store build (`%LOCALAPPDATA%\Packages\Claude_*`) is detected. | modelcontextprotocol.io/docs/develop/connect-local-servers |
|
|
40
47
|
|
|
41
|
-
Config files are edited in place: your other servers, comments and
|
|
42
|
-
`<file>.ls-graphics-backup-<time>`. A file that is not valid JSON is copied the same way and **left untouched**; the wizard says so
|
|
48
|
+
Config files are edited in place: your other servers and comments stay (JSON keeps its indentation; the Hermes YAML is re-printed by a YAML library, so comments and keys stay but spacing such as flow lists like `[a,b]` may be normalised; CRLF line endings and a BOM are kept). Before a file is changed it is copied to
|
|
49
|
+
`<file>.ls-graphics-backup-<time>`. A file that is not valid JSON (or YAML, for Hermes) is copied the same way and **left untouched**; the wizard says so
|
|
43
50
|
and moves on. Running the wizard again changes nothing. An existing `ls-graphics` entry that started the old local package
|
|
44
51
|
(`@ls.graphics/mcp-local`), or an `ls-graphics-local` entry that did, is replaced or removed, and the wizard says so.
|
|
45
52
|
|
|
@@ -52,13 +59,162 @@ On Windows the wizard never uses a shell: it resolves `claude.cmd`, `codex.cmd`,
|
|
|
52
59
|
Paths: macOS and Linux use `~`, `~/Library/Application Support` (macOS) or `$XDG_CONFIG_HOME` (Linux); Windows uses
|
|
53
60
|
`%USERPROFILE%` and `%APPDATA%`.
|
|
54
61
|
|
|
62
|
+
## Any other agent
|
|
63
|
+
|
|
64
|
+
Not everyone uses one of the tools above. Whatever you use, there are three ways in, from most to least automatic.
|
|
65
|
+
|
|
66
|
+
**1. Other / not listed.** Pick it in the agent list (it is never selected by default), or run
|
|
67
|
+
`npx -y @ls.graphics/connect@latest --client other --config <file>` (`--config` alone is enough). Give the agent's MCP config file;
|
|
68
|
+
the wizard reads it and works out:
|
|
69
|
+
|
|
70
|
+
- the **format** from the extension and the contents: JSON/JSONC, YAML or TOML;
|
|
71
|
+
- the **key** the servers are under: `mcpServers`, `servers`, `mcp.servers`, `context_servers` or `mcp_servers` (also `[mcp_servers.x]` tables in TOML);
|
|
72
|
+
- how the agent's **other entries** point at a server: `url`, `serverUrl`, `httpUrl` or `command`/`args`. If every remote entry carries
|
|
73
|
+
the same `type` (`"http"`) or an `enabled` flag, the new entry gets it too.
|
|
74
|
+
|
|
75
|
+
If the file has no other entry to learn from (an empty file, or only `command` entries), it asks: "remote URL or command (stdio)?", and for a
|
|
76
|
+
remote URL which field holds it. With no terminal, `--shape KEY:KIND` answers the same (`KIND`: `url`, `serverUrl`, `httpUrl`, `http` for
|
|
77
|
+
`type: "http"` plus `url`, or `command` for the pinned mcp-remote bridge).
|
|
78
|
+
|
|
79
|
+
It then edits the file like every other client: backup first (`<file>.ls-graphics-backup-<time>`), in place (other servers and keys stay), idempotent, `--dry-run` writes nothing.
|
|
80
|
+
Layout is kept as well as a text edit can, but it is cosmetic, not byte-for-byte: in JSON/JSONC a comment next to the entry that is added
|
|
81
|
+
or replaced can end up on a neighbouring line, and a YAML file is re-printed by a YAML library (comments and keys stay, spacing and flow
|
|
82
|
+
lists may be normalised). A `null` where the servers map should be (`"mcpServers": null`) is treated as an empty map; a UTF-8 BOM is kept.
|
|
83
|
+
If `--config` names a symlink, the real file behind it is edited (and backed up next to the real file). A file without a write bit is not
|
|
84
|
+
replaced: the wizard says "The file is read-only; add this by hand:" and prints the snippet. The new text is read back and must contain exactly the new entry and the rest of the file as it
|
|
85
|
+
was, or nothing is written. It **does not guess**: when the file has two candidate keys, entries that use different address fields, a
|
|
86
|
+
`servers` key whose entries are not MCP servers, an `ls-graphics` TOML entry with other settings, an inline TOML table or YAML anchors, it
|
|
87
|
+
leaves the file as it is, prints the snippets and (in a terminal) copies the most likely one to the clipboard (`pbcopy`, `clip`,
|
|
88
|
+
`wl-copy`, `xclip` or `xsel`, whichever exists). A file that is not valid JSON/YAML/TOML is reported and left alone.
|
|
89
|
+
|
|
90
|
+
**2. `--print`.** Prints every shape, ready to paste, and the browser steps. No file is read or written and stdout holds only the snippets, so it is safe to pipe (the anonymous-stats notice goes to stderr; see below):
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
npx -y @ls.graphics/connect@latest --print
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
| Shape | Used by (examples) |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| JSON `{"mcpServers": {"ls-graphics": {"url": "https://mcp.ls.graphics/mcp"}}}` | Cursor, Pi and many others |
|
|
99
|
+
| JSON `mcpServers` with `"serverUrl"` | Windsurf |
|
|
100
|
+
| JSON `mcpServers` with `"httpUrl"` | Gemini CLI style |
|
|
101
|
+
| JSON `{"servers": {"ls-graphics": {"type": "http", "url": "…"}}}` | VS Code |
|
|
102
|
+
| JSON `mcpServers` with `"command": "npx"`, `"args": ["-y", "mcp-remote@0.16.7", "https://mcp.ls.graphics/mcp"]` | agents that start a command and cannot take a URL (Claude Desktop); needs Node.js; the bridge is pinned to an exact version |
|
|
103
|
+
| TOML `[mcp_servers.ls-graphics]` / `url = "…"` | Codex style |
|
|
104
|
+
| YAML `mcp_servers:` / `ls-graphics:` / `url: …` | Hermes Agent style (it also wants `auth: oauth`) |
|
|
105
|
+
| the bare address `https://mcp.ls.graphics/mcp` | any settings screen with a URL box: choose OAuth, and sign in to ls.graphics when it asks |
|
|
106
|
+
|
|
107
|
+
ChatGPT and claude.ai are added in their settings, not in a file; `--print` ends with the steps (see below).
|
|
108
|
+
|
|
109
|
+
**3. Detected MCP configs.** The wizard looks (read-only, at most ~180 ms) for MCP configs of agents it does not know: the file names
|
|
110
|
+
`mcp.json`, `mcp_config.json`, `settings.json`, `config.json`, `config.yaml` and `config.toml` in the dot-folders of your home folder
|
|
111
|
+
(two levels), in `~/.config/*` and in the app-data folder (one level), that already hold an MCP servers key. Each is listed as
|
|
112
|
+
`Detected MCP config: <path> (unknown agent)` and offered in the agent list, **unselected**. A file you did not select is never opened for
|
|
113
|
+
writing; with `--yes` they are only listed.
|
|
114
|
+
|
|
115
|
+
The skill for an unknown agent: it goes to `~/.agents/skills/ls-graphics` as usual (the universal folder several agents read), and, in a
|
|
116
|
+
terminal, you are asked for a folder of your own (`--skill-dir DIR` does the same without a terminal); the skill is written to
|
|
117
|
+
`<folder>/ls-graphics`.
|
|
118
|
+
|
|
119
|
+
## Anonymous setup stats
|
|
120
|
+
|
|
121
|
+
So that we can see which agents people try to connect and where setup fails, the wizard sends **one** small event at the end of a run
|
|
122
|
+
(`POST https://mcp.ls.graphics/v1/telemetry/connect`, 1.5 s timeout at most, errors ignored: it never blocks or fails the wizard, and a
|
|
123
|
+
server that does not have the endpoint yet (404) changes nothing). The last line of a run says so:
|
|
124
|
+
"Anonymous setup stats help us support more agents; turn off with --no-telemetry".
|
|
125
|
+
|
|
126
|
+
**Turn it off:** `--no-telemetry`, `LSG_TELEMETRY=0`, or `DO_NOT_TRACK=1`. In CI (`CI`, `GITHUB_ACTIONS`, ...) it is off unless you set
|
|
127
|
+
`LSG_TELEMETRY=1`. With any of these nothing is sent and the line is not printed.
|
|
128
|
+
|
|
129
|
+
**What is sent, all of it** (the server accepts only this shape and answers 400 to anything else):
|
|
130
|
+
|
|
131
|
+
| Field | Value |
|
|
132
|
+
| --- | --- |
|
|
133
|
+
| `v`, `wizard` | the event format (1) and the wizard version |
|
|
134
|
+
| `os`, `arch`, `node` | `darwin` / `linux` / `win32`, `x64` / `arm64` / `ia32`, the Node major version |
|
|
135
|
+
| `interactive`, `yes`, `dry_run`, `print` | which mode the run was in (a `--dry-run` run is sent, with `dry_run: true`; `--print` sends one event too) |
|
|
136
|
+
| `end` | `done`, `cancelled` or `error` |
|
|
137
|
+
| `run` | 16 random hex characters made for this run: not a machine, an account or an install; nothing links two runs |
|
|
138
|
+
| `detected` | which of the known agents were found on the computer (names from the wizard's list) |
|
|
139
|
+
| `chosen` | which ones were set up (`other` for an agent that is not listed) |
|
|
140
|
+
| `results` | per agent: `outcome` (`added`, `already`, `updated`, `failed`, `refused`, `manual`) and, when it did not work, a `reason` code (`invalid_json`, `invalid_yaml`, `invalid_toml`, `unknown_format`, `ambiguous_key`, `no_address_field`, `anchors`, ...) |
|
|
141
|
+
| `others` | for an agent that is not listed: the file's `format` (`json`, `yaml`, `toml`), the servers `key` (`mcpServers`, `servers`, ...), the address `field` (`url`, `serverUrl`, `httpUrl`, `command`) and the config's folder name (see the rule below), or `other` |
|
|
142
|
+
| `unknown_configs` | the folder names (same rule) of the MCP configs of unknown agents the scan found, **including ones you did not select and the wizard did not touch** (at most 10) |
|
|
143
|
+
| `skills` | which skill folders were installed (`claude`, `universal`, `hermes`, `custom`) |
|
|
144
|
+
|
|
145
|
+
**The folder-name rule.** A name is sent only if ALL of these hold; otherwise the value is `other`:
|
|
146
|
+
|
|
147
|
+
- the folder is a dot-folder directly under your home folder (`~/.fooagent`), or a folder directly under `~/.config`, `Library/Application Support` or `AppData/Roaming` / `AppData/Local` (`~/.config/opencode`). Anything else, however deep or wherever, is `other`, including a file straight in the home folder and any path outside the home folder;
|
|
148
|
+
- as it is on disk (case folded, nothing replaced or cut) it matches `^\.?[a-z][a-z0-9-]{1,23}$`: letters, digits and hyphens, 2 to 24 characters, an optional leading dot. No `@`, inner dot, space or underscore;
|
|
149
|
+
- it does not look like a key or an id: no `sk-`, `ghp_`, `key`, `token` or `secret` in it, no run of 6 or more digits, no run of 12 or more hex characters;
|
|
150
|
+
- it does not contain your user name (the words of your home folder's path, whole or in parts of 3 letters or more).
|
|
151
|
+
|
|
152
|
+
Never sent: paths, the home folder, your user name, file contents, server addresses other than ours, keys, your IP address (the server
|
|
153
|
+
uses it only for a per-address rate limit and does not store or forward it), or any machine identifier. On the server the event goes to
|
|
154
|
+
PostHog without a person profile and with geo-IP lookup off (see `mcp/docs/CONNECT-TELEMETRY.md`).
|
|
155
|
+
|
|
156
|
+
An example of the whole event:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"v": 1,
|
|
161
|
+
"run": "0123456789abcdef",
|
|
162
|
+
"wizard": "0.1.3",
|
|
163
|
+
"os": "darwin",
|
|
164
|
+
"arch": "arm64",
|
|
165
|
+
"node": 22,
|
|
166
|
+
"interactive": true,
|
|
167
|
+
"yes": false,
|
|
168
|
+
"dry_run": false,
|
|
169
|
+
"print": false,
|
|
170
|
+
"end": "done",
|
|
171
|
+
"detected": [
|
|
172
|
+
"claude-code",
|
|
173
|
+
"cursor"
|
|
174
|
+
],
|
|
175
|
+
"chosen": [
|
|
176
|
+
"cursor",
|
|
177
|
+
"other"
|
|
178
|
+
],
|
|
179
|
+
"results": [
|
|
180
|
+
{
|
|
181
|
+
"client": "cursor",
|
|
182
|
+
"outcome": "added"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"client": "other",
|
|
186
|
+
"outcome": "manual",
|
|
187
|
+
"reason": "no_address_field"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"others": [
|
|
191
|
+
{
|
|
192
|
+
"format": "json",
|
|
193
|
+
"key": "mcpServers",
|
|
194
|
+
"field": "none",
|
|
195
|
+
"folder": ".fooagent"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"unknown_configs": [
|
|
199
|
+
"opencode",
|
|
200
|
+
".baz"
|
|
201
|
+
],
|
|
202
|
+
"skills": [
|
|
203
|
+
"claude",
|
|
204
|
+
"universal"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
55
209
|
## The skill
|
|
56
210
|
|
|
57
211
|
`SKILL.md` and a few `references/` recipes ship inside this package (no download). They say when and how to use the ls.graphics
|
|
58
212
|
MCP; the per-tool rules come from the server itself. Installed to:
|
|
59
213
|
|
|
60
214
|
- `~/.claude/skills/ls-graphics/` for Claude Code
|
|
61
|
-
- `~/.agents/skills/ls-graphics/` for Codex, Cursor and other tools that read it
|
|
215
|
+
- `~/.agents/skills/ls-graphics/` for Codex, Cursor, Pi and other tools that read it
|
|
216
|
+
- `<your folder>/ls-graphics/` for an agent that is not listed (`--skill-dir`, or asked when you set one up with Other / not listed)
|
|
217
|
+
- `~/.hermes/skills/ls-graphics/` for Hermes Agent (only when Hermes is set up, or with `--skill hermes`; `--skill all` also creates `~/.hermes/skills`)
|
|
62
218
|
|
|
63
219
|
Files carry a hash line. A file you have not touched is updated silently; one you edited is only overwritten when you confirm
|
|
64
220
|
(a backup is kept), and under `--yes` it is skipped.
|