@takeokunn/gbrainx-mcp 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +51 -2
- package/dist/bin.cjs +17219 -0
- package/package.json +25 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 takeokunn
|
|
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,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @takeokunn/gbrainx-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A stdio [MCP](https://modelcontextprotocol.io) server that lets Claude Code search, buy and load GbrainX knowledge packs. It talks to the local app from [`@takeokunn/gbrainx`](https://www.npmjs.com/package/@takeokunn/gbrainx), so a pack is read as a short summary first and then one page at a time, and content you have loaded stays in a local cache.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
Requires Node.js 20 or later for this server, and Node.js 22.13 or later for the local app.
|
|
8
|
+
|
|
9
|
+
1. Start the local app. It listens on `127.0.0.1:4747`.
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npx -y @takeokunn/gbrainx
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. Register the server in Claude Code.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
claude mcp add gbrainx -- npx -y @takeokunn/gbrainx-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The server connects to `http://127.0.0.1:4747`. To use another address, set `GBRAINX_API_URL` in the environment that starts the MCP server. If the app is not running, the tools return an error that asks you to start it.
|
|
22
|
+
|
|
23
|
+
## Tools
|
|
24
|
+
|
|
25
|
+
| Tool | Input | Result |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| `gbrainx.search` | `query` | Up to five matching packs with `id`, title, description, match score and whether you already own the pack. |
|
|
28
|
+
| `gbrainx.buy` | `packId` | `{ "bought": true }`, or `{ "bought": false, "needsApproval": true, "reason": … }` when the local app refuses (HTTP 402). Buying uses the score from the latest `gbrainx.search`, so search first. |
|
|
29
|
+
| `gbrainx.load` | `packId`, optional `page` | Without `page`, the pack summary and the list of page ids. With `page`, that one page. Errors when the pack is not purchased and not cached. |
|
|
30
|
+
|
|
31
|
+
`gbrainx.load` wraps the pack text in a `<gbrain-reference>` block and labels it as reference information, not as instructions.
|
|
32
|
+
|
|
33
|
+
## Cache and data
|
|
34
|
+
|
|
35
|
+
- Loaded summaries and pages are saved under `~/.gbrainx/cache/<packId>@<version>/` with a sha256 checksum per file. A later `load` of the same content reads the cache and makes no request. An entry that fails its checksum is deleted and fetched again.
|
|
36
|
+
- `npx -y @takeokunn/gbrainx cache clear` deletes the cache.
|
|
37
|
+
- Packs, wallet and purchases live in the local app's store at `~/.gbrainx/store.json` (or `GBRAINX_STORE_DIR`), not in this package.
|
|
38
|
+
|
|
39
|
+
## Limits
|
|
40
|
+
|
|
41
|
+
- Purchases move a balance inside the local app's store. No real payment is made. The app refuses a purchase when the match score is below 0.5, or when it exceeds the per-purchase or session cap, or the balance.
|
|
42
|
+
- The tools run one at a time, in the order Claude Code sends them.
|
|
43
|
+
- `--help` prints the usage and does not start the server.
|
|
44
|
+
|
|
45
|
+
## Links
|
|
46
|
+
|
|
47
|
+
- Source and issues: <https://github.com/takeokunn/gbrainx>
|
|
48
|
+
- Local app and CLI: <https://www.npmjs.com/package/@takeokunn/gbrainx>
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|