Skip to main content
Glama

MCPControl

clipboard.ts1.49 kB
import clipboardy from 'clipboardy'; import { ClipboardInput } from '../types/common.js'; export async function getClipboardContent(): Promise<{ success: boolean; content?: string; error?: string; }> { try { const content = await clipboardy.read(); return { success: true, content, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } } export async function setClipboardContent( input: ClipboardInput, ): Promise<{ success: boolean; error?: string }> { try { await clipboardy.write(input.text); return { success: true, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } } export async function hasClipboardText(): Promise<{ success: boolean; hasText?: boolean; error?: string; }> { try { const content = await clipboardy.read(); return { success: true, hasText: content.length > 0, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } } export async function clearClipboard(): Promise<{ success: boolean; error?: string }> { try { await clipboardy.write(''); return { success: true, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } }

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/claude-did-this/MCPControl'

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