graphjin 3.18.35 → 3.18.37

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.
Files changed (2) hide show
  1. package/README.md +100 -57
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -81,31 +81,95 @@ GraphJin started
81
81
  REST API: http://localhost:8080/api/v1/rest/
82
82
  Workflows: http://localhost:8080/api/v1/workflows/<name>
83
83
  MCP: http://localhost:8080/api/v1/mcp
84
+ ```
84
85
 
85
- Claude Desktop Configuration
86
- ────────────────────────────
87
- Add to claude_desktop_config.json:
86
+ ## Add GraphJin To Your AI Client
88
87
 
89
- {
90
- "mcpServers": {
91
- "Webshop Development": {
92
- "command": "/path/to/graphjin",
93
- "args": ["mcp", "--server", "http://localhost:8080"]
94
- }
95
- }
96
- }
88
+ ### Local / Dev
89
+
90
+ Use GraphJin's helper when you want one command that normalizes the URL, probes
91
+ auth, and installs the right Codex or Claude config:
92
+
93
+ ```bash
94
+ graphjin mcp add codex
95
+ graphjin mcp add claude
96
+ graphjin mcp add all http://localhost:8080
97
+ ```
98
+
99
+ Defaults are `client=codex`, `server=http://localhost:8080`, and project scope.
100
+ The command normalizes the server to `http://localhost:8080/api/v1/mcp`. Local
101
+ non-TLS HTTP is correct for loopback development; hosted servers should use
102
+ HTTPS.
103
+
104
+ If you prefer native client commands, add GraphJin's Streamable HTTP endpoint
105
+ directly:
106
+
107
+ ```bash
108
+ codex mcp add graphjin --url http://localhost:8080/api/v1/mcp
109
+ claude mcp add --transport http graphjin http://localhost:8080/api/v1/mcp
110
+ ```
111
+
112
+ GraphJin's `/api/v1/mcp` endpoint is Streamable HTTP, so Claude should use
113
+ `--transport http` for GraphJin. SSE is only for older/custom MCP servers.
114
+
115
+ Use `--global` when you want the MCP connection available outside the current project:
116
+
117
+ ```bash
118
+ graphjin mcp add codex --global
119
+ ```
120
+
121
+ Codex can also add non-URL stdio MCP servers with the generic command shape:
122
+
123
+ ```bash
124
+ codex mcp add <server-name> -- <command> [args...]
97
125
  ```
98
126
 
99
- Copy the JSON config shown and add it to your Claude Desktop config file (see below for file location). You can also click `File > Settings > Developer` to get to it in Claude Desktop. You will also need to **Restart Claude Desktop**
127
+ ### Hosted GraphJin With OAuth
128
+
129
+ When `mcp.oauth.enabled: true` is configured on a hosted GraphJin server, modern
130
+ MCP clients can add it by URL and handle OAuth login themselves:
100
131
 
101
- | OS | Possible config file locations |
102
- |----|---------------------|
103
- | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
104
- | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
132
+ ```bash
133
+ codex mcp add graphjin --url https://graphjin.example.com/api/v1/mcp
134
+ claude mcp add --transport http graphjin https://graphjin.example.com/api/v1/mcp
135
+ ```
105
136
 
106
- ## Authenticate the CLI / MCP
137
+ This is the native remote-MCP path. GraphJin serves OAuth protected-resource
138
+ metadata, authorization-server metadata, DCR/CIMD discovery, and MCP 401
139
+ challenges so the client can discover login automatically. See the official
140
+ [OpenAI Docs MCP quickstart](https://platform.openai.com/docs/docs-mcp) for the
141
+ Codex `mcp add --url` flow and the
142
+ [Claude Code MCP docs](https://docs.claude.com/en/docs/claude-code/mcp) for
143
+ Claude's HTTP transport and authentication flow.
107
144
 
108
- Before `graphjin cli` or `graphjin mcp` can talk to a server, point them at one. There are no `--server` or `--token` flags — both come from a single saved config file (`~/.config/graphjin/client.json`, mode `0600`):
145
+ For legacy/custom SSE servers, use Claude's SSE transport explicitly:
146
+
147
+ ```bash
148
+ claude mcp add --transport sse <name> <url>
149
+ claude mcp add --transport sse private-api https://api.company.com/sse \
150
+ --header "X-API-Key: your-key-here"
151
+ ```
152
+
153
+ ### Legacy / Current `auth_login` Fallback
154
+
155
+ If a server still uses GraphJin's current `auth_login` device-code flow instead of standards OAuth, `graphjin mcp add` detects that automatically:
156
+
157
+ ```bash
158
+ graphjin mcp add codex https://graphjin.example.com
159
+ ```
160
+
161
+ The command opens the device-code login, saves `~/.config/graphjin/client.json`, and installs a credential-free local proxy config for the AI client. Re-run `graphjin mcp setup https://graphjin.example.com` later only when you want to refresh or rotate that saved CLI/proxy token.
162
+
163
+ The deprecated aliases still work for scripts:
164
+
165
+ ```bash
166
+ graphjin mcp install codex https://graphjin.example.com
167
+ graphjin mcp plugin install https://graphjin.example.com # deprecated Claude alias
168
+ ```
169
+
170
+ ## Authenticate The CLI
171
+
172
+ Before `graphjin cli` can talk to a server, point it at one. There are no `--server` or `--token` flags — both come from a single saved config file (`~/.config/graphjin/client.json`, mode `0600`):
109
173
 
110
174
  ```bash
111
175
  graphjin cli setup http://localhost:8080 # local dev, no auth needed
@@ -132,6 +196,7 @@ To enable built-in login, set this on the server:
132
196
 
133
197
  ```yaml
134
198
  auth:
199
+ type: jwt
135
200
  jwt:
136
201
  secret: "long-random-shared-secret" # used to sign and verify local JWTs
137
202
 
@@ -143,42 +208,15 @@ auth_login:
143
208
  client_id: "..."
144
209
  client_secret: "..." # or $GJ_AUTH_LOGIN_OIDC_CLIENT_SECRET
145
210
  allowed_domains: ["example.com"] # optional allow-list
146
- ```
147
-
148
- Successful authentication is recorded in structured logs with the verified `email` and `name` claims (when present), giving you a clean audit trail of who called every endpoint.
149
-
150
- ### MCP install for OpenAI Codex + Claude Code
151
211
 
152
- GraphJin includes a guided installer that configures MCP for OpenAI Codex, Claude Code, or both. Run `graphjin mcp setup <server-url>` first — `mcp install` reads the server URL from `client.json`, and the MCP-client config it writes is credential-free, so rotating tokens (re-running `mcp setup`) needs no edits to Claude / Codex.
153
-
154
- ```bash
155
- graphjin mcp setup https://graphjin.example.com
156
- graphjin mcp install # guided: target client + scope
212
+ mcp:
213
+ oauth:
214
+ enabled: true
215
+ mode: builtin # reuses auth_login identity
216
+ scopes: ["mcp"]
157
217
  ```
158
218
 
159
- #### OpenAI Codex
160
-
161
- <img src="website/public/logos/openai-codex.svg" alt="OpenAI Codex logo" width="280">
162
-
163
- ```bash
164
- graphjin mcp install --client codex --scope global --yes
165
- ```
166
-
167
- #### Claude Code
168
-
169
- <img src="website/public/logos/claude-code.svg" alt="Claude Code logo" width="280">
170
-
171
- ```bash
172
- graphjin mcp install --client claude --scope global --yes
173
- ```
174
-
175
- #### Troubleshooting
176
-
177
- - `mcp install` requires a saved server URL — run `graphjin mcp setup <server-url>` first if you see "no GraphJin server configured".
178
- - The generated MCP-client config is `args: ["mcp"]`. `graphjin mcp` reads server + token from `client.json` on its own, in proxy mode when a server is saved or local mode when it's not.
179
- - If Codex CLI does not support `codex mcp add --scope` (older versions), GraphJin automatically falls back to updating:
180
- - global scope: `~/.codex/config.toml`
181
- - local scope: `.codex/config.toml`
219
+ Successful authentication is recorded in structured logs with the verified `email` and `name` claims (when present), giving you a clean audit trail of who called every endpoint.
182
220
 
183
221
  ## Getting started
184
222
 
@@ -194,13 +232,13 @@ graphjin new my-app
194
232
  graphjin serve --path ./my-app
195
233
  ```
196
234
 
197
- **Step 3: Add to Claude Desktop config file**
235
+ **Step 3: Add GraphJin to an AI client**
198
236
 
199
- Copy paste the Claude Desktop Config provided by `graphjin serve` into the Claude Desktop MCP config file. How to do this has been defined clearly above in the `Try it Now` section.
200
-
201
- **Step 4: Restart Claude Desktop**
237
+ ```bash
238
+ graphjin mcp add claude http://localhost:8080
239
+ ```
202
240
 
203
- **Step 5: Ask Claude questions like:**
241
+ **Step 4: Ask Claude questions like:**
204
242
  - "What tables are in the database?"
205
243
  - "Show me all products under $50"
206
244
  - "List customers and their purchases"
@@ -478,7 +516,12 @@ federation:
478
516
  | `/api/v1/workflows/<name>` | `GET`, `POST` | Legacy workflow execution endpoint. In source mode it is registered only when `mcp.legacy_discovery: true`; use `gj_workflow_execution(insert)` through GraphQL otherwise. |
479
517
  | `/api/v1/openapi.json` | `GET` | OpenAPI 3 spec generated from your saved REST queries. |
480
518
  | `/api/v1/mcp` | `POST` | MCP (Model Context Protocol) HTTP transport — Streamable HTTP, stateless. |
481
- | `/api/v1/mcp/message` | `POST` | MCP HTTP transport for stateless message integrations. |
519
+ | `/api/v1/mcp/message` | `POST` | Legacy MCP message route for older local proxy/client integrations. New clients should use `/api/v1/mcp`. |
520
+ | `/.well-known/oauth-protected-resource[/api/v1/mcp]` | `GET` | MCP OAuth protected-resource metadata (only when `mcp.oauth.enabled`). |
521
+ | `/.well-known/oauth-authorization-server` | `GET` | Built-in MCP OAuth authorization-server metadata (only when `mcp.oauth.enabled`). |
522
+ | `/api/v1/oauth/register` | `POST` | Built-in MCP OAuth dynamic client registration (only in builtin mode). |
523
+ | `/api/v1/oauth/authorize` | `GET` | Built-in MCP OAuth authorization-code + PKCE start (only in builtin mode). |
524
+ | `/api/v1/oauth/token` | `POST` | Built-in MCP OAuth token exchange/refresh (only in builtin mode). |
482
525
  | `/api/v1/discovery` | `GET` | Legacy discovery document. In source mode it is registered only when `mcp.legacy_discovery: true`; use catalog GraphQL roots otherwise. |
483
526
  | `/api/v1/discovery/<section>` | `GET` | Legacy discovery drill-down (e.g. `tables`, `insights`), gated the same way as `/api/v1/discovery`. |
484
527
  | `/api/v1/auth/device` | `POST` | OIDC device-flow start (only if `auth_login.enabled`). |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphjin",
3
- "version": "3.18.35",
3
+ "version": "3.18.37",
4
4
  "description": "GraphJin CLI - Build APIs in 5 minutes with GraphQL",
5
5
  "bin": {
6
6
  "graphjin": "bin/graphjin.js"