Skip to main content
Glama

Star MCP

by jlankellii
astro-api.js1.11 kB
import 'dotenv/config'; import axios from 'axios'; const API_KEY = process.env.TIAN_API_KEY; const BASE_URL = 'https://apis.tianapi.com/star/index'; export async function fetchRemoteHoroscope(zodiac) { try { const res = await axios.get(BASE_URL, { params: { key: API_KEY, astro: zodiac // 需传英文小写 } }); if (res.data && res.data.code === 200 && res.data.result) { return res.data.result; } throw new Error(res.data.msg || 'API返回异常'); } catch (e) { return { error: `远程运势获取失败: ${e.message}` }; } } const COMPAT_BASE_URL = 'https://apis.tianapi.com/xingzuo/index'; export async function fetchRemoteCompatibility(me) { try { const res = await axios.get(COMPAT_BASE_URL, { params: { key: API_KEY, me // 传递中文星座名 } }); if (res.data && res.data.code === 200 && res.data.result) { return res.data.result; } throw new Error(res.data.msg || 'API返回异常'); } catch (e) { return { error: `远程配对获取失败: ${e.message}` }; } }

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/jlankellii/star-mcp'

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