Skip to main content
Glama
storage.ts724 B
// Storage 服务 import { DEFAULT_API_BASE_URL } from '../constants' export const StorageService = { /** * 获取 API 基础 URL */ async getApiBaseUrl(): Promise<string> { try { const result = await chrome.storage.sync.get(['apiBaseUrl']) return result.apiBaseUrl || DEFAULT_API_BASE_URL } catch (error) { console.warn('读取 API 配置失败,使用默认值:', error) return DEFAULT_API_BASE_URL } }, /** * 设置 API 基础 URL */ async setApiBaseUrl(url: string): Promise<void> { try { await chrome.storage.sync.set({ apiBaseUrl: url }) } catch (error) { console.error('保存 API 配置失败:', error) throw error } }, }

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