latitude-mcp-server 1.0.0
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/.releaserc.json +34 -0
- package/README.md +687 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.js +43 -0
- package/dist/cli/latitude.cli.d.ts +10 -0
- package/dist/cli/latitude.cli.js +286 -0
- package/dist/controllers/latitude.controller.d.ts +115 -0
- package/dist/controllers/latitude.controller.js +287 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +166 -0
- package/dist/resources/latitude.resource.d.ts +12 -0
- package/dist/resources/latitude.resource.js +145 -0
- package/dist/services/vendor.latitude.service.d.ts +49 -0
- package/dist/services/vendor.latitude.service.js +294 -0
- package/dist/tools/latitude.tool.d.ts +6 -0
- package/dist/tools/latitude.tool.js +517 -0
- package/dist/types/common.types.d.ts +20 -0
- package/dist/types/common.types.js +7 -0
- package/dist/types/latitude.types.d.ts +487 -0
- package/dist/types/latitude.types.js +311 -0
- package/dist/utils/cli.test.util.d.ts +34 -0
- package/dist/utils/cli.test.util.js +143 -0
- package/dist/utils/config.util.d.ts +43 -0
- package/dist/utils/config.util.js +145 -0
- package/dist/utils/config.util.test.d.ts +1 -0
- package/dist/utils/constants.util.d.ts +26 -0
- package/dist/utils/constants.util.js +29 -0
- package/dist/utils/error-handler.util.d.ts +54 -0
- package/dist/utils/error-handler.util.js +202 -0
- package/dist/utils/error-handler.util.test.d.ts +1 -0
- package/dist/utils/error.util.d.ts +73 -0
- package/dist/utils/error.util.js +174 -0
- package/dist/utils/error.util.test.d.ts +1 -0
- package/dist/utils/formatter.util.d.ts +36 -0
- package/dist/utils/formatter.util.js +116 -0
- package/dist/utils/jest.setup.d.ts +5 -0
- package/dist/utils/jest.setup.js +36 -0
- package/dist/utils/jq.util.d.ts +34 -0
- package/dist/utils/jq.util.js +87 -0
- package/dist/utils/logger.util.d.ts +78 -0
- package/dist/utils/logger.util.js +344 -0
- package/dist/utils/toon.util.d.ts +15 -0
- package/dist/utils/toon.util.js +65 -0
- package/dist/utils/transport.util.d.ts +49 -0
- package/dist/utils/transport.util.js +162 -0
- package/eslint.config.mjs +46 -0
- package/openapi.json +12592 -0
- package/package.json +118 -0
- package/scripts/ensure-executable.js +38 -0
- package/scripts/package.json +3 -0
- package/scripts/update-version.js +204 -0
package/.releaserc.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": ["main"],
|
|
3
|
+
"plugins": [
|
|
4
|
+
"@semantic-release/commit-analyzer",
|
|
5
|
+
"@semantic-release/release-notes-generator",
|
|
6
|
+
"@semantic-release/changelog",
|
|
7
|
+
[
|
|
8
|
+
"@semantic-release/exec",
|
|
9
|
+
{
|
|
10
|
+
"prepareCmd": "node scripts/update-version.js ${nextRelease.version} && npm run build && chmod +x dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"@semantic-release/npm",
|
|
15
|
+
{
|
|
16
|
+
"npmPublish": true,
|
|
17
|
+
"pkgRoot": "."
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"@semantic-release/git",
|
|
22
|
+
{
|
|
23
|
+
"assets": [
|
|
24
|
+
"package.json",
|
|
25
|
+
"CHANGELOG.md",
|
|
26
|
+
"src/index.ts",
|
|
27
|
+
"src/cli/index.ts"
|
|
28
|
+
],
|
|
29
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"@semantic-release/github"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
<h1 align="center">π Latitude MCP Server π</h1>
|
|
2
|
+
<h3 align="center">Stop copy-pasting prompts. Start managing them like a pro.</h3>
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<strong>
|
|
6
|
+
<em>The complete MCP server for Latitude.so prompt management. Create projects, version prompts, push from local files, run AI conversations β all from your AI assistant or CLI.</em>
|
|
7
|
+
</strong>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<!-- Package Info -->
|
|
12
|
+
<a href="https://www.npmjs.com/package/latitude-mcp-server"><img alt="npm" src="https://img.shields.io/npm/v/latitude-mcp-server.svg?style=flat-square&color=4D87E6"></a>
|
|
13
|
+
<a href="#"><img alt="node" src="https://img.shields.io/badge/node-18+-4D87E6.svg?style=flat-square"></a>
|
|
14
|
+
β’
|
|
15
|
+
<!-- Features -->
|
|
16
|
+
<a href="https://opensource.org/licenses/MIT"><img alt="license" src="https://img.shields.io/badge/License-ISC-F9A825.svg?style=flat-square"></a>
|
|
17
|
+
<a href="#"><img alt="platform" src="https://img.shields.io/badge/platform-macOS_|_Linux_|_Windows-2ED573.svg?style=flat-square"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img alt="tools" src="https://img.shields.io/badge/π οΈ_16_MCP_tools-full_CRUD_operations-2ED573.svg?style=for-the-badge">
|
|
22
|
+
<img alt="resources" src="https://img.shields.io/badge/π_4_resources-read_only_access-2ED573.svg?style=for-the-badge">
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<div align="center">
|
|
26
|
+
|
|
27
|
+
### π§ Quick Navigation
|
|
28
|
+
|
|
29
|
+
[**β‘ Get Started**](#-get-started-in-60-seconds) β’
|
|
30
|
+
[**β¨ Features**](#-feature-breakdown) β’
|
|
31
|
+
[**π οΈ Tools**](#-tool-reference) β’
|
|
32
|
+
[**π Resources**](#-resource-templates) β’
|
|
33
|
+
[**π» CLI**](#-cli-reference)
|
|
34
|
+
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
**`latitude-mcp-server`** gives your AI assistant superpowers for managing prompts on [Latitude.so](https://latitude.so). Instead of switching between your IDE, Latitude dashboard, and AI chat, your AI can now create projects, version prompts, push content from local files, and even run prompts directly.
|
|
40
|
+
|
|
41
|
+
<div align="center">
|
|
42
|
+
<table>
|
|
43
|
+
<tr>
|
|
44
|
+
<td align="center">
|
|
45
|
+
<h3>π</h3>
|
|
46
|
+
<b>Project Management</b><br/>
|
|
47
|
+
<sub>Create & list projects</sub>
|
|
48
|
+
</td>
|
|
49
|
+
<td align="center">
|
|
50
|
+
<h3>π</h3>
|
|
51
|
+
<b>Version Control</b><br/>
|
|
52
|
+
<sub>Drafts, publish, merge</sub>
|
|
53
|
+
</td>
|
|
54
|
+
<td align="center">
|
|
55
|
+
<h3>π</h3>
|
|
56
|
+
<b>Prompt CRUD</b><br/>
|
|
57
|
+
<sub>Push from files or inline</sub>
|
|
58
|
+
</td>
|
|
59
|
+
<td align="center">
|
|
60
|
+
<h3>π€</h3>
|
|
61
|
+
<b>AI Execution</b><br/>
|
|
62
|
+
<sub>Run prompts, chat, stream</sub>
|
|
63
|
+
</td>
|
|
64
|
+
</tr>
|
|
65
|
+
</table>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
How it works:
|
|
69
|
+
- **You:** "Push my local prompt file to Latitude draft"
|
|
70
|
+
- **AI:** Reads file, extracts prompt path from filename, pushes to your project
|
|
71
|
+
- **You:** "Now run it with these parameters"
|
|
72
|
+
- **AI:** Executes prompt, streams response, maintains conversation
|
|
73
|
+
- **Result:** Full prompt lifecycle without leaving your IDE
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## π₯ Why This Beats Manual Management
|
|
78
|
+
|
|
79
|
+
Managing prompts manually is a context-switching nightmare. This MCP server makes traditional workflows look ancient.
|
|
80
|
+
|
|
81
|
+
<table align="center">
|
|
82
|
+
<tr>
|
|
83
|
+
<td align="center"><b>β The Old Way (Pain)</b></td>
|
|
84
|
+
<td align="center"><b>β
The MCP Way (Glory)</b></td>
|
|
85
|
+
</tr>
|
|
86
|
+
<tr>
|
|
87
|
+
<td>
|
|
88
|
+
<ol>
|
|
89
|
+
<li>Write prompt in your IDE</li>
|
|
90
|
+
<li>Open Latitude dashboard</li>
|
|
91
|
+
<li>Copy-paste content manually</li>
|
|
92
|
+
<li>Create version, test, debug</li>
|
|
93
|
+
<li>Switch back to IDE, repeat</li>
|
|
94
|
+
</ol>
|
|
95
|
+
</td>
|
|
96
|
+
<td>
|
|
97
|
+
<ol>
|
|
98
|
+
<li>Write prompt in your IDE</li>
|
|
99
|
+
<li>Tell AI: "Push to Latitude"</li>
|
|
100
|
+
<li>AI pushes, runs, shows results</li>
|
|
101
|
+
<li>Iterate directly in conversation</li>
|
|
102
|
+
<li>Ship faster. β</li>
|
|
103
|
+
</ol>
|
|
104
|
+
</td>
|
|
105
|
+
</tr>
|
|
106
|
+
</table>
|
|
107
|
+
|
|
108
|
+
We're not just wrapping an API. We're enabling **AI-native prompt development** with file-based workflows, automatic path derivation, and streaming execution.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## π Get Started in 60 Seconds
|
|
113
|
+
|
|
114
|
+
### 1. Get Your API Key
|
|
115
|
+
|
|
116
|
+
1. Go to [app.latitude.so/settings](https://app.latitude.so/settings)
|
|
117
|
+
2. Create or copy your API key
|
|
118
|
+
3. That's it β one key, all features unlocked
|
|
119
|
+
|
|
120
|
+
### 2. Configure Your MCP Client
|
|
121
|
+
|
|
122
|
+
<div align="center">
|
|
123
|
+
|
|
124
|
+
| Client | Config Location | Docs |
|
|
125
|
+
|:------:|:---------------:|:----:|
|
|
126
|
+
| π₯οΈ **Claude Desktop** | `claude_desktop_config.json` | [Setup](#claude-desktop) |
|
|
127
|
+
| β¨οΈ **Claude Code** | `~/.claude.json` or CLI | [Setup](#claude-code-cli) |
|
|
128
|
+
| π― **Cursor** | `.cursor/mcp.json` | [Setup](#cursorwindsurf) |
|
|
129
|
+
| π **Windsurf** | MCP settings | [Setup](#cursorwindsurf) |
|
|
130
|
+
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
#### Claude Desktop
|
|
134
|
+
|
|
135
|
+
Add to your `claude_desktop_config.json`:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"mcpServers": {
|
|
140
|
+
"latitude": {
|
|
141
|
+
"command": "npx",
|
|
142
|
+
"args": ["latitude-mcp-server"],
|
|
143
|
+
"env": {
|
|
144
|
+
"LATITUDE_API_KEY": "your-api-key-here"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Claude Code (CLI)
|
|
152
|
+
|
|
153
|
+
One command setup:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
claude mcp add latitude npx \
|
|
157
|
+
--scope user \
|
|
158
|
+
--env LATITUDE_API_KEY=your-api-key-here \
|
|
159
|
+
-- latitude-mcp-server
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Or manually add to `~/.claude.json`:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"mcpServers": {
|
|
167
|
+
"latitude": {
|
|
168
|
+
"command": "npx",
|
|
169
|
+
"args": ["latitude-mcp-server"],
|
|
170
|
+
"env": {
|
|
171
|
+
"LATITUDE_API_KEY": "your-api-key-here"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Cursor/Windsurf
|
|
179
|
+
|
|
180
|
+
Add to `.cursor/mcp.json` or MCP settings:
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"mcpServers": {
|
|
185
|
+
"latitude": {
|
|
186
|
+
"command": "npx",
|
|
187
|
+
"args": ["latitude-mcp-server"],
|
|
188
|
+
"env": {
|
|
189
|
+
"LATITUDE_API_KEY": "your-api-key-here"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> **β¨ Pro Tip:** The server outputs in TOON format by default β a token-efficient notation that uses 30-60% fewer tokens than JSON, keeping your LLM context lean.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## β¨ Feature Breakdown
|
|
201
|
+
|
|
202
|
+
<div align="center">
|
|
203
|
+
|
|
204
|
+
| Feature | What It Does | Why You Care |
|
|
205
|
+
| :---: | :--- | :--- |
|
|
206
|
+
| **π Projects**<br/>`list & create` | Manage Latitude projects | Organize prompts by use case |
|
|
207
|
+
| **π Versions**<br/>`draft β live` | Git-like version control | Safe iteration without breaking prod |
|
|
208
|
+
| **π Prompts**<br/>`full CRUD` | Create, read, update prompts | Complete prompt lifecycle |
|
|
209
|
+
| **π File Push**<br/>`local β cloud` | Push prompts from local files | IDE-native workflow |
|
|
210
|
+
| **π€ Execution**<br/>`run & chat` | Execute prompts with params | Test directly from AI |
|
|
211
|
+
| **π Logs**<br/>`monitoring` | View execution history | Debug and optimize |
|
|
212
|
+
| **π Streaming**<br/>`real-time` | Stream AI responses | See results as they generate |
|
|
213
|
+
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## π οΈ Tool Reference
|
|
219
|
+
|
|
220
|
+
This server provides **16 MCP tools** covering the complete Latitude API.
|
|
221
|
+
|
|
222
|
+
<div align="center">
|
|
223
|
+
<table>
|
|
224
|
+
<tr>
|
|
225
|
+
<td align="center">π<br/><b>Projects</b></td>
|
|
226
|
+
<td align="center">π<br/><b>Versions</b></td>
|
|
227
|
+
<td align="center">π<br/><b>Prompts</b></td>
|
|
228
|
+
<td align="center">π€<br/><b>Execution</b></td>
|
|
229
|
+
<td align="center">π<br/><b>Operations</b></td>
|
|
230
|
+
</tr>
|
|
231
|
+
<tr>
|
|
232
|
+
<td valign="top">
|
|
233
|
+
<code>list_projects</code><br/>
|
|
234
|
+
<code>create_project</code>
|
|
235
|
+
</td>
|
|
236
|
+
<td valign="top">
|
|
237
|
+
<code>list_versions</code><br/>
|
|
238
|
+
<code>get_version</code><br/>
|
|
239
|
+
<code>create_version</code><br/>
|
|
240
|
+
<code>publish_version</code>
|
|
241
|
+
</td>
|
|
242
|
+
<td valign="top">
|
|
243
|
+
<code>list_prompts</code><br/>
|
|
244
|
+
<code>get_prompt</code><br/>
|
|
245
|
+
<code>push_prompt</code><br/>
|
|
246
|
+
<code>push_prompt_from_file</code>
|
|
247
|
+
</td>
|
|
248
|
+
<td valign="top">
|
|
249
|
+
<code>run_prompt</code><br/>
|
|
250
|
+
<code>chat</code><br/>
|
|
251
|
+
<code>get_conversation</code>
|
|
252
|
+
</td>
|
|
253
|
+
<td valign="top">
|
|
254
|
+
<code>list_logs</code><br/>
|
|
255
|
+
<code>create_log</code><br/>
|
|
256
|
+
<code>trigger_evaluation</code>
|
|
257
|
+
</td>
|
|
258
|
+
</tr>
|
|
259
|
+
</table>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
### Project Tools
|
|
265
|
+
|
|
266
|
+
#### `latitude_list_projects`
|
|
267
|
+
|
|
268
|
+
List all projects in your Latitude workspace.
|
|
269
|
+
|
|
270
|
+
```json
|
|
271
|
+
// No parameters required
|
|
272
|
+
{}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Returns:** Array of projects with `id`, `name`, `createdAt`, `updatedAt`
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
#### `latitude_create_project`
|
|
280
|
+
|
|
281
|
+
Create a new project.
|
|
282
|
+
|
|
283
|
+
| Parameter | Type | Required | Description |
|
|
284
|
+
|-----------|------|----------|-------------|
|
|
285
|
+
| `name` | `string` | Yes | Project name |
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"name": "My Awesome Prompts"
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
### Version Tools
|
|
296
|
+
|
|
297
|
+
#### `latitude_list_versions`
|
|
298
|
+
|
|
299
|
+
List all versions (commits) for a project.
|
|
300
|
+
|
|
301
|
+
| Parameter | Type | Required | Description |
|
|
302
|
+
|-----------|------|----------|-------------|
|
|
303
|
+
| `projectId` | `string` | Yes | Project ID |
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"projectId": "27756"
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
#### `latitude_get_version`
|
|
314
|
+
|
|
315
|
+
Get details for a specific version.
|
|
316
|
+
|
|
317
|
+
| Parameter | Type | Required | Description |
|
|
318
|
+
|-----------|------|----------|-------------|
|
|
319
|
+
| `projectId` | `string` | Yes | Project ID |
|
|
320
|
+
| `versionUuid` | `string` | Yes | Version UUID |
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
#### `latitude_create_version`
|
|
325
|
+
|
|
326
|
+
Create a new draft version (branch).
|
|
327
|
+
|
|
328
|
+
| Parameter | Type | Required | Description |
|
|
329
|
+
|-----------|------|----------|-------------|
|
|
330
|
+
| `projectId` | `string` | Yes | Project ID |
|
|
331
|
+
| `name` | `string` | Yes | Version/commit name |
|
|
332
|
+
|
|
333
|
+
```json
|
|
334
|
+
{
|
|
335
|
+
"projectId": "27756",
|
|
336
|
+
"name": "feature-new-tone"
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
#### `latitude_publish_version`
|
|
343
|
+
|
|
344
|
+
Publish a draft version to make it live.
|
|
345
|
+
|
|
346
|
+
| Parameter | Type | Required | Description |
|
|
347
|
+
|-----------|------|----------|-------------|
|
|
348
|
+
| `projectId` | `string` | Yes | Project ID |
|
|
349
|
+
| `versionUuid` | `string` | Yes | Draft version UUID |
|
|
350
|
+
| `title` | `string` | No | Publication title |
|
|
351
|
+
| `description` | `string` | No | Publication notes |
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
### Prompt Tools
|
|
356
|
+
|
|
357
|
+
#### `latitude_list_prompts`
|
|
358
|
+
|
|
359
|
+
List all prompts in a version.
|
|
360
|
+
|
|
361
|
+
| Parameter | Type | Required | Default | Description |
|
|
362
|
+
|-----------|------|----------|---------|-------------|
|
|
363
|
+
| `projectId` | `string` | Yes | β | Project ID |
|
|
364
|
+
| `versionUuid` | `string` | No | `"live"` | Version UUID |
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
#### `latitude_get_prompt`
|
|
369
|
+
|
|
370
|
+
Get a specific prompt by path.
|
|
371
|
+
|
|
372
|
+
| Parameter | Type | Required | Default | Description |
|
|
373
|
+
|-----------|------|----------|---------|-------------|
|
|
374
|
+
| `projectId` | `string` | Yes | β | Project ID |
|
|
375
|
+
| `path` | `string` | Yes | β | Prompt path (e.g., `"my-prompt"`) |
|
|
376
|
+
| `versionUuid` | `string` | No | `"live"` | Version UUID |
|
|
377
|
+
|
|
378
|
+
```json
|
|
379
|
+
{
|
|
380
|
+
"projectId": "27756",
|
|
381
|
+
"path": "onboarding/welcome",
|
|
382
|
+
"versionUuid": "79b52596-7941-4ed3-82cf-23e13fa170db"
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
#### `latitude_push_prompt`
|
|
389
|
+
|
|
390
|
+
Push prompt content to a draft version.
|
|
391
|
+
|
|
392
|
+
| Parameter | Type | Required | Default | Description |
|
|
393
|
+
|-----------|------|----------|---------|-------------|
|
|
394
|
+
| `projectId` | `string` | Yes | β | Project ID |
|
|
395
|
+
| `versionUuid` | `string` | Yes | β | Draft version UUID |
|
|
396
|
+
| `path` | `string` | Yes | β | Prompt path |
|
|
397
|
+
| `content` | `string` | Yes | β | Full prompt content with frontmatter |
|
|
398
|
+
| `force` | `boolean` | No | `false` | Overwrite if exists |
|
|
399
|
+
|
|
400
|
+
```json
|
|
401
|
+
{
|
|
402
|
+
"projectId": "27756",
|
|
403
|
+
"versionUuid": "79b52596-7941-4ed3-82cf-23e13fa170db",
|
|
404
|
+
"path": "greeting",
|
|
405
|
+
"content": "---\nprovider: openai\nmodel: gpt-4o-mini\n---\nHello {{name}}! Welcome to our service."
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
#### `latitude_push_prompt_from_file` β
|
|
412
|
+
|
|
413
|
+
**Push a prompt directly from a local file.** This is the killer feature for IDE workflows.
|
|
414
|
+
|
|
415
|
+
| Parameter | Type | Required | Default | Description |
|
|
416
|
+
|-----------|------|----------|---------|-------------|
|
|
417
|
+
| `projectId` | `string` | Yes | β | Project ID |
|
|
418
|
+
| `versionUuid` | `string` | Yes | β | Draft version UUID |
|
|
419
|
+
| `filePath` | `string` | Yes | β | Absolute path to prompt file |
|
|
420
|
+
| `promptPath` | `string` | No | *derived* | Path in Latitude (auto-derived from filename) |
|
|
421
|
+
| `force` | `boolean` | No | `false` | Overwrite if exists |
|
|
422
|
+
|
|
423
|
+
**Auto-derivation:** If you push `/path/to/my-prompt.md`, it automatically becomes `my-prompt` in Latitude.
|
|
424
|
+
|
|
425
|
+
```json
|
|
426
|
+
{
|
|
427
|
+
"projectId": "27756",
|
|
428
|
+
"versionUuid": "79b52596-7941-4ed3-82cf-23e13fa170db",
|
|
429
|
+
"filePath": "/Users/you/prompts/welcome-message.md"
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Supported extensions:** `.md`, `.promptl`, `.txt`
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
### Execution Tools
|
|
438
|
+
|
|
439
|
+
#### `latitude_run_prompt`
|
|
440
|
+
|
|
441
|
+
Execute a prompt and get AI response.
|
|
442
|
+
|
|
443
|
+
| Parameter | Type | Required | Default | Description |
|
|
444
|
+
|-----------|------|----------|---------|-------------|
|
|
445
|
+
| `projectId` | `string` | Yes | β | Project ID |
|
|
446
|
+
| `path` | `string` | Yes | β | Prompt path |
|
|
447
|
+
| `versionUuid` | `string` | No | `"live"` | Version UUID |
|
|
448
|
+
| `parameters` | `object` | No | `{}` | Template variables |
|
|
449
|
+
| `userMessage` | `string` | No | β | Additional user input |
|
|
450
|
+
| `stream` | `boolean` | No | `false` | Enable streaming |
|
|
451
|
+
|
|
452
|
+
```json
|
|
453
|
+
{
|
|
454
|
+
"projectId": "27756",
|
|
455
|
+
"path": "greeting",
|
|
456
|
+
"parameters": { "name": "World" },
|
|
457
|
+
"stream": true
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
#### `latitude_chat`
|
|
464
|
+
|
|
465
|
+
Continue an existing conversation.
|
|
466
|
+
|
|
467
|
+
| Parameter | Type | Required | Default | Description |
|
|
468
|
+
|-----------|------|----------|---------|-------------|
|
|
469
|
+
| `conversationUuid` | `string` | Yes | β | Conversation UUID |
|
|
470
|
+
| `message` | `string` | Yes | β | User message |
|
|
471
|
+
| `stream` | `boolean` | No | `false` | Enable streaming |
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
#### `latitude_get_conversation`
|
|
476
|
+
|
|
477
|
+
Get full conversation history.
|
|
478
|
+
|
|
479
|
+
| Parameter | Type | Required | Description |
|
|
480
|
+
|-----------|------|----------|-------------|
|
|
481
|
+
| `conversationUuid` | `string` | Yes | Conversation UUID |
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
### Operations Tools
|
|
486
|
+
|
|
487
|
+
#### `latitude_list_logs`
|
|
488
|
+
|
|
489
|
+
Get execution logs for a prompt.
|
|
490
|
+
|
|
491
|
+
| Parameter | Type | Required | Default | Description |
|
|
492
|
+
|-----------|------|----------|---------|-------------|
|
|
493
|
+
| `projectId` | `string` | Yes | β | Project ID |
|
|
494
|
+
| `documentUuid` | `string` | No | β | Filter by prompt UUID |
|
|
495
|
+
| `page` | `number` | No | `1` | Page number |
|
|
496
|
+
| `pageSize` | `number` | No | `25` | Results per page |
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
#### `latitude_create_log`
|
|
501
|
+
|
|
502
|
+
Create a log entry for external executions.
|
|
503
|
+
|
|
504
|
+
| Parameter | Type | Required | Description |
|
|
505
|
+
|-----------|------|----------|-------------|
|
|
506
|
+
| `projectId` | `string` | Yes | Project ID |
|
|
507
|
+
| `documentPath` | `string` | Yes | Prompt path |
|
|
508
|
+
| `messages` | `array` | Yes | Conversation messages |
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
#### `latitude_trigger_evaluation`
|
|
513
|
+
|
|
514
|
+
Trigger an evaluation run for a prompt.
|
|
515
|
+
|
|
516
|
+
| Parameter | Type | Required | Description |
|
|
517
|
+
|-----------|------|----------|-------------|
|
|
518
|
+
| `projectId` | `string` | Yes | Project ID |
|
|
519
|
+
| `evaluationUuid` | `string` | Yes | Evaluation UUID |
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
## π Resource Templates
|
|
524
|
+
|
|
525
|
+
Access Latitude data via MCP resources (read-only):
|
|
526
|
+
|
|
527
|
+
| Resource URI | Description |
|
|
528
|
+
|:-------------|:------------|
|
|
529
|
+
| `latitude://projects` | List all projects |
|
|
530
|
+
| `latitude://projects/{projectId}/versions` | List versions for project |
|
|
531
|
+
| `latitude://projects/{projectId}/versions/{versionUuid}/prompts` | List prompts in version |
|
|
532
|
+
| `latitude://projects/{projectId}/versions/{versionUuid}/prompts/{path}` | Get specific prompt |
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
## π» CLI Reference
|
|
537
|
+
|
|
538
|
+
The server also works as a standalone CLI tool:
|
|
539
|
+
|
|
540
|
+
```bash
|
|
541
|
+
# Set your API key
|
|
542
|
+
export LATITUDE_API_KEY="your-key"
|
|
543
|
+
|
|
544
|
+
# Or use inline
|
|
545
|
+
LATITUDE_API_KEY="your-key" latitude-mcp projects list
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### Commands
|
|
549
|
+
|
|
550
|
+
```bash
|
|
551
|
+
# Projects
|
|
552
|
+
latitude-mcp projects list
|
|
553
|
+
latitude-mcp projects create "My Project"
|
|
554
|
+
|
|
555
|
+
# Versions
|
|
556
|
+
latitude-mcp versions list <projectId>
|
|
557
|
+
latitude-mcp versions create <projectId> "Draft Name"
|
|
558
|
+
|
|
559
|
+
# Prompts
|
|
560
|
+
latitude-mcp prompts list <projectId> -v <versionUuid>
|
|
561
|
+
latitude-mcp prompts get <projectId> <path> -v <versionUuid>
|
|
562
|
+
|
|
563
|
+
# Push (inline content)
|
|
564
|
+
latitude-mcp push <projectId> <versionUuid> <promptPath> --content "---\nprovider: openai\n---\nHello!"
|
|
565
|
+
|
|
566
|
+
# Push (from file) β
|
|
567
|
+
latitude-mcp push <projectId> <versionUuid> --file /path/to/prompt.md
|
|
568
|
+
|
|
569
|
+
# Run
|
|
570
|
+
latitude-mcp run <projectId> <path> -v <versionUuid> -p '{"name": "World"}'
|
|
571
|
+
|
|
572
|
+
# Chat
|
|
573
|
+
latitude-mcp chat <conversationUuid> -m "Follow up question"
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### Options
|
|
577
|
+
|
|
578
|
+
| Flag | Description |
|
|
579
|
+
|------|-------------|
|
|
580
|
+
| `-v, --version-uuid` | Version UUID (default: `"live"`) |
|
|
581
|
+
| `-p, --parameters` | JSON parameters for run |
|
|
582
|
+
| `-m, --message` | Message for chat |
|
|
583
|
+
| `-s, --stream` | Enable streaming |
|
|
584
|
+
| `-o, --output-format` | `"toon"` or `"json"` (default: `"toon"`) |
|
|
585
|
+
| `--file` | Path to prompt file |
|
|
586
|
+
| `--content` | Inline prompt content |
|
|
587
|
+
| `--force` | Force overwrite |
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
## π₯ Recommended Workflows
|
|
592
|
+
|
|
593
|
+
### Local Development Flow
|
|
594
|
+
|
|
595
|
+
```
|
|
596
|
+
1. Write prompt in your IDE: /prompts/my-feature.md
|
|
597
|
+
2. AI: "Push this to my Latitude draft"
|
|
598
|
+
β latitude_push_prompt_from_file
|
|
599
|
+
3. AI: "Run it with test parameters"
|
|
600
|
+
β latitude_run_prompt
|
|
601
|
+
4. Iterate on content locally
|
|
602
|
+
5. AI: "Push the updated version"
|
|
603
|
+
6. AI: "Publish to live"
|
|
604
|
+
β latitude_publish_version
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
### Prompt Audit Flow
|
|
608
|
+
|
|
609
|
+
```
|
|
610
|
+
1. AI: "List all my Latitude projects"
|
|
611
|
+
β latitude_list_projects
|
|
612
|
+
2. AI: "Show me all prompts in project 27756"
|
|
613
|
+
β latitude_list_prompts
|
|
614
|
+
3. AI: "Get the content of the onboarding prompt"
|
|
615
|
+
β latitude_get_prompt
|
|
616
|
+
4. AI: "Check the execution logs"
|
|
617
|
+
β latitude_list_logs
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
### Conversation Testing Flow
|
|
621
|
+
|
|
622
|
+
```
|
|
623
|
+
1. AI: "Run the support-bot prompt"
|
|
624
|
+
β latitude_run_prompt (returns conversationUuid)
|
|
625
|
+
2. AI: "Continue with: What about refunds?"
|
|
626
|
+
β latitude_chat
|
|
627
|
+
3. AI: "Show the full conversation"
|
|
628
|
+
β latitude_get_conversation
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
---
|
|
632
|
+
|
|
633
|
+
## βοΈ Environment Variables
|
|
634
|
+
|
|
635
|
+
| Variable | Required | Default | Description |
|
|
636
|
+
|----------|----------|---------|-------------|
|
|
637
|
+
| `LATITUDE_API_KEY` | Yes | β | Your Latitude API key |
|
|
638
|
+
| `LATITUDE_BASE_URL` | No | `https://gateway.latitude.so` | API base URL |
|
|
639
|
+
|
|
640
|
+
---
|
|
641
|
+
|
|
642
|
+
## π₯ Common Issues & Quick Fixes
|
|
643
|
+
|
|
644
|
+
<details>
|
|
645
|
+
<summary><b>Expand for troubleshooting tips</b></summary>
|
|
646
|
+
|
|
647
|
+
| Problem | Solution |
|
|
648
|
+
| :--- | :--- |
|
|
649
|
+
| **"LATITUDE_API_KEY is required"** | Set the env variable in your MCP config or shell |
|
|
650
|
+
| **"Head commit not found"** | Project has no published version β use a specific `versionUuid` instead of `"live"` |
|
|
651
|
+
| **"Provider API Key not found"** | Add your LLM provider key (OpenAI, Anthropic) in [Latitude settings](https://app.latitude.so/settings) |
|
|
652
|
+
| **Push fails with "version is merged"** | Can only push to draft versions β create a new draft first |
|
|
653
|
+
| **File push path wrong** | The tool auto-derives from filename; use `promptPath` param to override |
|
|
654
|
+
|
|
655
|
+
</details>
|
|
656
|
+
|
|
657
|
+
---
|
|
658
|
+
|
|
659
|
+
## π οΈ Development
|
|
660
|
+
|
|
661
|
+
```bash
|
|
662
|
+
# Clone
|
|
663
|
+
git clone https://github.com/yigitkonur/latitude-mcp-server.git
|
|
664
|
+
cd latitude-mcp-server
|
|
665
|
+
|
|
666
|
+
# Install
|
|
667
|
+
npm install
|
|
668
|
+
|
|
669
|
+
# Build
|
|
670
|
+
npm run build
|
|
671
|
+
|
|
672
|
+
# Test
|
|
673
|
+
npm test
|
|
674
|
+
|
|
675
|
+
# Run locally
|
|
676
|
+
LATITUDE_API_KEY=your-key node dist/index.js projects list
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
---
|
|
680
|
+
|
|
681
|
+
<div align="center">
|
|
682
|
+
|
|
683
|
+
**Built with π because managing prompts should be as easy as writing code.**
|
|
684
|
+
|
|
685
|
+
ISC Β© [YiΔit Konur](https://github.com/yigitkonur)
|
|
686
|
+
|
|
687
|
+
</div>
|