@mcpsq/mcpsq
Advanced tools
Comparing version
@@ -15,2 +15,47 @@ #!/usr/bin/env node | ||
const node_inspector_1 = require("node:inspector"); | ||
// CLI argument parsing | ||
const args = process.argv.slice(2); | ||
const showHelp = args.includes('--help') || args.includes('-h'); | ||
const showVersion = args.includes('--version') || args.includes('-v'); | ||
if (showHelp) { | ||
console.log(` | ||
MCPSQ - MCP Server Discovery and Management Tool | ||
Usage: | ||
npx @mcpsq/mcpsq [options] | ||
mcpsq [options] | ||
Options: | ||
--help, -h Show this help message | ||
--version, -v Show version information | ||
--port <port> Specify port (default: 3000) | ||
Description: | ||
MCPSQ is an MCP server that helps you discover and manage other MCP servers. | ||
When started, it provides an HTTP server with MCP tools for: | ||
- Finding relevant MCP servers | ||
- Adding MCP servers to Cursor configuration | ||
- Listing current MCP servers | ||
- Removing MCP servers from configuration | ||
Examples: | ||
npx @mcpsq/mcpsq # Start the server on port 3000 | ||
npx @mcpsq/mcpsq --port 8080 # Start the server on port 8080 | ||
For more information, visit: https://mcpsq.xyz | ||
`); | ||
process.exit(0); | ||
} | ||
if (showVersion) { | ||
const packageJson = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(__dirname, '..', 'package.json'), 'utf8')); | ||
console.log(`MCPSQ v${packageJson.version}`); | ||
process.exit(0); | ||
} | ||
// Parse port from arguments | ||
const portIndex = args.indexOf('--port'); | ||
const PORT = portIndex !== -1 && args[portIndex + 1] ? parseInt(args[portIndex + 1]) : 3000; | ||
if (isNaN(PORT) || PORT < 1 || PORT > 65535) { | ||
console.error('Error: Invalid port number. Port must be between 1 and 65535.'); | ||
process.exit(1); | ||
} | ||
const cacheFileAndKeyNameToValidatedMcpServerConfig = new Map(); | ||
@@ -289,5 +334,8 @@ const readFullMcpServerListFromDiskAndSetCache = async () => { | ||
// Start the server | ||
const PORT = 3000; | ||
app.listen(PORT, () => { | ||
console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${PORT}`); | ||
console.log(`đ MCPSQ Server started successfully!`); | ||
console.log(`đĄ MCP endpoint: http://localhost:${PORT}/mcp`); | ||
console.log(`đ§ Configure Cursor MCP: Add "mcpsq": {"url": "http://localhost:${PORT}/mcp"} to your mcp.json`); | ||
console.log(`đ Documentation: https://mcpsq.xyz`); | ||
console.log(`âšī¸ Press Ctrl+C to stop the server`); | ||
}); | ||
@@ -294,0 +342,0 @@ // Handle server shutdown |
{ | ||
"name": "@mcpsq/mcpsq", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "build/index.js", | ||
@@ -54,4 +54,5 @@ "types": "build/index.d.ts", | ||
"@modelcontextprotocol/sdk": "^1.4.0", | ||
"express": "^5.1.0" | ||
"express": "^5.1.0", | ||
"zod": "^3.23.8" | ||
} | ||
} |
86442
2.13%2233
1.96%3
50%+ Added