Skip to main content
Glama
api.ts713 B
// API 服务 import type { ChatRequest, ChatResponse } from '../types' /** * 通过 background script 发送聊天请求(绕过 CORS) */ export async function sendChatRequest(requestData: ChatRequest): Promise<ChatResponse> { return new Promise((resolve, reject) => { chrome.runtime.sendMessage( { action: 'chatRequest', data: requestData, }, (response) => { if (chrome.runtime.lastError) { reject(new Error(chrome.runtime.lastError.message)) return } if (!response.success) { reject(new Error(response.error || '请求失败')) return } resolve(response.data) } ) }) }

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/luyike221/xiaohongshu-mcp-python'

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