一个提供占星图功能的模型上下文协议(MCP)服务器,适用于AI助手。
bun install
bun run start
AstroMCP/
├── src/
│ ├── tools/
│ │ ├── getChart/ # 占星图功能
│ │ └── ... # 其他工具
│ ├── utils/ # 共享工具
│ ├── main.ts # 服务器入口点
│ └── types.ts # 共享类型定义
├── tests/ # 测试文件
├── biome.json # 代码检查配置
├── tsconfig.json # TypeScript 配置
└── package.json # 项目依赖项
get_chart 工具接受三个参数:
date: 日期,格式为YYYY-MM-DDtime: 时间,24小时制(HH:MM:SS)location: 地点,格式为"城市, 国家"示例响应:
占星图(地点:美国纽约,时间:2001年1月1日,凌晨1:01:00):
上升星座在天秤座21度。太阳在摩羯座10度。月亮在双鱼座21度。水星在摩羯座14度。金星在双子宫27度。火星在天蝎座5度。木星在双子座2度。土星在金牛座24度。天王星在双子宫18度。海王星在双子宫5度。冥王星在射手座13度。
太阳位于第四宫。月亮位于第六宫。水星位于第四宫。金星位于第五宫。火星位于第二宫。木星位于第九宫。土星位于第八宫。天王星位于第五宫。海王星位于第五宫。冥王星位于第三宫。
太阳与水星合相(偏差:3.8°)。月亮与土星六分相(偏差:2.8°)。金星与木星四分相(偏差:4.9°)。金星与土星四分相(偏差:2.7°)。火星与海王星四分相(偏差:0.3°)。木星与海王星三分相(偏差:3.2°)。
服务器使用以下API端点:
项目中包含一个脚本帮助创建新的MCP工具:
bun run scripts/create-tool.ts <tool-name>
bun testbun run formatbun run lintbun run build要在Claude Desktop中添加您的AstroMCP服务器:
bun run build
{
"mcpServers": {
"astrology-mcp-server": {
"command": "/path/to/node",
"args": ["/path/to/AstroMCP/dist/main.js"]
}
}
}
npm login
bun run build
npm publish
添加到您的Claude Desktop配置:
{
"mcpServers": {
"astro-server": {
"command": "npx",
"args": ["-y", "astrology-mcp-server"]
}
}
}