loading…
Search for a command to run...
loading…
Logs LLM interactions to local CSV or Markdown files with automatic categorization for detailed tracking. It provides an interactive HTML dashboard to visualize
Logs LLM interactions to local CSV or Markdown files with automatic categorization for detailed tracking. It provides an interactive HTML dashboard to visualize query volume, model usage, and category distribution.
An MCP (Model Context Protocol) server that logs all your LLM queries to a local file and provides interactive analytics. Track your interactions with Claude, ChatGPT, Gemini, and other models with detailed categorization and visualizations.
git clone https://github.com/bjulius/QueryCounterMCP.git
cd QueryCounterMCP
npm install
npm run build
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"query-counter": {
"command": "node",
"args": [
"/path/to/your/QueryCounterMCP/build/index.js"
]
}
}
}
Replace /path/to/your/QueryCounterMCP/ with the actual path where you cloned the repository.
Example paths:
"/Users/yourname/projects/QueryCounterMCP/build/index.js""C:\\Users\\YourName\\Projects\\QueryCounterMCP\\build\\index.js"Customize the logging behavior:
{
"mcpServers": {
"query-counter": {
"command": "node",
"args": [
"/path/to/your/QueryCounterMCP/build/index.js"
],
"env": {
"QUERY_LOG_FORMAT": "csv",
"QUERY_LOG_PATH": "/path/to/your/custom/log.csv"
}
}
}
}
Available Options:
QUERY_LOG_FORMAT: "csv" (default) or "md" for MarkdownQUERY_LOG_PATH: Custom path for the log fileThe MCP server automatically logs queries made through Claude Desktop. The AI (Claude) determines the appropriate category based on the conversation context.
Example interaction:
User: Help me debug a React component that's not rendering properly
Claude: [Uses the log_query tool automatically]
- model: "Claude Sonnet 4.5"
- query_summary: "Help me debug a React component"
- category: "debugging" [AI selected]
Tool Parameters:
model (required): The LLM model name (selected by AI)query_summary (required): Brief description of the query (generated by AI)category (optional): Query category (automatically selected by AI based on query type)Use the show_dashboard tool to generate and view analytics:
Please show me the dashboard
This will:
The interactive dashboard includes:
The AI automatically selects the most appropriate category for each query. These categories help organize and analyze your query patterns:
coding - Writing, debugging, or explaining coderefactoring - Code improvements, restructuring, optimizationtesting - Writing or running tests, test analysisdebugging - Troubleshooting errors, investigating issuesdata-analysis - Analyzing data, visualizations, statisticsresearch - Information lookup, documentation searches, learningdocumentation - Writing/updating docs, README files, commentsconfiguration - Settings, setup, tool configuration, environmentclarification - Follow-up questions, asking for detailsselection - Short confirmations, choosing optionsnavigation - UI commands, viewing files, moving aroundconversation - General chat, greetings, feedbackBy default, queries are logged to QueryTrackMCP.csv in CSV format:
timestamp,date,model,category,query_summary
2025-10-15T18:20:37.516Z,10/15/2025 2:20:37 PM,Claude Sonnet 4.5,debugging,Help me debug a React component
2025-10-15T18:22:15.342Z,10/15/2025 2:22:15 PM,Claude Sonnet 4.5,coding,Create a user authentication function
2025-10-15T18:25:43.891Z,10/15/2025 2:25:43 PM,Claude Sonnet 4.5,data-analysis,Analyze sales data trends
CSV Format Benefits:
To use Markdown format instead, set QUERY_LOG_FORMAT=md in your environment variables. This creates a QueryTrackMCP.md file:
# LLM Query Log
This file tracks all queries made to various LLM models.
---
## 10/15/2025, 2:20:37 PM
- **Model**: Claude Sonnet 4.5
- **Category**: debugging
- **Query**: Help me debug a React component
- **Timestamp**: 2025-10-15T18:20:37.516Z
---
Markdown Format Benefits:
log_queryLogs an LLM query to the tracking file.
Parameters:
model (string, required): LLM model namequery_summary (string, required): Brief query descriptioncategory (string, optional): Query categoryshow_dashboardGenerates and displays an interactive HTML analytics dashboard.
Parameters: None
Output: Opens query-dashboard.html in your default browser with:
# Install dependencies
npm install
# Build the project
npm run build
# Watch for changes during development
npm run watch
# Build and run
npm run dev
QueryCounterMCP/
├── src/
│ └── index.ts # Main MCP server code
├── build/
│ └── index.js # Compiled JavaScript
├── QueryTrackMCP.csv # Query log (CSV format)
├── query-dashboard.html # Generated analytics dashboard
├── CLAUDE.md # Instructions for Claude Code
└── README.md # This file
MIT
Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"query-counter-mcp-server": {
"command": "npx",
"args": []
}
}
}