@chaindaddy/mcp 0.6.5 → 0.6.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaindaddy/mcp",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "MCP server for Chain Daddy: search tickers, launch a token or verify ownership of one, and run its creator store",
5
5
  "mcpName": "io.chaindaddy/mcp",
6
6
  "homepage": "https://docs.chaindaddy.io/developer/store-and-rewards#tools-for-agents",
@@ -27,7 +27,7 @@ Use discovery: `https://api.chaindaddy.io/.well-known/openid-configuration`
27
27
 
28
28
  Any site can sign people in without registering anything.
29
29
 
30
- Replace `YOUR_SITE` with the site's https origin. Nothing is registered with Chain Daddy.
30
+ Replace `YOUR_SITE` with the site's https origin. Nothing is registered with Chain Daddy. The origin must be public, even while you build (a tunnel or a preview deployment): Chain Daddy's server fetches `client.json`, so `localhost` cannot be a client id.
31
31
 
32
32
  1. Host this at `https://YOUR_SITE/client.json` (served 200, no redirect; `client_id` must equal its own URL):
33
33
 
@@ -136,24 +136,27 @@ With a registered client, or with your `client.json` URL as a public client id.
136
136
  ```ts
137
137
  import * as client from 'openid-client';
138
138
 
139
+ // A client.json site: a public client. No secret; PKCE is the proof.
139
140
  const config = await client.discovery(
140
- new URL('https://api.chaindaddy.io'), process.env.CD_CLIENT_ID!,
141
+ new URL('https://api.chaindaddy.io'), 'https://YOUR_SITE/client.json',
141
142
  { id_token_signed_response_alg: 'ES256' },
142
- client.ClientSecretPost(process.env.CD_CLIENT_SECRET!), // client.None() for a public client
143
+ client.None(),
143
144
  );
145
+ // A registered client with a secret, instead: pass its cdc_… id and
146
+ // client.ClientSecretPost(process.env.CD_CLIENT_SECRET!) in place of client.None().
144
147
 
145
148
  // Sign-in: keep verifier, state and nonce in the visitor's session
146
149
  const verifier = client.randomPKCECodeVerifier();
147
150
  const state = client.randomState();
148
151
  const nonce = client.randomNonce();
149
152
  const url = client.buildAuthorizationUrl(config, {
150
- redirect_uri: 'https://example.com/auth/callback', scope: 'openid wallets',
153
+ redirect_uri: 'https://YOUR_SITE/auth/callback', scope: 'openid wallets',
151
154
  code_challenge: await client.calculatePKCECodeChallenge(verifier), code_challenge_method: 'S256',
152
155
  state, nonce,
153
156
  });
154
157
 
155
158
  // Callback
156
- const tokens = await client.authorizationCodeGrant(config, new URL(req.url, 'https://example.com'), {
159
+ const tokens = await client.authorizationCodeGrant(config, new URL(req.url, 'https://YOUR_SITE'), {
157
160
  pkceCodeVerifier: verifier, expectedState: state, expectedNonce: nonce,
158
161
  });
159
162
  const claims = tokens.claims()!;
@@ -163,8 +166,12 @@ const wallet = (claims.wallets as string[])[0]; // the wallet they signed in wit
163
166
  ```
164
167
 
165
168
  Auth.js: a provider with `type: 'oidc'`, `issuer: 'https://api.chaindaddy.io'`,
166
- `checks: ['pkce', 'state', 'nonce']`, `client: { id_token_signed_response_alg: 'ES256' }`, and a `profile()`
167
- that throws unless `typ === 'signin+v1'`.
169
+ `checks: ['pkce', 'state', 'nonce']`, and a `profile()` that throws unless `typ === 'signin+v1'`. For a
170
+ `client.json` site (a public client): `clientId` is the `client.json` URL, no `clientSecret`, and
171
+ `client: { token_endpoint_auth_method: 'none', id_token_signed_response_alg: 'ES256' }`; without `none` Auth.js
172
+ sends client authentication anyway and the token call answers `401 invalid_client`. List Auth.js's own callback
173
+ (`https://YOUR_SITE/api/auth/callback/chaindaddy` in Next.js) in `redirect_uris`. For a registered client with a
174
+ secret: its `cdc_…` id, `clientSecret`, and `client: { id_token_signed_response_alg: 'ES256' }`.
168
175
 
169
176
  ## Scopes and claims
170
177