Skip to main content
Glama
client.ts1.22 kB
import { SendGrpcClientRequest, SendGrpcClientResponse } from "./Grpc/GrpcClient/GrpcClient.js"; import { grpcClientSender } from "./Grpc/GrpcClient/GrpcClientSender.js"; export type ClientRequest = { path: string; address: string; service: string; method: string; body: string; headers?: Record<string, string>; config?: { deadLine?: number; SSL?: boolean; }; }; export type ClientResponse = SendGrpcClientResponse; export const client = { async requestAsync(req: ClientRequest): Promise<ClientResponse> { const grpcRequest: SendGrpcClientRequest = { address: { host: req.address.split(":")[0], port: req.address.split(":")[1] ? Number(req.address.split(":")[1]) : undefined, }, proto: req.path, config: { deadLine: req.config?.deadLine, SSL: req.config?.SSL, }, request: { headers: req.headers, service: req.service, method: req.method, body: req.body, }, }; return await grpcClientSender.sendAsync(grpcRequest); }, };

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/Yuki4-dev/grpc-mcp'

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