latitude-mcp-server 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PROMPT_GUIDE.md +163 -0
- package/package.json +1 -1
package/PROMPT_GUIDE.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Complete guide for LLMs to autonomously manage, test, and optimize PromptL prompts via MCP
|
|
3
|
+
auto_execution_mode: 3
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# LATITUDE MCP SERVER - LLM GUIDE
|
|
7
|
+
|
|
8
|
+
> "Autonomous prompt engineering: Create → Validate → Test → Iterate → Optimize"
|
|
9
|
+
|
|
10
|
+
## CRITICAL WORKFLOW
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
1. pull_prompts → Download all prompts to ./prompts/*.promptl
|
|
14
|
+
2. Edit locally → Your IDE, full context
|
|
15
|
+
3. add_prompt → Push with validation (overwrites if exists)
|
|
16
|
+
4. run_prompt → Test with parameters
|
|
17
|
+
5. Iterate → Analyze output → improve → re-push → re-test
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**7 MCP tools. Client-side validation. Dynamic descriptions. Git-style versioning.**
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## THE 7 TOOLS
|
|
25
|
+
|
|
26
|
+
| Tool | Type | Purpose | Dynamic Feature |
|
|
27
|
+
|------|------|---------|-----------------|
|
|
28
|
+
| `list_prompts` | Read | List all prompt names in LIVE | — |
|
|
29
|
+
| `get_prompt` | Read | Get full prompt content by name | — |
|
|
30
|
+
| `run_prompt` | Execute | Execute prompt with parameters | 🎯 Shows all prompts with their params |
|
|
31
|
+
| `pull_prompts` | Sync | Download LIVE → `./prompts/*.promptl` (FULL SYNC) | — |
|
|
32
|
+
| `add_prompt` | Write | Add/update prompts (overwrites if exists, never deletes others) | 🎯 Shows available prompts |
|
|
33
|
+
| `push_prompts` | Sync | Replace ALL prompts (FULL SYNC, deletes extras) | — |
|
|
34
|
+
| `docs` | Read | Documentation (52 topics, semantic search) | — |
|
|
35
|
+
|
|
36
|
+
### 🎯 Dynamic Descriptions
|
|
37
|
+
|
|
38
|
+
**run_prompt** shows you what parameters each prompt needs:
|
|
39
|
+
```
|
|
40
|
+
Available prompts (10):
|
|
41
|
+
- email-writer (params: recipient, topic, tone)
|
|
42
|
+
- sentiment-analyzer (no params)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**add_prompt** shows you what prompts already exist:
|
|
46
|
+
```
|
|
47
|
+
Available prompts (10): email-writer, sentiment-analyzer, ...
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## AUTONOMOUS WORKFLOWS
|
|
53
|
+
|
|
54
|
+
### Create → Test → Iterate
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
// 1. Create prompt
|
|
58
|
+
add_prompt({
|
|
59
|
+
prompts: [{
|
|
60
|
+
name: "email-extractor",
|
|
61
|
+
content: `---
|
|
62
|
+
provider: openai
|
|
63
|
+
model: gpt-4o
|
|
64
|
+
temperature: 0.2
|
|
65
|
+
schema:
|
|
66
|
+
type: object
|
|
67
|
+
properties:
|
|
68
|
+
email: { type: string }
|
|
69
|
+
required: [email]
|
|
70
|
+
---
|
|
71
|
+
<user>Extract from: {{ text }}</user>`
|
|
72
|
+
}],
|
|
73
|
+
versionName: "feat/email-extractor-v1"
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// 2. Test
|
|
77
|
+
run_prompt({
|
|
78
|
+
name: "email-extractor",
|
|
79
|
+
parameters: { text: "Contact john@example.com" }
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
// 3. Analyze output → if needs improvement, iterate
|
|
83
|
+
add_prompt({
|
|
84
|
+
prompts: [{
|
|
85
|
+
name: "email-extractor",
|
|
86
|
+
content: "... improved version ..."
|
|
87
|
+
}],
|
|
88
|
+
versionName: "fix/improve-accuracy"
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
// 4. Re-test → repeat until quality threshold met
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Bulk Testing for Optimization
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Test multiple prompts with MCP Inspector
|
|
98
|
+
for prompt in email-extractor sentiment-analyzer; do
|
|
99
|
+
npx @modelcontextprotocol/inspector \
|
|
100
|
+
-e LATITUDE_API_KEY=$KEY \
|
|
101
|
+
-e LATITUDE_PROJECT_ID=$ID \
|
|
102
|
+
--cli npx -y latitude-mcp-server@3.2.0 \
|
|
103
|
+
--method tools/call \
|
|
104
|
+
--tool-name run_prompt \
|
|
105
|
+
--tool-arg name=$prompt \
|
|
106
|
+
--tool-arg 'parameters={"text":"test"}'
|
|
107
|
+
done
|
|
108
|
+
|
|
109
|
+
# Analyze outputs → update weak prompts → re-test
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## VERSION NAMING
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
// Git-style naming (optional)
|
|
118
|
+
versionName: "feat/add-email-extractor"
|
|
119
|
+
versionName: "fix/typo-in-system-message"
|
|
120
|
+
versionName: "refactor/simplify-logic"
|
|
121
|
+
versionName: "perf/reduce-tokens"
|
|
122
|
+
|
|
123
|
+
// If omitted → auto-generates timestamp
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## VALIDATION
|
|
129
|
+
|
|
130
|
+
All writes validate BEFORE API calls:
|
|
131
|
+
|
|
132
|
+
```javascript
|
|
133
|
+
add_prompt({
|
|
134
|
+
prompts: [{
|
|
135
|
+
name: "broken",
|
|
136
|
+
content: `<user><assistant>Nested!</assistant></user>` // ❌
|
|
137
|
+
}]
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
// Error Code: `message-tag-inside-message`
|
|
141
|
+
// Location: Line 1, Column 7
|
|
142
|
+
// Fix: Move the nested tag outside its parent.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## SYNC BEHAVIOR
|
|
148
|
+
|
|
149
|
+
- `push_prompts` - FULL SYNC (deletes extras)
|
|
150
|
+
- `pull_prompts` - FULL SYNC (deletes local first)
|
|
151
|
+
- `add_prompt` - ADDITIVE (never deletes)
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## QUICK COMMANDS
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
"Pull all" → pull_prompts
|
|
159
|
+
"Add this file" → add_prompt(filePaths: ["./prompts/x.promptl"])
|
|
160
|
+
"Test prompt" → run_prompt(name: "x", parameters: {...})
|
|
161
|
+
"What params?" → Check run_prompt description (dynamic)
|
|
162
|
+
"What exists?" → Check add_prompt description (dynamic)
|
|
163
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "latitude-mcp-server",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Simplified MCP server for Latitude.so prompt management - 8 focused tools for push, pull, run, and manage prompts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|