@expcat/tigercat-mcp 2.0.0-rc.2 → 2.0.0
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/dist/index.js +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
|
+
import { realpathSync, existsSync } from 'fs';
|
|
3
4
|
import { resolve, join, relative, isAbsolute, dirname } from 'path';
|
|
4
5
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
6
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
7
|
import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
-
import { existsSync } from 'fs';
|
|
8
8
|
import { access, readFile, realpath, readdir } from 'fs/promises';
|
|
9
9
|
|
|
10
10
|
var DEFAULT_MAX_BYTES = 12e3;
|
|
@@ -885,7 +885,14 @@ function helpText() {
|
|
|
885
885
|
" tigercat-mcp --root /path/to/Tigercat"
|
|
886
886
|
].join("\n");
|
|
887
887
|
}
|
|
888
|
-
var isDirectRun =
|
|
888
|
+
var isDirectRun = (() => {
|
|
889
|
+
if (process.argv[1] === void 0) return false;
|
|
890
|
+
try {
|
|
891
|
+
return fileURLToPath(import.meta.url) === realpathSync(resolve(process.argv[1]));
|
|
892
|
+
} catch {
|
|
893
|
+
return false;
|
|
894
|
+
}
|
|
895
|
+
})();
|
|
889
896
|
if (isDirectRun) {
|
|
890
897
|
main().catch((error) => {
|
|
891
898
|
console.error(error instanceof Error ? error.message : String(error));
|