Skip to main content
Glama
PuemMTH
by PuemMTH

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

คำอธิบาย

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

Available Tools

5 tools
delete_command_toolC
Delete a command-usage record by its id.

Args:
    row_id: The id field from history records
ParametersJSON Schema
NameRequiredDescriptionDefault
row_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Delete' implying a destructive mutation, but doesn't disclose behavioral traits like whether deletion is permanent, requires specific permissions, has side effects, or provides confirmation. For a destructive tool with zero annotation coverage, this is a significant gap in safety and operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences: a clear purpose statement and a parameter explanation. It's front-loaded with the main action. While efficient, the parameter section could be slightly more integrated, but overall it avoids waste and maintains focus.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive operation with 1 parameter) and the presence of an output schema (which reduces need to explain return values), the description is minimally adequate. It covers the basic purpose and parameter context but lacks behavioral details and usage guidelines. With no annotations, it should do more to compensate, resulting in a mediocre score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that 'row_id' corresponds to 'The id field from history records', clarifying the parameter's source and context. However, it doesn't detail format constraints or examples, leaving some ambiguity. With 1 parameter, this partial compensation justifies a baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('a command-usage record by its id'), making the purpose immediately understandable. It distinguishes from siblings like get_history_tool or search_commands_tool by specifying deletion rather than retrieval. However, it doesn't explicitly contrast with siblings beyond the verb, missing full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing record), exclusions, or recommend other tools for related tasks. With siblings like get_history_tool available, this lack of context leaves the agent guessing about appropriate usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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)
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
commandNo
categoryNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves 'recent' history but doesn't define what 'recent' means (e.g., time range, recency criteria). It also omits details like pagination, rate limits, authentication needs, or error handling, which are crucial for a read operation with filtering parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with a clear purpose statement followed by a structured parameter list. Every sentence adds value: the first defines the tool's function, and the subsequent lines efficiently detail each parameter without redundancy. It's concise and well-organized for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no annotations, but with an output schema), the description is reasonably complete. It covers the purpose and parameter semantics effectively. Since an output schema exists, the description doesn't need to explain return values, but it lacks behavioral context (e.g., recency definition, error cases), which slightly reduces completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains each parameter's purpose: 'limit' as 'Max rows to return (default 20)', 'command' as 'Filter by command name (partial match)', and 'category' as 'Filter by category (exact match)'. This clarifies default values, filtering behaviors (partial vs. exact match), and semantics, fully compensating for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get recent command-usage history.' It specifies the verb ('Get') and resource ('command-usage history'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_stats_tool' or 'search_commands_tool', which likely serve related but distinct purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools such as 'search_commands_tool' or 'get_stats_tool', leaving the agent to infer usage context. There are no explicit when/when-not instructions or prerequisites, which is a significant gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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
ParametersJSON Schema
NameRequiredDescriptionDefault
top_nNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It usefully describes the return format (JSON with specific fields) and time range ('last 7 days'), which helps the agent understand what data to expect. However, it doesn't mention whether this is a read-only operation, if there are rate limits, authentication requirements, or potential side effects - important gaps for a tool that accesses usage data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement, parameter documentation, and return format specification in just four lines. Every sentence earns its place: the first states the purpose, the second explains the parameter, and the third details the return structure. No wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which presumably documents the JSON structure), the description provides adequate context about what the tool does and returns. The description explains the parameter meaning and outlines the return data structure, which complements what the output schema likely provides. For a single-parameter read operation with output schema, this is reasonably complete, though it could benefit from more behavioral context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage (the schema only shows 'top_n' is an integer with default 10), the description adds significant value by explaining what 'top_n' means ('How many top items to show per category') and providing the default value. This completely compensates for the schema's lack of semantic information about the single parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with 'Get command usage statistics' - a specific verb ('Get') and resource ('command usage statistics'). It distinguishes from siblings like 'get_history_tool' (which presumably retrieves command history rather than aggregated statistics) and 'search_commands_tool' (which likely searches individual commands). However, it doesn't explicitly contrast with these alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_history_tool' or 'search_commands_tool'. There's no mention of prerequisites, appropriate contexts, or exclusions. The agent must infer usage from the tool name and description alone without explicit direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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
ParametersJSON Schema
NameRequiredDescriptionDefault
commandYes
categoryNo
contextNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool logs usage, implying a write operation, but does not disclose critical traits such as authentication needs, rate limits, idempotency, or what happens to the logged data (e.g., storage location, persistence). For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose in the first sentence, followed by a structured breakdown of args with clear examples. Every sentence earns its place by providing essential information without redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, 1 required), no annotations, and the presence of an output schema (which reduces the need to explain return values), the description is fairly complete. It covers the purpose and parameter semantics adequately but lacks behavioral context and usage guidelines, which are notable gaps for a logging tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains each parameter's purpose with examples (e.g., command: '/commit', category: 'git', context: free-text note), clarifying their roles and usage. This compensates well for the schema's lack of descriptions, though it doesn't cover all possible nuances like format constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Log one AI command usage') with the resource ('AI command'), distinguishing it from sibling tools like delete_command_tool (deletion), get_history_tool (retrieval), get_stats_tool (analytics), and search_commands_tool (search). The verb 'Log' is precise and differentiates its purpose from other operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like get_history_tool or search_commands_tool. It lacks explicit when/when-not statements or prerequisites, leaving the agent to infer usage based on the purpose alone without contextual boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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)
ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions searching 'command history' and the fields searched, but lacks critical behavioral details: whether this is read-only (implied but not stated), if there are rate limits, authentication requirements, pagination behavior, or what the output contains. For a search tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured: a brief purpose statement, scope clarification, and parameter explanations in a clean 'Args:' section. Every sentence adds value without redundancy. It's appropriately sized for a simple search tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters, no annotations, but an output schema exists (so return values needn't be described), the description is minimally adequate. It covers the basic purpose and parameters but lacks behavioral context (e.g., safety, limits) and usage guidelines. For a search tool with siblings, this leaves gaps in helping the agent use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context: 'query' is a 'Search keyword' and 'limit' has a 'default 20' with 'Max results' clarification. This explains what each parameter does beyond their titles ('Query', 'Limit'), though it doesn't detail format constraints (e.g., query syntax). With 2 parameters and good semantic clarification, it earns above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search command history by keyword' and specifies the search scope ('across command name, category, and context fields'). This is specific and distinguishes it from siblings like 'get_history_tool' (likely broader retrieval) and 'delete_command_tool' (mutation). However, it doesn't explicitly contrast with 'get_history_tool' in the description text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_history_tool' or 'log_command_tool'. The description only states what the tool does, not when it's appropriate. This leaves the agent to infer usage from tool names alone, which is insufficient for reliable selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    An 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.
  • A
    license
    Not graded
    quality
    C
    maintenance
    An 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
  • A
    license
    A
    quality
    C
    maintenance
    MCP 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.
    3
    25
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PuemMTH/mcp-commands'

If you have feedback or need assistance with the MCP directory API, please join our Discord server