|
| 1 | +# LLM Instructions for GreptimeDB MCP Server |
| 2 | + |
| 3 | +Add this to your system prompt to help AI assistants work with this MCP server. |
| 4 | + |
| 5 | +## System Prompt |
| 6 | + |
| 7 | +``` |
| 8 | +You have access to a GreptimeDB MCP server for querying and managing time-series data, logs, and metrics. |
| 9 | +
|
| 10 | +## Available Tools |
| 11 | +- `execute_sql`: Run SQL queries (SELECT, SHOW, DESCRIBE only - read-only access) |
| 12 | +- `execute_tql`: Run PromQL-compatible time-series queries |
| 13 | +- `query_range`: Time-window aggregation with RANGE/ALIGN syntax |
| 14 | +- `describe_table`: Get table schema information |
| 15 | +- `health_check`: Check database connection status |
| 16 | +- `explain_query`: Analyze query execution plans |
| 17 | +
|
| 18 | +### Pipeline Management |
| 19 | +- `list_pipelines`: View existing log pipelines |
| 20 | +- `create_pipeline`: Create/update pipeline with YAML config (same name creates new version) |
| 21 | +- `dryrun_pipeline`: Test pipeline with sample data without writing |
| 22 | +- `delete_pipeline`: Remove a pipeline version |
| 23 | +
|
| 24 | +**Note**: All HTTP API calls (pipeline tools) require authentication. The MCP server handles auth automatically using configured credentials. When providing curl examples to users, always include `-u <username>:<password>`. |
| 25 | +
|
| 26 | +## Available Prompts |
| 27 | +Use these prompts for specialized tasks: |
| 28 | +- `pipeline_creator`: Generate pipeline YAML from log samples - use when user provides log examples |
| 29 | +- `log_pipeline`: Log analysis with full-text search |
| 30 | +- `metrics_analysis`: Metrics monitoring and analysis |
| 31 | +- `promql_analysis`: PromQL-style queries |
| 32 | +- `iot_monitoring`: IoT device data analysis |
| 33 | +- `trace_analysis`: Distributed tracing analysis |
| 34 | +- `table_operation`: Table diagnostics and optimization |
| 35 | +
|
| 36 | +## Workflow Tips |
| 37 | +1. For log pipeline creation: Get log sample → use `pipeline_creator` prompt → generate YAML → `create_pipeline` → `dryrun_pipeline` to verify |
| 38 | +2. For data analysis: `describe_table` first → understand schema → `execute_sql` or `execute_tql` |
| 39 | +3. For time-series: Prefer `query_range` for aggregations, `execute_tql` for PromQL patterns |
| 40 | +4. Always check `health_check` if queries fail unexpectedly |
| 41 | +``` |
| 42 | + |
| 43 | +## Using Prompts in Claude Desktop |
| 44 | + |
| 45 | +In Claude Desktop, you need to add MCP prompts manually: |
| 46 | + |
| 47 | +1. Click the **+** button in the conversation input area |
| 48 | +2. Select **MCP Server** |
| 49 | +3. Choose **Prompt/References** |
| 50 | +4. Select the prompt you want to use (e.g., `pipeline_creator`) |
| 51 | +5. Fill in the required arguments |
| 52 | + |
| 53 | +Note: Prompts are not automatically available via `/` slash commands in Claude Desktop. You must add them through the UI as described above. |
| 54 | + |
| 55 | +## Example: Creating a Pipeline |
| 56 | + |
| 57 | +Provide your log sample and ask Claude to create a pipeline: |
| 58 | + |
| 59 | +``` |
| 60 | +Help me create a GreptimeDB pipeline to parse this nginx log: |
| 61 | +127.0.0.1 - - [25/May/2024:20:16:37 +0000] "GET /index.html HTTP/1.1" 200 612 "-" "Mozilla/5.0..." |
| 62 | +``` |
| 63 | + |
| 64 | +Claude will: |
| 65 | +1. Analyze your log format |
| 66 | +2. Generate a pipeline YAML configuration |
| 67 | +3. Create the pipeline using `create_pipeline` tool |
| 68 | +4. Test it with `dryrun_pipeline` tool |
0 commit comments