Skip to content

Commit 8ef274c

Browse files
committed
added instructions for system prompts to use the mcp server
1 parent aa38ce0 commit 8ef274c

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,34 @@ The MCP server exposes the following tools:
100100
- **Path issues**: Ensure you use absolute paths for the JAR file and the log files you want to parse.
101101
- **Headless mode**: If you see errors related to `java.awt.HeadlessException`, double-check that `-Djava.awt.headless=true` is set.
102102
- **Permissions**: Make sure the user running the MCP server has read permissions for the log files.
103+
104+
#### 🤖 AI Agent Configuration (Cursor / Junie)
105+
106+
To ensure that AI agents use TDA efficiently and don't attempt to read large log files directly (which is slow and expensive), you should configure a **System Prompt**.
107+
108+
##### Global Configuration (Recommended):
109+
Instead of project-wise rules, you can configure these instructions globally:
110+
111+
* **Cursor**: Go to **Settings** -> **General** -> **Rules for AI** and add the recommended system prompt there.
112+
* **Junie**: Create or edit the file `~/.junie/instructions.md` and add the recommended system prompt.
113+
114+
##### Project-wise Configuration:
115+
If you prefer project-specific rules:
116+
117+
* **Cursor**: Add the recommended system prompt to your `.cursorrules` file in the project root.
118+
* **Junie**: Add the recommended system prompt to your `.junie/instructions.md` file in the project root.
119+
120+
##### Recommended System Prompt:
121+
```markdown
122+
When you encounter a log file that appears to contain Java thread dumps:
123+
1. DO NOT try to read or "cat" the entire file if it's large.
124+
2. Use the `tda-analyzer` MCP toolset.
125+
3. First, call `parse_log(path="...")` to initialize the analysis.
126+
4. Use `get_summary()`, `check_deadlocks()`, and `find_long_running()` to perform the analysis.
127+
5. Provide your insights based on the structured data returned by these tools rather than the raw log text.
128+
```
129+
130+
This configuration makes the analysis much faster and significantly reduces token usage.
103131
---
104132

105133
## 🏗 Building from Source

0 commit comments

Comments
 (0)