@findtime/mcp-server 3.25.8 → 3.25.9
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 +1 -1
- package/server.js +26 -1
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -17,12 +17,19 @@ const SUPPORTED_PROTOCOL_VERSIONS = new Set([
|
|
|
17
17
|
|
|
18
18
|
loadEnvironmentFiles();
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const LOCAL_PACKAGE_METADATA = safeReadJson(LOCAL_PACKAGE_PATH) || null;
|
|
21
|
+
const REPO_PACKAGE_METADATA = safeReadJson(REPO_PACKAGE_PATH) || null;
|
|
22
|
+
const PACKAGE_METADATA = LOCAL_PACKAGE_METADATA || REPO_PACKAGE_METADATA || {};
|
|
21
23
|
const SERVER_VERSION = PACKAGE_METADATA.version || '0.0.0';
|
|
22
24
|
const MCP_PACKAGE_NAME = PACKAGE_METADATA.name || '@findtime/mcp-server';
|
|
23
25
|
const MCP_NPM_REGISTRY_LATEST_URL = `https://registry.npmjs.org/${encodeURIComponent(MCP_PACKAGE_NAME)}/latest`;
|
|
24
26
|
const MCP_NPM_URL = `https://www.npmjs.com/package/${MCP_PACKAGE_NAME}`;
|
|
25
27
|
const MCP_REGISTRY_URL = 'https://registry.modelcontextprotocol.io/?q=io.github.hkchao%2Ffindtime-mcp-server';
|
|
28
|
+
const MCP_INSTALL_MODE = determineInstallMode({
|
|
29
|
+
packageRoot: PACKAGE_ROOT,
|
|
30
|
+
localPackageMetadata: LOCAL_PACKAGE_METADATA,
|
|
31
|
+
repoPackageMetadata: REPO_PACKAGE_METADATA
|
|
32
|
+
});
|
|
26
33
|
const DEFAULT_API_BASE_URL = firstNonEmpty(
|
|
27
34
|
process.env.TIME_API_BASE_URL,
|
|
28
35
|
process.env.FINDTIME_TIME_API_BASE_URL
|
|
@@ -903,6 +910,8 @@ function createFindtimeMcpServer(options = {}) {
|
|
|
903
910
|
mcpLatestVersionHint: latestVersion
|
|
904
911
|
? null
|
|
905
912
|
: 'Could not verify the latest published MCP version automatically. Check the npm package page or Official MCP Registry listing directly.',
|
|
913
|
+
mcpInstallMode: MCP_INSTALL_MODE,
|
|
914
|
+
mcpExecutablePath: path.join(PACKAGE_ROOT, 'server.js'),
|
|
906
915
|
mcpRegistryUrl: MCP_REGISTRY_URL,
|
|
907
916
|
mcpNpmUrl: MCP_NPM_URL,
|
|
908
917
|
apiBaseUrl,
|
|
@@ -1081,6 +1090,22 @@ function tryParseJson(value) {
|
|
|
1081
1090
|
}
|
|
1082
1091
|
}
|
|
1083
1092
|
|
|
1093
|
+
function determineInstallMode({ packageRoot, localPackageMetadata, repoPackageMetadata }) {
|
|
1094
|
+
if (repoPackageMetadata && repoPackageMetadata.name === 'world-time-ai') {
|
|
1095
|
+
return 'repo_checkout';
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
if (localPackageMetadata && localPackageMetadata.name === '@findtime/mcp-server') {
|
|
1099
|
+
return 'npm_package';
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
if (typeof packageRoot === 'string' && packageRoot.includes(`${path.sep}world-time-ai${path.sep}services${path.sep}mcp-server`)) {
|
|
1103
|
+
return 'repo_checkout';
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
return 'package_install';
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1084
1109
|
function startStdioServer(options = {}) {
|
|
1085
1110
|
const server = createFindtimeMcpServer(options);
|
|
1086
1111
|
const messageBuffer = new ContentLengthMessageBuffer();
|