mcp-commands
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-commands show me my recent command history and usage stats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-commands
MCP server สำหรับติดตามการใช้งาน AI commands
เก็บข้อมูลว่าใช้ command อะไรบ้าง เมื่อไหร่ และบริบทใดบ้าง โดยใช้ PostgreSQL เป็น storage
Architecture
Private Server (Docker Compose)
├── mcp-commands-db ← PostgreSQL 16
└── mcp-commands-server ← SSE mode, port 8432
Claude Code (ทุก machine)
└── url: "http://your-server:8432/sse" ← ไม่ต้อง install อะไรเพิ่มไม่ต้องแยก server กับ client — codebase เดียวรองรับทั้งสองโหมดผ่าน MCP_TRANSPORT
Related MCP server: PostgreSQL MCP Server
Option A: Central Server (แนะนำ)
Deploy บน private server
git clone https://github.com/PuemMTH/mcp-commands
cd mcp-commands
cp .env.example .env # แก้ POSTGRES_PASSWORD
docker compose up -dเพิ่มใน Claude Code (~/.claude.json) — ทุก machine
{
"mcpServers": {
"mcp-commands": {
"url": "http://your-server:8432/sse"
}
}
}ข้อมูลทุก session เก็บรวมใน Postgres เดียวกัน
Option B: รัน Local ด้วย uvx
สำหรับคนที่อยากรัน instance ของตัวเองแบบ stdio (ต้องมี PostgreSQL อยู่แล้ว)
# ตั้ง DATABASE_URL ให้ชี้ไป Postgres ของตัวเอง
DATABASE_URL=postgresql://user:pass@localhost:5432/mcp_commands \
uvx --from git+https://github.com/PuemMTH/mcp-commands mcp-commandsเพิ่มใน Claude Code (~/.claude.json):
{
"mcpServers": {
"mcp-commands": {
"command": "uvx",
"args": ["--from", "git+https://github.com/PuemMTH/mcp-commands", "mcp-commands"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mcp_commands"
}
}
}
}MCP Tools
Tool | คำอธิบาย |
| บันทึก command ที่ใช้งาน |
| ดูประวัติการใช้งาน |
| สถิติสรุปการใช้งาน |
| ค้นหา command ในประวัติ |
| ลบ record ด้วย id |
ตัวอย่างการใช้งาน
log_command_tool(command="/recap", category="session", context="morning standup")
log_command_tool(command="/commit", category="git")
log_command_tool(command="deep-research", category="research", context="MCP protocol study")
get_history_tool(limit=10)
get_stats_tool()
search_commands_tool(query="git")Environment Variables
Variable | Default | คำอธิบาย |
|
| PostgreSQL DSN |
|
|
|
|
| Port สำหรับ SSE mode |
Categories แนะนำ
Category | คำอธิบาย |
| git related commands |
| session management |
| research tools |
| oracle commands |
| coding tools |
| Claude Code skills |
Available Tools
5 toolsdelete_command_toolC
Delete a command-usage record by its id.
Args:
row_id: The id field from history records
Inputs: row_id (required). Returns: result
get_history_toolA
Get recent command-usage history.
Args:
limit: Max rows to return (default 20)
command: Filter by command name (partial match)
category: Filter by category (exact match)
Inputs: limit, command, category. Returns: result
get_stats_toolA
Get command usage statistics.
Args:
top_n: How many top items to show per category (default 10)
Returns JSON with:
- total usage count
- top commands ranked by usage
- top categories ranked by usage
- daily counts for the last 7 days
Inputs: top_n. Returns: result
log_command_toolA
Log one AI command usage.
Args:
command: The command name, e.g. '/commit', '/recap', 'deep-research'
category: Optional group, e.g. 'git', 'research', 'oracle', 'session'
context: Optional free-text note about where/why it was used
Inputs: command (required), category, context. Returns: result
search_commands_toolB
Search command history by keyword.
Searches across command name, category, and context fields.
Args:
query: Search keyword
limit: Max results (default 20)
Inputs: query (required), limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct purpose with no overlap: delete_command_tool removes records, get_history_tool retrieves recent history, get_stats_tool provides aggregated statistics, log_command_tool logs new usage, and search_commands_tool searches across fields. The descriptions clearly differentiate their functions, making misselection unlikely.
All tool names follow a consistent verb_noun pattern (e.g., delete_command_tool, get_history_tool, log_command_tool). The naming is uniform throughout, using snake_case and clear action-object combinations, which aids predictability and readability.
With 5 tools, the server is well-scoped for managing command-usage history, covering logging, retrieval, deletion, search, and statistics. Each tool earns its place without being too sparse or bloated, fitting typical MCP server ranges.
The tool set provides comprehensive coverage for the command-usage domain, including create (log), read (get_history, get_stats, search), and delete operations. A minor gap is the lack of an update tool for modifying existing records, but agents can work around this by deleting and re-logging if needed.
Maintenance
Related MCP Connectors
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP server for AI dialogue using various LLM models via AceDataCloud
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Related MCP Servers
- AlicenseBqualityNot gradedmaintenanceA universal MCP server that enables AI agents to securely manage PostgreSQL databases, make API requests, and execute SSH commands with features for database analysis, schema editing, and data operations.31-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to interact with PostgreSQL databases by executing SQL queries and inspecting database schemas. It provides tools for standardized database exploration and management through the Model Context Protocol.-
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to create and manage persistent SQLite databases through natural language without requiring SQL knowledge. It allows users to propose schemas, store records, and perform complex queries across multiple databases for structured data tracking.MIT
- AlicenseAqualityDmaintenanceMCP server that automatically logs AI coding assistant activities such as command executions and code generation, saving them as JSON files for later search and analysis.325MIT