Skip to main content
Glama

Cut-Copy-Paste Clipboard Server

cli.ts•2.37 kB
#!/usr/bin/env node /** * CLI entry point for MCP Cut-Copy-Paste Clipboard Server */ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { DatabaseManager } from './lib/database.js'; import { ClipboardServer } from './server.js'; /** * Display help information */ function showHelp(): void { console.log(` cut-copy-paste-mcp v1.0.0 Usage: cut-copy-paste-mcp [options] Options: --help Show this help message --version Show version number Description: MCP server providing cut, copy, paste, and undo operations for AI-assisted coding agents. Runs as an MCP stdio server for integration with AI coding tools. Examples: # Start the server npx cut-copy-paste-mcp # Show help npx cut-copy-paste-mcp --help For more information, visit: https://github.com/Pr0j3c7t0dd-Ltd/cut-copy-paste-mcp `); } /** * Display version information */ function showVersion(): void { console.log('1.0.0'); } /** * Main CLI function */ async function main(): Promise<void> { const args = process.argv.slice(2); // Handle flags if (args.includes('--help') || args.includes('-h')) { showHelp(); process.exit(0); } if (args.includes('--version') || args.includes('-v')) { showVersion(); process.exit(0); } // Initialize database const dbManager = new DatabaseManager(); // Create clipboard server const clipboardServer = new ClipboardServer(dbManager); // Get the underlying MCP server const mcpServer = clipboardServer.getMCPServer(); // Setup stdio transport const transport = new StdioServerTransport(); // Connect server to transport await mcpServer.connect(transport); // Log startup (to stderr so it doesn't interfere with MCP protocol on stdout) console.error('MCP Cut-Copy-Paste Clipboard Server started successfully'); console.error('Listening for MCP requests on stdio...'); // Handle graceful shutdown process.on('SIGINT', () => { console.error('\nShutting down MCP Cut-Copy-Paste Clipboard Server...'); dbManager.close(); process.exit(0); }); process.on('SIGTERM', () => { console.error('\nShutting down MCP Cut-Copy-Paste Clipboard Server...'); dbManager.close(); process.exit(0); }); } // Run main function main().catch((error) => { console.error('Fatal error:', error); process.exit(1); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pr0j3c7t0dd-Ltd/cut-copy-paste-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server