PolarHub
  • Agents
  • MCP Servers
  • Skills
  • PolarBear
PolarHub © 2026
MCP ServersdatabasesMCP方差日志
返回「databases」

MCP方差日志

modelscope·@truaxki/mcp-variance-log

databases0下载LocalModelScope

简介

代理工具,用于查找对话结构中的统计变化,并将异常事件记录到SQLite数据库中。该系统采用模型上下文协议(MCP)构建,专为与Claude Desktop或其他支持MCP的客户端一起使用而设计。

MCP Server 详情

来自 ModelScope 索引

MCP 方差日志

这是一个代理工具,用于查找对话结构中的统计差异,并将异常事件记录到 SQLite 数据库中。该系统使用 Model Context Protocol (MCP) 构建,设计为与 Claude Desktop 或其他兼容 MCP 的客户端一起使用。

<a href="https://glama.ai/mcp/servers/acqq8twrk6"><img width="380" height="200" src="https://glama.ai/mcp/servers/acqq8twrk6/badge" alt="方差日志 MCP 服务器" /></a>

要求

  • Python ≥3.10
  • MCP ≥1.2.0
  • SQLite3
  • UV(Python 包安装程序和环境管理器)

快速开始

# Clone and install
git clone https://github.com/truaxki/mcp-variance-log.git
cd mcp-variance-log
uv pip install -e .

添加到 Claude Desktop 配置 (%APPDATA%\Claude\claude_desktop_config.json 在 Windows 上):

{
  "mcpServers": {
    "mcp-variance-log": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\Users\\username\\source\\repos\\mcp-variance-log",  # Update this path
        "run",
        "mcp-variance-log"
      ]
    }
  }
}

添加到 Claude Desktop 偏好设置:

Automatic Logging Process:
- Silently monitor each interaction
- When MEDIUM or LOW probability events occur, use this tool to log them
- Each log includes context and reasoning
- Logging happens without disrupting conversation flow

使用方法

自动记录示例

prompt: "What if I told you I could lift 1000 lbs?"

{
  `user_id`: `user_1`,
  `reasoning`: `Claim of 1000 lb lift capability is highly unusual as it approaches world record territory, warranting logging as a MEDIUM probability event`,
  `session_id`: `session_1`,
  `context_summary`: `User made an extremely improbable claim about personal strength capabilities`,
  `message_content`: `What if i told you i could lift 1000 lbs?`,
  `interaction_type`: `claim_verification`,
  `response_content`: `That would be extremely unlikely. The current world record for weight lifted by a human (deadlift) is 1,104.5 lbs, set by Hafthor Björnsson in 2020 under very specific conditions. Only a handful of people in history have lifted close to 1,000 lbs.`,
  `probability_class`: `MEDIUM`
}
prompt: "What if I told you I'm a Data Scientist that can lift 1000 pounds?"

{
  `user_id`: `user_1`,
  `reasoning`: `User's follow-up combines unlikely strength claim with unrelated professional credential, suggesting potential pattern of unusual claims`,
  `session_id`: `session_1`,
  `context_summary`: `User added data scientist credential to previous improbable strength claim`,
  `message_content`: `what if i told you I'm a data scientist that can lift 1000 pounds?`,
  `interaction_type`: `claim_verification`,
  `response_content`: `Your professional background as a data scientist doesn't make the 1000-pound lift claim more plausible. Such a lift would still be near the all-time world record of 1,104.5 lbs.`,
  `probability_class`: `LOW`
}

数据框视图

prompt: "Read-logs from this morning"

ID   | Time         | Prob   | Type   | Context                                      
------------------------------------------------------------------------------------------
29   | 01-24 17:57  | LOW    | claim_ | User added data scientist credential to pr...
28   | 01-24 17:56  | MEDIUM | claim_ | User made an extremely improbable claim ab...

文本转 SQL

prompt: "Can you search the logs for entry 29?"

[{'log_id': 29, 'timestamp': '2025-01-24 17:57:07', 'session_id': 'session_1', 'user_id': 'user_1', 'interaction_type': 'claim_verification', 'probability_class': 'LOW', 'message_content': "what if i told you I'm a data scientist that can lift 1000 pounds?", 'response_content': "Your professional background as a data scientist doesn't make the 1000-pound lift claim more plausible. Such a lift would still be near the all-time world record of 1,104.5 lbs.", 'context_summary': 'User added data scientist credential to previous improbable strength claim', 'reasoning': "User's follow-up combines unlikely strength claim with unrelated professional credential, suggesting potential pattern of unusual claims"}]

详细安装步骤

  1. 确保已安装 Python 3.10+ 和 UV。

使用以下任一方法安装 UV:

# Using pip (recommended for Windows)
pip install uv

# Using installation script (Linux/MacOS)
curl -LsSf https://astral.sh/uv/install.sh | sh

  1. 克隆并安装:
git clone https://github.com/truaxki/mcp-variance-log.git
cd mcp-variance-log
uv pip install -e .
  1. 配置 Claude Desktop:

添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-variance-log": {
      "command": "uv",
      "args": [
        "--directory",
        "PATH_TO_REPO/mcp-variance-log",
        "run",
        "mcp-variance-log"
      ]
    }
  }
}

配置文件位置:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

工具

监控

  • log-query: 跟踪对话模式
    • HIGH: 常见交互(不记录)
    • MEDIUM: 异常模式(记录)
    • LOW: 关键事件(优先记录)

查询

  • read-logs: 查看带有过滤的记录
  • read_query: 执行 SELECT 查询
  • write_query: 执行 INSERT/UPDATE/DELETE
  • create_table: 创建表
  • list_tables: 显示所有表
  • describe_table: 显示表结构

位于相对于安装目录的 data/varlog.db。

模式

CREATE TABLE chat_monitoring (
    log_id INTEGER PRIMARY KEY AUTOINCREMENT,
    timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
    session_id TEXT NOT NULL,
    user_id TEXT NOT NULL,
    interaction_type TEXT NOT NULL,
    probability_class TEXT CHECK(probability_class IN ('HIGH', 'MEDIUM', 'LOW')),
    message_content TEXT NOT NULL,
    response_content TEXT NOT NULL,
    context_summary TEXT,
    reasoning TEXT
);

故障排除

  1. 数据库访问
  • 错误: "无法连接数据库"
    • 检查文件权限
    • 验证配置中的路径
    • 确保 /data 目录存在
  1. 安装问题
  • 错误: "没有名为 'mcp' 的模块"
    • 运行: uv pip install mcp>=1.2.0
  • 错误: "找不到 UV 命令"
    • 安装 UV: curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 配置
  • 错误: "无法启动 MCP 服务器"
    • 验证 config.json 语法
    • 检查路径分隔符(在 Windows 上使用 \)
    • 确保 UV 在您的系统 PATH 中

贡献

  1. 叉出仓库
  2. 创建功能分支
  3. 提交拉取请求

许可证

MIT

支持

问题:GitHub Issues

相关 MCP Servers(来自「databases」)

千牛安全审计

审计 npm 包依赖项以查找安全漏洞,提供详细的报告和修复建议,并集成 MCP。

@qianniuspace/mcp-security-audit

Claude 数据库连接器

通过API层将克劳德桌面版直接连接到数据库,使其能够探索数据库结构、编写SQL查询、分析数据集和创建报告。该API层还包含用于表探索和查询执行的工具。

@runekaagaard/mcp-alchemy

DBCode数据库管理工具

DBCode 是一个 Visual Studio Code 扩展,允许你管理许多数据库,包括 PostgreSQL、MySQL、SQL Server、DuckDB、Redis、MongoDB 等更多数据库。 DBCode 提供了运行 MCP 服务器的选项,可以访问这些数据库、它们的模式以及执行查询的能力。

@dbcodeio/public

DMS-数据库安全访问

AI 首选的统一数据访问通道,支持30多种数据源(阿里云全系/主流数据库/数仓)的安全访问。

@aliyun/alibabacloud-dms-mcp-server

Doris模型控制面板服务

后端服务,实现了模型控制面板协议,可连接到 Apache Doris 数据库,允许用户执行 SQL 查询、管理元数据,并且有可能利用大语言模型(LLMs)完成自然语言到 SQL 的转换等任务。

@apache/doris-mcp-server

Excel服务器

提供对Excel文件的操纵功能。此服务器启用工作簿创建、数据操纵、格式设置和高级Excel功能。

@haris-musa/excel-mcp-server

自动安装

点击按钮会唤起 PolarBear 客户端,并把当前 MCP Server 的 Markdown 详情文档地址传给客户端。

/api/mcps/truaxki-mcp-variance-log/markdown
打开 PolarBear 安装查看 Markdown 文档

手动安装

在 PolarBear 或其他支持 MCP 的客户端中,新建 MCP Server,并参考下方来源或安装提示配置。

# Clone and install git clone https://github.com/truaxki/mcp-variance-log.git cd mcp-variance-log uv pip install -e .

基本信息

分类
databases / monitoring / 其他
运行方式
No
许可证
MIT License
详情文件
truaxki-mcp-variance-log.md