Skip to main content
Glama

IT Tools MCP Server

index.ts•1.53 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; export function registerGenerateAuth(server: McpServer) { server.registerTool("generate_basic_auth", { description: "Generate HTTP Basic Authentication header", inputSchema: { username: z.string().describe("Username"), password: z.string().describe("Password"), }, // VS Code compliance annotations annotations: { title: "Generate Basic Auth", description: "Generate HTTP Basic Authentication header", readOnlyHint: false } }, async ({ username, password }) => { try { const credentials = `${username}:${password}`; const encoded = Buffer.from(credentials, 'utf-8').toString('base64'); const authHeader = `Basic ${encoded}`; return { content: [ { type: "text", text: `HTTP Basic Auth Header: Authorization: ${authHeader} Credentials: ${username}:${password} Base64 Encoded: ${encoded} Usage in curl: curl -H "Authorization: ${authHeader}" https://api.example.com Usage in fetch: fetch('https://api.example.com', { headers: { 'Authorization': '${authHeader}' } })`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error generating basic auth: ${error instanceof Error ? error.message : 'Unknown 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/wrenchpilot/it-tools-mcp'

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