@postmcp/presets 0.1.25 → 0.1.26
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/README.md +9 -7
- package/dist/index.js +9 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -4
package/README.md
CHANGED
|
@@ -33,15 +33,17 @@ pnpm add @postmcp/presets
|
|
|
33
33
|
## Programmatic Usage
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import { ALL_PRESETS,
|
|
36
|
+
import { ALL_PRESETS, getPreset, getPresetsByCategory } from '@postmcp/presets';
|
|
37
37
|
|
|
38
38
|
// 1. Get a specific preset by ID
|
|
39
|
-
const stripePreset =
|
|
40
|
-
|
|
41
|
-
console.log(stripePreset.
|
|
39
|
+
const stripePreset = getPreset('stripe');
|
|
40
|
+
if (stripePreset) {
|
|
41
|
+
console.log(stripePreset.name); // "Stripe REST API"
|
|
42
|
+
console.log(stripePreset.fieldMasks); // Pre-tuned field masks
|
|
43
|
+
}
|
|
42
44
|
|
|
43
45
|
// 2. Filter presets by category
|
|
44
|
-
const devPresets = getPresetsByCategory('
|
|
46
|
+
const devPresets = getPresetsByCategory('Developer Tools');
|
|
45
47
|
console.log(`Found ${devPresets.length} developer tool presets`);
|
|
46
48
|
|
|
47
49
|
// 3. List all available preset IDs
|
|
@@ -53,7 +55,7 @@ console.log(ids);
|
|
|
53
55
|
|
|
54
56
|
## Included Categories & Sample Presets
|
|
55
57
|
|
|
56
|
-
* **Developer Tools**: `@github`, `@gitlab`, `@
|
|
58
|
+
* **Developer Tools**: `@github`, `@gitlab`, `@jira`, `@sentry`, `@datadog`, `@postman`
|
|
57
59
|
* **Finance & Payments**: `@stripe`, `@plaid`, `@square`, `@coinbase`
|
|
58
60
|
* **Cloud & Infrastructure**: `@supabase`, `@cloudflare`, `@digitalocean`, `@render`, `@vercel`
|
|
59
61
|
* **AI & Machine Learning**: `@openai`, `@anthropic`, `@huggingface`, `@replicate`
|
|
@@ -71,7 +73,7 @@ Use any preset directly with `@postmcp/cli`:
|
|
|
71
73
|
npx @postmcp/cli run @stripe --token-diet --jit
|
|
72
74
|
|
|
73
75
|
# Export configuration for Cursor
|
|
74
|
-
npx @postmcp/cli export @
|
|
76
|
+
npx @postmcp/cli export @stripe --client cursor --write
|
|
75
77
|
|
|
76
78
|
# Browse available presets
|
|
77
79
|
npx @postmcp/cli presets
|
package/dist/index.js
CHANGED
|
@@ -114,6 +114,9 @@ var DEVELOPER_TOOLS_PRESETS = [
|
|
|
114
114
|
authType: "Bearer (GITHUB_TOKEN)",
|
|
115
115
|
authEnvVar: "GITHUB_TOKEN",
|
|
116
116
|
defaultBaseUrl: "https://api.github.com",
|
|
117
|
+
defaultHeaders: {
|
|
118
|
+
"User-Agent": "PostMCP-GitHub-Preset"
|
|
119
|
+
},
|
|
117
120
|
specUrl: "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",
|
|
118
121
|
tags: ["git", "code", "issues", "pr", "actions", "ci/cd", "releases"],
|
|
119
122
|
fieldMasks: [
|
|
@@ -210,51 +213,6 @@ var DEVELOPER_TOOLS_PRESETS = [
|
|
|
210
213
|
]
|
|
211
214
|
})
|
|
212
215
|
},
|
|
213
|
-
{
|
|
214
|
-
id: "linear",
|
|
215
|
-
name: "Linear API",
|
|
216
|
-
description: "Fast project tracking, issues, milestones, teams, and cycles.",
|
|
217
|
-
category: "Developer Tools",
|
|
218
|
-
authType: "Bearer (LINEAR_API_KEY)",
|
|
219
|
-
authEnvVar: "LINEAR_API_KEY",
|
|
220
|
-
defaultBaseUrl: "https://api.linear.app",
|
|
221
|
-
tags: ["issues", "roadmap", "cycles", "product"],
|
|
222
|
-
fieldMasks: [
|
|
223
|
-
{ path: "/issues", fields: ["data.id", "data.title", "data.state.name", "data.priority", "data.assignee.name"] }
|
|
224
|
-
],
|
|
225
|
-
macros: [
|
|
226
|
-
{
|
|
227
|
-
name: "createTeamIssue",
|
|
228
|
-
description: "Creates a new issue in a team and assigns priority",
|
|
229
|
-
parameters: {
|
|
230
|
-
type: "object",
|
|
231
|
-
properties: {
|
|
232
|
-
teamId: { type: "string" },
|
|
233
|
-
title: { type: "string" },
|
|
234
|
-
description: { type: "string" },
|
|
235
|
-
priority: { type: "integer" }
|
|
236
|
-
},
|
|
237
|
-
required: ["teamId", "title"]
|
|
238
|
-
},
|
|
239
|
-
steps: [
|
|
240
|
-
{ id: "createIssue", action: "POST /issues", body: { teamId: "{{teamId}}", title: "{{title}}", description: "{{description}}", priority: "{{priority}}" } }
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
],
|
|
244
|
-
bundledSpec: buildOpenAPISpec({
|
|
245
|
-
title: "Linear API",
|
|
246
|
-
baseUrl: "https://api.linear.app",
|
|
247
|
-
description: "Linear Issue Tracking REST API",
|
|
248
|
-
securityScheme: { name: "bearerAuth", type: "http", scheme: "bearer" },
|
|
249
|
-
endpoints: [
|
|
250
|
-
{ path: "/viewer", method: "get", operationId: "getViewer", summary: "Get current user profile" },
|
|
251
|
-
{ path: "/teams", method: "get", operationId: "listTeams", summary: "List all teams" },
|
|
252
|
-
{ path: "/issues", method: "get", operationId: "listIssues", summary: "List recent issues", parameters: [{ name: "teamId", in: "query", schema: { type: "string" } }] },
|
|
253
|
-
{ path: "/issues", method: "post", operationId: "createIssue", summary: "Create issue", requestBody: { properties: { teamId: { type: "string" }, title: { type: "string" }, description: { type: "string" } } } },
|
|
254
|
-
{ path: "/projects", method: "get", operationId: "listProjects", summary: "List roadmap projects" }
|
|
255
|
-
]
|
|
256
|
-
})
|
|
257
|
-
},
|
|
258
216
|
{
|
|
259
217
|
id: "sentry",
|
|
260
218
|
name: "Sentry API",
|
|
@@ -688,7 +646,7 @@ var PAYMENTS_COMMERCE_PRESETS = [
|
|
|
688
646
|
category: "Payments & Commerce",
|
|
689
647
|
authType: "Bearer (STRIPE_SECRET_KEY)",
|
|
690
648
|
authEnvVar: "STRIPE_SECRET_KEY",
|
|
691
|
-
defaultBaseUrl: "https://api.stripe.com
|
|
649
|
+
defaultBaseUrl: "https://api.stripe.com",
|
|
692
650
|
specUrl: "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json",
|
|
693
651
|
tags: ["payments", "billing", "invoices", "cards", "subscriptions", "refunds"],
|
|
694
652
|
fieldMasks: [
|
|
@@ -716,7 +674,7 @@ var PAYMENTS_COMMERCE_PRESETS = [
|
|
|
716
674
|
],
|
|
717
675
|
bundledSpec: buildOpenAPISpec({
|
|
718
676
|
title: "Stripe API",
|
|
719
|
-
baseUrl: "https://api.stripe.com
|
|
677
|
+
baseUrl: "https://api.stripe.com",
|
|
720
678
|
description: "Stripe Payments and Subscriptions API",
|
|
721
679
|
securityScheme: { name: "bearerAuth", type: "http", scheme: "bearer" },
|
|
722
680
|
endpoints: [
|
|
@@ -1046,6 +1004,9 @@ var COMMUNICATION_AI_PRESETS = [
|
|
|
1046
1004
|
authType: "Header (x-api-key)",
|
|
1047
1005
|
authEnvVar: "ANTHROPIC_API_KEY",
|
|
1048
1006
|
defaultBaseUrl: "https://api.anthropic.com/v1",
|
|
1007
|
+
defaultHeaders: {
|
|
1008
|
+
"anthropic-version": "2023-06-01"
|
|
1009
|
+
},
|
|
1049
1010
|
tags: ["llm", "ai", "claude", "reasoning", "coding"],
|
|
1050
1011
|
bundledSpec: buildOpenAPISpec({
|
|
1051
1012
|
title: "Anthropic Claude API",
|
|
@@ -1619,7 +1580,7 @@ __reExport(index_exports, types_exports, module.exports);
|
|
|
1619
1580
|
// src/auth.ts
|
|
1620
1581
|
function buildPresetAuthConfig(preset, env = process.env) {
|
|
1621
1582
|
const authConfig = {
|
|
1622
|
-
headers: {},
|
|
1583
|
+
headers: { ...preset.defaultHeaders || {} },
|
|
1623
1584
|
securitySchemes: {}
|
|
1624
1585
|
};
|
|
1625
1586
|
const envVarName = preset.authEnvVar;
|