@toolsdk.ai/registry 1.0.148 → 1.0.149

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.
@@ -6,7 +6,7 @@
6
6
  * 2. Callback: Exchange code for tokens + Notify caller
7
7
  * 3. Refresh: Refresh access token
8
8
  */
9
- import { getServerPort } from "../../shared/config/environment";
9
+ import { getRegistryBaseUrl } from "../../shared/config/environment";
10
10
  import { createErrorResponse, createResponse } from "../../shared/utils/response-util";
11
11
  import { repository } from "../package/package-handler";
12
12
  import { oauthSessionStore } from "./oauth-session";
@@ -15,10 +15,8 @@ import { buildAuthorizationUrl, discoverAuthServerMetadata, discoverProtectedRes
15
15
  * Get the Registry's OAuth callback URL
16
16
  */
17
17
  function getRegistryCallbackUrl() {
18
- const port = getServerPort();
19
- const host = process.env.REGISTRY_HOST || `localhost:${port}`;
20
- const protocol = process.env.REGISTRY_PROTOCOL || "http";
21
- return `${protocol}://${host}/api/v1/oauth/callback`;
18
+ const baseUrl = getRegistryBaseUrl();
19
+ return `${baseUrl}/api/v1/oauth/callback`;
22
20
  }
23
21
  /**
24
22
  * Get MCP Server URL from package configuration
@@ -16,4 +16,5 @@ export declare function getMeiliSearchConfig(): {
16
16
  apiKey: string | null;
17
17
  };
18
18
  export declare function getServerPort(): number;
19
+ export declare function getRegistryBaseUrl(): string;
19
20
  export declare function isSearchEnabled(): boolean;
@@ -41,6 +41,14 @@ export function getServerPort() {
41
41
  const port = process.env.PORT || process.env.MCP_SERVER_PORT;
42
42
  return port ? parseInt(port, 10) : 3003;
43
43
  }
44
+ export function getRegistryBaseUrl() {
45
+ const baseUrl = process.env.REGISTRY_BASE_URL;
46
+ if (baseUrl) {
47
+ return baseUrl.replace(/\/$/, "");
48
+ }
49
+ const port = getServerPort();
50
+ return `http://localhost:${port}`;
51
+ }
44
52
  export function isSearchEnabled() {
45
53
  return process.env.ENABLE_SEARCH === "true";
46
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolsdk.ai/registry",
3
- "version": "1.0.148",
3
+ "version": "1.0.149",
4
4
  "description": "An Open, Structured, and Standard Registry for MCP Servers and Packages.",
5
5
  "keywords": [
6
6
  "mcp",