feat: 添加云端 MCP 功能和相关数据

- 新增 111.json 和 222.json 文件,包含 lottery 数据
- 添加 custom_functions.py 文件,实现云端 MCP 功能
  - 序列生成和预测
  -逻辑验证
  - 绘图功能
- 创建 mcp.json 文件,配置 MCP 服务器
This commit is contained in:
2025-08-13 17:17:12 +08:00
parent b50b46f7fe
commit 090f7238fc
7 changed files with 6305 additions and 1 deletions

38
.roo/custom_functions.py Normal file
View File

@@ -0,0 +1,38 @@
### 云端 MCP序列助手
import httpx
def generate_sequence(rule: str, length: int = 10) -> list[int]:
"""
按给定递推规则生成整数序列
generate_sequence("a(n)=a(n-1)+2**(n-2),a(1)=2", 8)
"""
url = "https://web-mcp.ziziyi.com/sequence/generate"
r = httpx.post(url, json={"rule": rule, "length": length}, timeout=10)
return r.json()["sequence"]
def predict_next(seq: list[int], k: int = 3) -> list[int]:
"""
根据已知序列预测后续 k 项
"""
url = "https://web-mcp.ziziyi.com/sequence/predict"
r = httpx.post(url, json={"sequence": seq, "k": k}, timeout=10)
return r.json()["prediction"]
### 云端 MCP逻辑验证
def solve_smt(formula: str) -> bool:
"""
用 Z3 在线验证公式是否对所有 n 成立
solve_smt("forall n: 1<=n<=100, seq[n]==seq[n-1]+2**(n-2)")
"""
url = "https://web-mcp.ziziyi.com/logic/solve"
r = httpx.post(url, json={"formula": formula}, timeout=10)
return r.json()["result"]
### 云端 MCP绘图
def plot_line(seq: list[int]) -> str:
"""
把序列画成折线图,返回 png 直链
"""
url = "https://web-mcp.ziziyi.com/plot/line"
r = httpx.post(url, json={"sequence": seq}, timeout=10)
return r.json()["image_url"]

3
.roo/mcp.json Normal file
View File

@@ -0,0 +1,3 @@
{
"mcpServers": {}
}