Skip to main content
Glama
dacebt

Prompt Cleaner MCP Server

by dacebt
mcp_health.ts1.46 kB
import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js"; async function main() { const transport = new StdioClientTransport({ command: "node", args: ["dist/server.js"], env: process.env, } as any); const client = new Client({ name: "mcp-health-probe", version: "0.0.1" }, { capabilities: {} }); await client.connect(transport); // Important: complete MCP initialize handshake await (client as any).initialize?.(); try { const tools = await (client as any).request(ListToolsRequestSchema, {}); console.log("TOOLS:", tools.tools.map((t: any) => t.name).join(", ")); const health = await (client as any).request(CallToolRequestSchema, { name: "health-ping", arguments: {}, }); console.log("HEALTH:", JSON.stringify(health, null, 2)); const cleaned = await (client as any).request(CallToolRequestSchema, { name: "cleaner", arguments: { prompt: "Make this more professional and concise: 'pls fix the bug soon thx'", mode: "general", temperature: 0.2, }, }); console.log("CLEANER:", JSON.stringify(cleaned, null, 2)); } finally { await client.close?.(); } } main().catch((err) => { console.error("ERROR:", err?.message || err); process.exit(1); });

Latest Blog Posts

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/dacebt/prompt-cleaner-mcp'

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