MCP Variance Log
MCP 方差对数
Agentic 工具用于查找对话结构中的统计变化,并将异常事件记录到 SQLite 数据库中。该系统基于模型上下文协议 (MCP) 构建,旨在与 Claude Desktop 或其他兼容 MCP 的客户端配合使用。
要求
Python ≥3.10
中孔蛋白≥1.2.0
SQLite3
UV(Python 包安装程序和环境管理器)
Related MCP server: QueryForge
快速入门
# Clone and install
git clone https://github.com/truaxki/mcp-variance-log.git
cd mcp-variance-log
uv pip install -e .添加到 Claude 桌面配置(Windows 上为%APPDATA%\Claude\claude_desktop_config.json ):
{
"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...文本 2 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"}]详细安装
确保安装了 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
克隆并安装:
git clone https://github.com/truaxki/mcp-variance-log.git
cd mcp-variance-log
uv pip install -e .配置Claude桌面:
添加到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.jsonMacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
工具
监控
log-query:跟踪对话模式高:常见互动(未记录)
中等:不寻常的模式(已记录)
低:关键事件(优先记录)
询问
read-logs:通过过滤查看日志read_query:执行 SELECT 查询write_query:执行 INSERT/UPDATE/DELETEcreate_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
);故障排除
数据库访问
错误:“无法连接到数据库”
检查文件权限
验证配置中的路径
确保
/data目录存在
安装问题
错误:“没有名为‘mcp’的模块”
运行:
uv pip install mcp>=1.2.0
错误:“未找到 UV 命令”
安装 UV:
curl -LsSf https://astral.sh/uv/install.sh | sh
配置
错误:“无法启动 MCP 服务器”
验证 config.json 语法
检查路径分隔符(在 Windows 上使用 \)
确保 UV 位于你的系统 PATH 中
贡献
分叉存储库
创建功能分支
提交拉取请求
执照
麻省理工学院
支持
问题: GitHub 问题
Available Tools
8 toolsappend_insightB
Add a business insight to the memo
Inputs: insight (required).
create_tableC
Create a new table in the SQLite database
Inputs: query (required).
describe_tableC
Show structure of a specific table
Inputs: table_name (required).
list_tablesA
List all tables in the database
Inputs: no named parameters.
log-queryC
Conversation Variation analysis
Continuously monitor our conversation and automatically log unusual or noteworthy interactions based on the following criteria:
1. Probability Classifications:
HIGH (Not Logged):
- Common questions and responses
- Standard technical inquiries
- Regular clarifications
- Normal conversation flow
MEDIUM (Logged):
- Unexpected but plausible technical issues
- Unusual patterns in user behavior
- Noteworthy insights or connections
- Edge cases in normal usage
- Uncommon but valid use cases
LOW (Logged with Priority):
- Highly unusual technical phenomena
- Potentially problematic patterns
- Critical edge cases
- Unexpected system behaviors
- Novel or unique use cases
Inputs: session_id (required), user_id (required), interaction_type (required), probability_class (required), +4 more.
read-logsB
Retrieve logged conversation variations from the database.
Inputs: limit (required), start_date, end_date, full_details.
read_queryA
Execute a SELECT query on the SQLite database
Schema Reference:
Table: chat_monitoring
Fields:
- log_id (INTEGER PRIMARY KEY)
- timestamp (DATETIME)
- session_id (TEXT)
- user_id (TEXT)
- interaction_type (TEXT)
- probability_class (TEXT: HIGH, MEDIUM, LOW)
- message_content (TEXT)
- response_content (TEXT)
- context_summary (TEXT)
- reasoning (TEXT)
Example:
SELECT timestamp, probability_class, context_summary
FROM chat_monitoring
WHERE probability_class = 'LOW'
LIMIT 5;
Inputs: query (required).
write_queryC
Execute an INSERT, UPDATE, or DELETE query
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes (e.g., create_table vs. list_tables), but there is overlap between log-query and read-logs, as both involve logging/retrieving conversation variations, which could cause confusion. Additionally, read_query and write_query are clearly distinct from each other but share the database query domain with other tools like describe_table.
Naming is inconsistent with mixed conventions: some use snake_case (append_insight, create_table), others use kebab-case (log-query, read-logs), and some are unclear (read_query vs. write_query, which are snake_case but differ in verb style). There is no uniform pattern across all tools, making it harder to predict naming.
With 8 tools, the count is reasonable for a server focused on database operations and conversation logging. It covers core functions without being overly bloated, though the scope might feel slightly broad due to mixing database management with logging features.
For database operations, there is good coverage (create, list, describe, read, write), but lacks update/delete specific tools, relying on write_query for those. For conversation logging, it has logging and retrieval, but no direct management tools like delete_logs or update_logs, leaving minor gaps in the lifecycle.
Maintenance
Related MCP Connectors
Your StoryOS workspace (records, approvals and agents) for Claude, ChatGPT and any MCP client.
AI Visibility and Content Intelligence tools for Claude and MCP-compatible agents.
Uptime, SSL, DNS and domain monitoring you can talk to from Claude or any MCP client.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceDiagnose MCP servers — health checks, tool testing, token cost audits, conflict detection, and security scanning with 50+ prompt injection patterns. Works as CLI or MCP server inside Claude Desktop.1MIT
- FlicenseAqualityDmaintenanceA unified MCP server that lets Claude query any SQLite database and build live Streamlit dashboards — all from a single conversation.101-
- AlicenseAqualityBmaintenanceAn MCP server that indexes Claude Code conversation history into SQLite, enabling full-text search across past sessions for context recovery and cross-agent observability.103MIT
- AlicenseNot gradedqualityCmaintenanceAutomatically tracks AI-assisted work sessions, code changes, and commands in Claude Code or Codex CLI, and provides daily stats, weekly reports, and data export through MCP tools.23 npmMIT