@samanhappy/mcphub 0.0.17 → 0.0.20

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/bin/cli.js CHANGED
@@ -5,20 +5,92 @@ import { fileURLToPath } from 'url';
5
5
  import { execSync } from 'child_process';
6
6
  import fs from 'fs';
7
7
 
8
+ // Enable debug logging if needed
9
+ // process.env.DEBUG = 'true';
10
+
8
11
  const __filename = fileURLToPath(import.meta.url);
9
12
  const __dirname = path.dirname(__filename);
10
- const projectRoot = path.resolve(__dirname, '..');
11
13
 
12
- // Check if frontend dist exists, if not, build it
13
- const frontendDistPath = path.join(projectRoot, 'frontend', 'dist');
14
- if (!fs.existsSync(frontendDistPath)) {
15
- console.log('📦 Building frontend...');
16
- execSync('npm run frontend:build', { stdio: 'inherit', cwd: projectRoot });
14
+ // Start with more debug information
15
+ console.log('📋 MCPHub CLI');
16
+ console.log(`📁 CLI script location: ${__dirname}`);
17
+
18
+ // The npm package directory structure when installed is:
19
+ // node_modules/@samanhappy/mcphub/
20
+ // - dist/
21
+ // - bin/
22
+ // - frontend/dist/
23
+
24
+ // Get the package root - this is where package.json is located
25
+ function findPackageRoot() {
26
+ const isDebug = process.env.DEBUG === 'true';
27
+
28
+ // Possible locations for package.json
29
+ const possibleRoots = [
30
+ // Standard npm package location
31
+ path.resolve(__dirname, '..'),
32
+ // When installed via npx
33
+ path.resolve(__dirname, '..', '..', '..')
34
+ ];
35
+
36
+ // Special handling for npx
37
+ if (process.argv[1] && process.argv[1].includes('_npx')) {
38
+ const npxDir = path.dirname(process.argv[1]);
39
+ possibleRoots.unshift(path.resolve(npxDir, '..'));
40
+ }
41
+
42
+ if (isDebug) {
43
+ console.log('DEBUG: Checking for package.json in:', possibleRoots);
44
+ }
45
+
46
+ for (const root of possibleRoots) {
47
+ const packageJsonPath = path.join(root, 'package.json');
48
+ if (fs.existsSync(packageJsonPath)) {
49
+ try {
50
+ const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
51
+ if (pkg.name === 'mcphub' || pkg.name === '@samanhappy/mcphub') {
52
+ if (isDebug) {
53
+ console.log(`DEBUG: Found package.json at ${packageJsonPath}`);
54
+ }
55
+ return root;
56
+ }
57
+ } catch (e) {
58
+ // Continue to the next potential root
59
+ }
60
+ }
61
+ }
62
+
63
+ console.log('⚠️ Could not find package.json, using default path');
64
+ return path.resolve(__dirname, '..');
17
65
  }
18
66
 
67
+ // Locate and check the frontend distribution
68
+ function checkFrontend(packageRoot) {
69
+ const isDebug = process.env.DEBUG === 'true';
70
+ const frontendDistPath = path.join(packageRoot, 'frontend', 'dist');
71
+
72
+ if (isDebug) {
73
+ console.log(`DEBUG: Checking frontend at: ${frontendDistPath}`);
74
+ }
75
+
76
+ if (fs.existsSync(frontendDistPath) && fs.existsSync(path.join(frontendDistPath, 'index.html'))) {
77
+ console.log('✅ Frontend distribution found');
78
+ return true;
79
+ } else {
80
+ console.log('⚠️ Frontend distribution not found at', frontendDistPath);
81
+ return false;
82
+ }
83
+ }
84
+
85
+ const projectRoot = findPackageRoot();
86
+ console.log(`📦 Using package root: ${projectRoot}`);
87
+
88
+ // Check if frontend exists
89
+ checkFrontend(projectRoot);
90
+
19
91
  // Start the server
20
92
  console.log('🚀 Starting MCPHub server...');
21
- import('../dist/index.js').catch(err => {
93
+ import(path.join(projectRoot, 'dist', 'index.js')).catch(err => {
22
94
  console.error('Failed to start MCPHub:', err);
23
95
  process.exit(1);
24
96
  });
package/dist/server.js CHANGED
@@ -14,6 +14,7 @@ const __filename = fileURLToPath(import.meta.url);
14
14
  const __dirname = path.dirname(__filename);
15
15
  export class AppServer {
16
16
  constructor() {
17
+ this.frontendPath = null;
17
18
  this.app = express();
18
19
  this.port = config.port;
19
20
  }
@@ -26,10 +27,8 @@ export class AppServer {
26
27
  initMiddlewares(this.app);
27
28
  initRoutes(this.app);
28
29
  console.log('Server initialized successfully');
29
- // Serve static frontend files
30
- const frontendDistPath = this.getFrontendDistPath();
31
- console.log(`Serving frontend from: ${frontendDistPath}`);
32
- this.app.use(express.static(frontendDistPath));
30
+ // Find and serve frontend
31
+ this.findAndServeFrontend();
33
32
  initMcpServer(config.mcpHubName, config.mcpHubVersion)
34
33
  .then(() => {
35
34
  console.log('MCP server initialized successfully');
@@ -42,11 +41,6 @@ export class AppServer {
42
41
  .catch((error) => {
43
42
  console.error('Error initializing MCP server:', error);
44
43
  throw error;
45
- })
46
- .finally(() => {
47
- this.app.get('*', (_req, res) => {
48
- res.sendFile(path.join(this.getFrontendDistPath(), 'index.html'));
49
- });
50
44
  });
51
45
  }
52
46
  catch (error) {
@@ -54,30 +48,73 @@ export class AppServer {
54
48
  throw error;
55
49
  }
56
50
  }
51
+ findAndServeFrontend() {
52
+ // Find frontend path
53
+ this.frontendPath = this.findFrontendDistPath();
54
+ if (this.frontendPath) {
55
+ console.log(`Serving frontend from: ${this.frontendPath}`);
56
+ this.app.use(express.static(this.frontendPath));
57
+ // Add the wildcard route for SPA
58
+ if (fs.existsSync(path.join(this.frontendPath, 'index.html'))) {
59
+ this.app.get('*', (_req, res) => {
60
+ res.sendFile(path.join(this.frontendPath, 'index.html'));
61
+ });
62
+ }
63
+ }
64
+ else {
65
+ console.warn('Frontend dist directory not found. Server will run without frontend.');
66
+ this.app.get('/', (_req, res) => {
67
+ res.status(404).send('Frontend not found. MCPHub API is running, but the UI is not available.');
68
+ });
69
+ }
70
+ }
57
71
  start() {
58
72
  this.app.listen(this.port, () => {
59
73
  console.log(`Server is running on port ${this.port}`);
60
- console.log(`Open http://localhost:${this.port} in your browser to access MCPHub`);
74
+ if (this.frontendPath) {
75
+ console.log(`Open http://localhost:${this.port} in your browser to access MCPHub UI`);
76
+ }
77
+ else {
78
+ console.log(`MCPHub API is running on http://localhost:${this.port}, but the UI is not available`);
79
+ }
61
80
  });
62
81
  }
63
82
  getApp() {
64
83
  return this.app;
65
84
  }
66
85
  // Helper method to find frontend dist path in different environments
67
- getFrontendDistPath() {
68
- // First try the local development path
69
- const localPath = path.join(process.cwd(), 'frontend', 'dist');
70
- if (fs.existsSync(localPath)) {
71
- return localPath;
86
+ findFrontendDistPath() {
87
+ // Debug flag for detailed logging
88
+ const debug = process.env.DEBUG === 'true';
89
+ // Get the base directory of the current file
90
+ const baseDir = __dirname;
91
+ const projectRoot = path.resolve(baseDir, '..', '..');
92
+ if (debug) {
93
+ console.log('DEBUG: Current directory:', process.cwd());
94
+ console.log('DEBUG: Script directory:', __dirname);
95
+ console.log('DEBUG: Project root:', projectRoot);
96
+ }
97
+ // Check all possible locations for the frontend dist folder
98
+ const possiblePaths = [
99
+ path.join(projectRoot, 'frontend', 'dist'),
100
+ path.join(process.cwd(), 'frontend', 'dist'),
101
+ path.join(__dirname, '..', '..', 'frontend', 'dist'),
102
+ path.join(__dirname, '..', '..', '..', 'frontend', 'dist')
103
+ ];
104
+ // Special handling for npx
105
+ if (process.argv[1] && process.argv[1].includes('_npx')) {
106
+ const npxDir = path.dirname(process.argv[1]);
107
+ possiblePaths.push(path.join(npxDir, '..', 'frontend', 'dist'));
108
+ }
109
+ if (debug) {
110
+ console.log('DEBUG: Checking paths:', possiblePaths);
72
111
  }
73
- // Then try relative to the current file (when installed as npm package)
74
- const npmPath = path.join(__dirname, '..', '..', 'frontend', 'dist');
75
- if (fs.existsSync(npmPath)) {
76
- return npmPath;
112
+ for (const possiblePath of possiblePaths) {
113
+ if (fs.existsSync(possiblePath) && fs.existsSync(path.join(possiblePath, 'index.html'))) {
114
+ return possiblePath;
115
+ }
77
116
  }
78
- // Default fallback
79
- console.warn('Could not find frontend dist folder, using default path');
80
- return path.join(process.cwd(), 'frontend', 'dist');
117
+ return null;
81
118
  }
82
119
  }
83
120
  export default AppServer;
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,IAAI,MAAM,M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CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC;gBACxF,OAAO,YAAY,CAAC;YACtB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,15 @@
1
1
  {
2
2
  "name": "@samanhappy/mcphub",
3
- "version": "0.0.17",
3
+ "version": "0.0.20",
4
4
  "description": "A hub server for mcp servers",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "bin": {
8
- "mcphub": "./bin/cli.js"
8
+ "mcphub": "bin/cli.js"
9
9
  },
10
10
  "files": [
11
11
  "dist",
12
12
  "bin",
13
- "mcp_settings.json",
14
- "servers.json",
15
13
  "frontend/dist",
16
14
  "README.md",
17
15
  "LICENSE"
@@ -28,7 +26,7 @@
28
26
  "frontend:build": "cd frontend && vite build",
29
27
  "frontend:preview": "cd frontend && vite preview",
30
28
  "dev": "concurrently \"npm run backend:dev\" \"npm run frontend:dev\"",
31
- "prepublishOnly": "npm run build"
29
+ "prepublishOnly": "npm run build && node scripts/verify-dist.js"
32
30
  },
33
31
  "keywords": [
34
32
  "typescript",
package/mcp_settings.json DELETED
@@ -1,45 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "amap": {
4
- "command": "npx",
5
- "args": [
6
- "-y",
7
- "@amap/amap-maps-mcp-server"
8
- ],
9
- "env": {
10
- "AMAP_MAPS_API_KEY": "your-api-key"
11
- }
12
- },
13
- "playwright": {
14
- "command": "npx",
15
- "args": [
16
- "@playwright/mcp@latest",
17
- "--headless"
18
- ]
19
- },
20
- "fetch": {
21
- "command": "uvx",
22
- "args": [
23
- "mcp-server-fetch"
24
- ]
25
- },
26
- "slack": {
27
- "command": "npx",
28
- "args": [
29
- "-y",
30
- "@modelcontextprotocol/server-slack"
31
- ],
32
- "env": {
33
- "SLACK_BOT_TOKEN": "your-bot-token",
34
- "SLACK_TEAM_ID": "your-team-id"
35
- }
36
- }
37
- },
38
- "users": [
39
- {
40
- "username": "admin",
41
- "password": "$2b$10$Vt7krIvjNgyN67LXqly0uOcTpN0LI55cYRbcKC71pUDAP0nJ7RPa.",
42
- "isAdmin": true
43
- }
44
- ]
45
- }