tiny-http-mcp-server 0.1.29 → 0.1.30

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.
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "name": "tiny-http-mcp-server",
21
- "version": "0.1.29",
21
+ "version": "0.1.30",
22
22
  "license": "MIT"
23
23
  },
24
24
  {
@@ -104,6 +104,10 @@ Discovery binds an expired or explicitly rejected grant before silent refresh,
104
104
  using the original configured client. Persisted sessions take precedence,
105
105
  including sessions whose tokens have been cleared; an import cannot revive them.
106
106
  Input tokens are copied and invalid expiry values fail before authorization.
107
+ Static clients and dynamic initial-grant imports require cached grants to match
108
+ the original normalized client ID and secret. A different client configuration
109
+ fails before attaching or refreshing credentials and retains the stored record;
110
+ select separate persistence or explicitly reset the session to change apps.
107
111
 
108
112
  `createAuthStoreSessionStore(options)` accepts the standard `auth-store` config.
109
113
 
@@ -140,6 +140,11 @@ export function createDefaultOAuthClientProvider(options) {
140
140
  if (forceRefresh && rejectedTokens !== undefined && (rejectedTokens === null || session?.tokens === undefined || !sameTokenGrant(session.tokens, rejectedTokens)))
141
141
  forceRefresh = false;
142
142
  const sessionDiscovery = resolveDiscovery(discovery, session);
143
+ if ((options.client.mode === "static" || initialGrant !== undefined) && session !== null && (session.tokens !== undefined || session.refreshState === "pending")) {
144
+ const configured = normalizeConfiguredClient(options.client);
145
+ if (configured === null || configured.clientId !== session.client.clientId || configured.clientSecret !== session.client.clientSecret)
146
+ throw new Error("Stored session belongs to a different OAuth client; use separate persistence or explicitly reset it");
147
+ }
143
148
  if (session?.refreshState === "pending") {
144
149
  if (!allowInteractive || options.allowInteractive === false || sessionDiscovery === undefined)
145
150
  throw new Error("OAuth refresh outcome is unknown; authorize again before using this resource");
@@ -4958,6 +4958,11 @@ function createDefaultOAuthClientProvider(options) {
4958
4958
  if (forceRefresh && rejectedTokens !== void 0 && (rejectedTokens === null || session?.tokens === void 0 || !sameTokenGrant(session.tokens, rejectedTokens)))
4959
4959
  forceRefresh = false;
4960
4960
  const sessionDiscovery = resolveDiscovery(discovery, session);
4961
+ if ((options.client.mode === "static" || initialGrant !== void 0) && session !== null && (session.tokens !== void 0 || session.refreshState === "pending")) {
4962
+ const configured = normalizeConfiguredClient(options.client);
4963
+ if (configured === null || configured.clientId !== session.client.clientId || configured.clientSecret !== session.client.clientSecret)
4964
+ throw new Error("Stored session belongs to a different OAuth client; use separate persistence or explicitly reset it");
4965
+ }
4961
4966
  if (session?.refreshState === "pending") {
4962
4967
  if (!allowInteractive || options.allowInteractive === false || sessionDiscovery === void 0)
4963
4968
  throw new Error("OAuth refresh outcome is unknown; authorize again before using this resource");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-http-mcp-server",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Minimal MCP server over HTTP built on tiny-stdio-mcp-server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",