MCP Commands MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add --transport http mcp-commands http://your-server:8432/sse
README.md

Track and manage AI command usage history using a PostgreSQL database.

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


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 คำอธิบาย
log_command_tool บันทึก command ที่ใช้งาน
get_history_tool ดูประวัติการใช้งาน
get_stats_tool สถิติสรุปการใช้งาน
search_commands_tool ค้นหา command ในประวัติ
delete_command_tool ลบ 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 คำอธิบาย
DATABASE_URL postgresql://mcp_commands:mcp_commands@localhost:5432/mcp_commands PostgreSQL DSN
MCP_TRANSPORT stdio stdio หรือ sse
MCP_PORT 8432 Port สำหรับ SSE mode

Categories แนะนำ

Category คำอธิบาย
git git related commands
session session management
research research tools
oracle oracle commands
code coding tools
skill Claude Code skills

Tools (5)

log_command_toolLogs a command that has been executed.
get_history_toolRetrieves the history of executed commands.
get_stats_toolProvides summary statistics of command usage.
search_commands_toolSearches for specific commands within the history.
delete_command_toolDeletes a command record by its ID.

Environment Variables

DATABASE_URLPostgreSQL DSN for database connection
MCP_TRANSPORTTransport mode: stdio or sse
MCP_PORTPort for SSE mode

Configuration

claude_desktop_config.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"}}}}

Try it

Log that I just executed a git commit command for the current project.
Show me the last 10 commands I have run in my AI sessions.
What are my most frequently used commands based on the usage statistics?
Search my history for any commands related to research.
Delete the command record with ID 123 from my history.

Frequently Asked Questions

What are the key features of MCP Commands?

Centralized logging of AI command execution history. Support for both stdio and SSE transport modes. Built-in statistical analysis of command usage. Searchable command history with context tracking. Persistent storage using PostgreSQL 16.

What can I use MCP Commands for?

Tracking AI assistant productivity and common workflows. Auditing command usage across multiple development machines. Analyzing which AI tools or skills are used most frequently in research tasks. Maintaining a searchable log of session-specific commands for future reference.

How do I install MCP Commands?

Install MCP Commands by running: git clone https://github.com/PuemMTH/mcp-commands && cd mcp-commands && docker compose up -d

What MCP clients work with MCP Commands?

MCP Commands works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Commands docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare