通胜 MCP 服务是一个基于 Model Context Protocol (MCP) 的中国传统黄历计算服务,提供公历农历转换、每日宜忌、时辰信息以及传统命理学的详细数据。
要使用通胜 MCP 服务,您需要在 MCP 配置文件中添加以下内容:
{
"mcpServers": {
"tung-shing": {
"command": "npx",
"args": ["-y", "mcp-tung-shing@latest"]
}
}
}
这将通过 npx 安装并运行最新版本的 MCP 通胜服务。
您可以使用 get-tung-shing
工具获取指定日期的黄历信息。
参数名 | 类型 | 必填 | 默认值 | 描述 |
---|---|---|---|---|
startDate |
string | 否 | 当天 | 开始日期,格式:"YYYY-MM-DD" |
days |
number | 否 | 1 | 获取天数 |
includeHours |
boolean | 否 | false | 是否包含时辰信息 |
tabooFilters |
array | 否 | - | 筛选宜忌事项类型,条件之间为或关系 |
tabooFilters[].type |
1 | 2 | 是 | - | 过滤类型:宜(1)、忌(2) |
tabooFilters[].value |
string | 是 | - | 要筛选的宜忌事项 |
{
"toolInput": {
"startDate": "2023-05-01"
}
}
{
"toolInput": {
"startDate": "2023-05-01",
"days": 3
}
}
{
"toolInput": {
"startDate": "2023-05-01",
"includeHours": true
}
}
{
"toolInput": {
"startDate": "2023-05-01",
"tabooFilters": [
{
"type": 1,
"value": "结婚"
},
{
"type": 2,
"value": "出行"
}
]
}
}
这个示例将返回2023年5月1日的黄历信息,并筛选出"宜结婚"或"忌出行"的数据。
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.