人类设计MCP服务器
MCP Server可根据出生日期、时间和地点计算人类设计地图。它与N8N和其他支持Model Context协议的系统兼容。
描述
此服务器提供计算人类设计地图的工具,包括:
- 歧管、发生器、歧管发生器、投影仪、反射器
- 战略与权威的计算
- 配置文件的计算
- 检测活动门(Gates)及其线
- 确定某些中心
- Incarnation Cross的计算
安装
要求
- Node.js>=18.0.0
- NPM或Yarn
建立依赖关系
cd human_design
npm install装配
npm run build使用
启动服务器
HTTP服务器(дляRailway/n8n):
npm startMCP服务器(通过STDIO):
npm run start:mcp📚 服务器使用Swiss Ephemeris进行精确计算
HTTP服务器在端口3000(或ENV端口)上运行,并准备接受请求。
服务器工具
1.计算_人力设计
人类设计的完整地图。
参数:
birthDate(字符串,必需):YYYY-MM-DD格式的出生日期birthTime(字符串,必需):HH格式的出生时间:mmbirthLocation(字符串,必填):出生地(城市,国家)latitude(编号,可选):出生地纬度longitude(编号,可选):出生地经度
查询示例:
{
"name": "calculate_human_design",
"arguments": {
"birthDate": "1990-05-15",
"birthTime": "14:30",
"birthLocation": "Москва, Россия",
"latitude": 55.7558,
"longitude": 37.6173
}
}答案示例:
{
"birthDate": "1990-05-15",
"birthTime": "14:30",
"birthLocation": "Москва, Россия",
"type": {
"name": "Generator",
"description": "Генератор"
},
"strategy": "Отвечать",
"authority": {
"name": "Sacral",
"description": "Сакральная авторитет"
},
"profile": {
"number": "3/5",
"description": "Профиль 3/5"
},
"gates": [
{
"number": 19,
"name": "Approach",
"line": 2,
"planet": "Sun"
},
{
"number": 49,
"name": "Revolution",
"line": 4,
"planet": "Earth"
}
],
"definedCenters": [
{
"number": 2,
"name": "Sacral Center"
}
],
"incarnationCross": {
"sunGate": 19,
"earthGate": 19,
"cross": "Cross of 19 / 19"
}
}
2.获取_人_设计_定义
获取Human Design组件的定义和值。
参数:
component(string,必需):定义组件
- type 人类设计类型 - authority -权威 - profile -简介 - gates -门 - channels -渠道 - centers -中心
查询示例:
{
"name": "get_human_design_definition",
"arguments": {
"component": "type"
}
}与N8N集成
方法1:使用HTTP Request Node
为MCP服务器创建Web包装:
// wrapper-server.js
import express from 'express';
import { spawn } from 'child_process';
import readline from 'readline';
const app = express();
app.use(express.json());
app.post('/calculate', async (req, res) => {
const mcpServer = spawn('node', ['index.js']);
const rl = readline.createInterface({
input: mcpServer.stdout,
output: mcpServer.stdin,
});
// Отправка MCP запроса
const request = {
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'calculate_human_design',
arguments: req.body,
},
};
mcpServer.stdin.write(JSON.stringify(request) + '\n');
// Чтение ответа
rl.once('line', (response) => {
const result = JSON.parse(response);
res.json(result.result);
});
});
app.listen(3000, () => {
console.log('MCP wrapper server running on port 3000');
});使用N8N HTTP Request Node:
- 方法:POST
- 网址:
http://localhost:3000/calculate - 主体:
{"birthDate": "...", "birthTime": "...", "birthLocation": "..."}
方法2:在N8N中使用Function Node
在N8N中,使用function node直接调用模块:
const { calculateHumanDesign } = require('/path/to/human_design/src/calculations.js');
// Получить данные из предыдущего узла
const birthDate = $input.item.json.birthDate;
const birthTime = $input.item.json.birthTime;
const birthLocation = $input.item.json.birthLocation;
// Рассчитать Human Design
const result = await calculateHumanDesign({
birthDate,
birthTime,
birthLocation,
});
return {
json: {
...result,
timestamp: new Date().toISOString(),
}
};方法3:使用sub-workflow
在N8N中创建一个单独的Workflow:
- webhook trigger下载请求
- Function Node与Human Design
- HTTP response node发送结果
工作流json:
{
"name": "Human Design Calculator",
"nodes": [
{
"parameters": {},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [250, 300]
},
{
"parameters": {
"jsCode": "const { calculateHumanDesign } = require('/path/to/human_design/src/calculations.js');\n\nconst result = await calculateHumanDesign({\n birthDate: $input.item.json.birthDate,\n birthTime: $input.item.json.birthTime,\n birthLocation: $input.item.json.birthLocation,\n});\n\nreturn { json: result };"
},
"name": "Calculate HD",
"type": "n8n-nodes-base.function",
"position": [450, 300]
},
{
"parameters": {},
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"position": [650, 300]
}
],
"connections": {
"Webhook": { "main": [[{ "node": "Calculate HD", "type": "main", "index": 0 }]] },
"Calculate HD": { "main": [[{ "node": "Respond to Webhook", "type": "main", "index": 0 }]] }
}
}与其他系统集成
克劳德桌面
将服务器添加到Claude Desktop配置:
{
"mcpServers": {
"human-design": {
"command": "node",
"args": ["/absolute/path/to/human_design/index.js"]
}
}
}自定义MCP客户端
Node.js中的使用示例:
import { spawn } from 'child_process';
import readline from 'readline';
const mcpServer = spawn('node', ['index.js']);
const rl = readline.createInterface({
input: mcpServer.stdout,
output: mcpServer.stdin,
});
async function calculateHumanDesign(birthDate, birthTime, birthLocation) {
const request = {
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'calculate_human_design',
arguments: {
birthDate,
birthTime,
birthLocation,
},
},
};
mcpServer.stdin.write(JSON.stringify(request) + '\n');
return new Promise((resolve, reject) => {
rl.once('line', (response) => {
const result = JSON.parse(response);
if (result.error) {
reject(new Error(result.error.message));
} else {
resolve(result.result);
}
});
});
}
// Использование
const result = await calculateHumanDesign('1990-05-15', '14:30', 'Москва, Россия');
console.log(result);项目结构
human_design/
├── http-server.js # HTTP Server для Railway/n8n
├── index-with-swiss.js # MCP Server через stdio
├── package.json # Зависимости проекта
├── README.md # Документация
├── QUICKSTART.md # Быстрый старт
├── RAILWAY_DEPLOY.md # Инструкция по деплою на Railway
├── N8N_SETUP.md # Интеграция с n8n
└── src/
└── calculations-cjs.cjs # Расчеты Human Design (Swiss Ephemeris)开发
开发运行
npm run dev当文件更改时,服务器将自动重新启动。
测试
要测试,请发送MCP请求:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node index.js许可证
麻省理工学院
支持
对于问题和建议,请在项目存储库中创建一个问题。
备注
- 人类设计使用热带黄道带(不像吠陀占星术中那样是恒星)
- 基于Swiss Ephemeris的行星位置精度计算
- 该项目仅使用具有精确计算的瑞士Ephemeris版本
- 安装时需要编译本机模块
Swiss Ephemeris安装要求
编译Swiss Ephemeris需要build tools:
macOS:
xcode-select --installUbuntu/Debian:
sudo apt-get update
sudo apt-get install build-essential python3窗户: 安装 Visual Studio生成工具
见E/CN.4/Sub.2/2000/SR.1。 SWISS_EPHEMERIS.md 有关安装的详细信息。
