@1pxlabs/1px-mcp 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/README.md ADDED
@@ -0,0 +1,111 @@
1
+ # 1px MCP
2
+
3
+ Model Context Protocol server for [1px](https://1px.ch) — a minimalist utility suite for the web.
4
+
5
+ ## What it does
6
+
7
+ This MCP server lets AI assistants (Claude, Cursor, etc.) interact with your 1px account:
8
+
9
+ - **Shorten URLs** — `create_short_url`
10
+ - **Create pastes** — `create_paste`
11
+ - **Host markdown** — `create_markdown`
12
+ - **Upload files** — `upload_file`
13
+ - **List items** — `list_items`
14
+ - **Update pastes/markdowns** — `update_paste`, `update_markdown`
15
+ - **Delete items** — `delete_item`
16
+
17
+ ## Setup
18
+
19
+ ### 1. Get an API key
20
+
21
+ Go to [https://1px.ch/dashboard/api](https://1px.ch/dashboard/api) and create an API key.
22
+
23
+ ### 2. Install
24
+
25
+ ```bash
26
+ npx @1pxlabs/1px-mcp
27
+ ```
28
+
29
+ Or clone and run locally:
30
+ ```bash
31
+ git clone https://github.com/1px-labs/1px.git
32
+ cd 1px/1px-mcp
33
+ npm install
34
+ npm run build
35
+ npm start
36
+ ```
37
+
38
+ ### 3. Configure with Claude Desktop
39
+
40
+ Open your Claude Desktop config:
41
+
42
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
43
+ **Windows:** `%APPDATA%/Claude/claude_desktop_config.json`
44
+
45
+ Add the 1px server:
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "1px": {
51
+ "command": "node",
52
+ "args": ["/absolute/path/to/1px-mcp/dist/index.js"],
53
+ "env": {
54
+ "ONE_PX_API_KEY": "your_api_key_here"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ Or use the published npm package:
62
+
63
+ ```json
64
+ {
65
+ "mcpServers": {
66
+ "1px": {
67
+ "command": "npx",
68
+ "args": ["@1pxlabs/1px-mcp"],
69
+ "env": {
70
+ "ONE_PX_API_KEY": "your_api_key_here"
71
+ }
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ ### 4. Restart Claude Desktop
78
+
79
+ Quit and reopen Claude. The 1px tools will appear in the MCP tools panel.
80
+
81
+ ## Environment variables
82
+
83
+ | Variable | Default | Description |
84
+ |----------|---------|-------------|
85
+ | `ONE_PX_API_KEY` | *(required)* | Your 1px API key |
86
+ | `ONE_PX_API_BASE` | `https://api.1px.ch` | API base URL (override for self-hosted) |
87
+
88
+ ## Example prompts
89
+
90
+ > "Shorten this link for me: https://example.com/very/long/path"
91
+
92
+ > "Save this error log to 1px so I can share it"
93
+
94
+ > "Create a markdown page with my meeting notes"
95
+
96
+ > "What files have I uploaded recently?"
97
+
98
+ > "Delete that paste abc123"
99
+
100
+ ## Development
101
+
102
+ ```bash
103
+ npm install
104
+ npm run build
105
+ ONE_PX_API_KEY=your_key node dist/index.js
106
+ ```
107
+
108
+ The server is written in TypeScript in `src/` and compiles to `dist/`. Use `npm run dev`
109
+ to rebuild on save, or `npm run typecheck` to type-check without emitting.
110
+
111
+ The server runs over stdio (standard input/output) as required by the MCP protocol. It does not expose an HTTP server.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,355 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ const API_BASE = process.env.ONE_PX_API_BASE || "https://api.1px.ch";
6
+ const API_KEY = process.env.ONE_PX_API_KEY;
7
+ if (!API_KEY) {
8
+ console.error("Error: ONE_PX_API_KEY environment variable is required.");
9
+ console.error("Get your API key from https://1px.ch/dashboard/api");
10
+ process.exit(1);
11
+ }
12
+ async function api(path, options = {}) {
13
+ const url = `${API_BASE}${path}`;
14
+ const res = await fetch(url, {
15
+ ...options,
16
+ headers: {
17
+ Authorization: `Bearer ${API_KEY}`,
18
+ "Content-Type": "application/json",
19
+ ...options.headers,
20
+ },
21
+ });
22
+ const text = await res.text();
23
+ const data = text ? JSON.parse(text) : {};
24
+ if (!res.ok) {
25
+ throw new Error(data.error || `HTTP ${res.status}`);
26
+ }
27
+ return data;
28
+ }
29
+ function str(args, key) {
30
+ const value = args?.[key];
31
+ if (typeof value !== "string") {
32
+ throw new Error(`Missing or invalid "${key}" argument.`);
33
+ }
34
+ return value;
35
+ }
36
+ function itemType(args, key) {
37
+ const value = str(args, key);
38
+ if (value !== "url" && value !== "paste" && value !== "markdown" && value !== "file") {
39
+ throw new Error(`Invalid "${key}": expected url, paste, markdown, or file.`);
40
+ }
41
+ return value;
42
+ }
43
+ const server = new Server({ name: "1px", version: "1.0.0" }, { capabilities: { tools: {} } });
44
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
45
+ tools: [
46
+ {
47
+ name: "create_short_url",
48
+ description: "Shorten a long URL using 1px. Returns a short ID like abc123 that can be accessed at https://1px.ch/{id}.",
49
+ inputSchema: {
50
+ type: "object",
51
+ properties: {
52
+ url: {
53
+ type: "string",
54
+ description: "The full URL to shorten (e.g., https://example.com/some/long/path)",
55
+ },
56
+ },
57
+ required: ["url"],
58
+ },
59
+ },
60
+ {
61
+ name: "create_paste",
62
+ description: "Create a text paste on 1px. Great for sharing code snippets, logs, or notes. Max 512KB.",
63
+ inputSchema: {
64
+ type: "object",
65
+ properties: {
66
+ content: {
67
+ type: "string",
68
+ description: "The text content to paste",
69
+ },
70
+ },
71
+ required: ["content"],
72
+ },
73
+ },
74
+ {
75
+ name: "create_markdown",
76
+ description: "Host a markdown page on 1px. The page will be rendered as HTML when visited. Max 512KB.",
77
+ inputSchema: {
78
+ type: "object",
79
+ properties: {
80
+ content: {
81
+ type: "string",
82
+ description: "The markdown content to host",
83
+ },
84
+ },
85
+ required: ["content"],
86
+ },
87
+ },
88
+ {
89
+ name: "upload_file",
90
+ description: "Upload a file to 1px. Max 50MB. Returns a public URL. Files are blocked: exe, scr, cpl, doc, docx, docm, dot, dotx, dotm, jar.",
91
+ inputSchema: {
92
+ type: "object",
93
+ properties: {
94
+ name: {
95
+ type: "string",
96
+ description: "The filename including extension (e.g., image.png, document.pdf)",
97
+ },
98
+ content: {
99
+ type: "string",
100
+ description: "Base64-encoded file content",
101
+ },
102
+ type: {
103
+ type: "string",
104
+ description: "MIME type of the file (e.g., image/png, application/pdf)",
105
+ },
106
+ },
107
+ required: ["name", "content", "type"],
108
+ },
109
+ },
110
+ {
111
+ name: "list_items",
112
+ description: "List your 1px items (URLs, pastes, markdowns, or files).",
113
+ inputSchema: {
114
+ type: "object",
115
+ properties: {
116
+ type: {
117
+ type: "string",
118
+ enum: ["url", "paste", "markdown", "file"],
119
+ description: "The type of items to list",
120
+ },
121
+ },
122
+ required: ["type"],
123
+ },
124
+ },
125
+ {
126
+ name: "delete_item",
127
+ description: "Delete a URL, paste, markdown, or file by ID.",
128
+ inputSchema: {
129
+ type: "object",
130
+ properties: {
131
+ type: {
132
+ type: "string",
133
+ enum: ["url", "paste", "markdown", "file"],
134
+ description: "The type of item to delete",
135
+ },
136
+ id: {
137
+ type: "string",
138
+ description: "The item ID (e.g., abc123)",
139
+ },
140
+ },
141
+ required: ["type", "id"],
142
+ },
143
+ },
144
+ {
145
+ name: "update_paste",
146
+ description: "Update the content of an existing paste by ID. Max 512KB.",
147
+ inputSchema: {
148
+ type: "object",
149
+ properties: {
150
+ id: {
151
+ type: "string",
152
+ description: "The paste ID (e.g., abc123)",
153
+ },
154
+ content: {
155
+ type: "string",
156
+ description: "The new text content",
157
+ },
158
+ },
159
+ required: ["id", "content"],
160
+ },
161
+ },
162
+ {
163
+ name: "update_markdown",
164
+ description: "Update the content of an existing markdown page by ID. Max 512KB.",
165
+ inputSchema: {
166
+ type: "object",
167
+ properties: {
168
+ id: {
169
+ type: "string",
170
+ description: "The markdown ID (e.g., abc123)",
171
+ },
172
+ content: {
173
+ type: "string",
174
+ description: "The new markdown content",
175
+ },
176
+ },
177
+ required: ["id", "content"],
178
+ },
179
+ },
180
+ ],
181
+ }));
182
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
183
+ const { name, arguments: args } = request.params;
184
+ try {
185
+ switch (name) {
186
+ case "create_short_url": {
187
+ const data = await api("/url", {
188
+ method: "POST",
189
+ body: JSON.stringify({ url: str(args, "url") }),
190
+ });
191
+ return {
192
+ content: [
193
+ {
194
+ type: "text",
195
+ text: `Shortened: https://1px.ch/${data.id}`,
196
+ },
197
+ ],
198
+ };
199
+ }
200
+ case "create_paste": {
201
+ const data = await api("/paste", {
202
+ method: "POST",
203
+ body: JSON.stringify({ content: str(args, "content") }),
204
+ });
205
+ return {
206
+ content: [
207
+ {
208
+ type: "text",
209
+ text: `Paste created: https://1px.ch/${data.id}`,
210
+ },
211
+ ],
212
+ };
213
+ }
214
+ case "create_markdown": {
215
+ const data = await api("/markdown", {
216
+ method: "POST",
217
+ body: JSON.stringify({ content: str(args, "content") }),
218
+ });
219
+ return {
220
+ content: [
221
+ {
222
+ type: "text",
223
+ text: `Markdown hosted: https://1px.ch/${data.id}`,
224
+ },
225
+ ],
226
+ };
227
+ }
228
+ case "upload_file": {
229
+ const fileName = str(args, "name");
230
+ const fileType = str(args, "type");
231
+ const buffer = Buffer.from(str(args, "content"), "base64");
232
+ const size = buffer.byteLength;
233
+ // Step 1: Get presigned URL
234
+ const presigned = await api("/file", {
235
+ method: "POST",
236
+ body: JSON.stringify({
237
+ name: fileName,
238
+ size,
239
+ type: fileType,
240
+ }),
241
+ });
242
+ // Step 2: Upload to Supabase Storage
243
+ const uploadRes = await fetch(presigned.presignedUrl, {
244
+ method: "PUT",
245
+ headers: { "Content-Type": fileType },
246
+ body: buffer,
247
+ });
248
+ if (!uploadRes.ok) {
249
+ throw new Error(`File upload failed: ${uploadRes.status}`);
250
+ }
251
+ // Step 3: Confirm upload
252
+ await api("/file/confirm", {
253
+ method: "POST",
254
+ body: JSON.stringify({
255
+ id: presigned.id,
256
+ content: presigned.content,
257
+ size,
258
+ }),
259
+ });
260
+ return {
261
+ content: [
262
+ {
263
+ type: "text",
264
+ text: `File uploaded: https://1px.ch/${presigned.content}`,
265
+ },
266
+ ],
267
+ };
268
+ }
269
+ case "list_items": {
270
+ const type = itemType(args, "type");
271
+ const data = await api(`/${type}`);
272
+ if (!Array.isArray(data) || data.length === 0) {
273
+ return {
274
+ content: [{ type: "text", text: "No items found." }],
275
+ };
276
+ }
277
+ const lines = data.map((item) => {
278
+ const prefix = type === "file" ? "📎" : type === "url" ? "🔗" : type === "paste" ? "📋" : "📝";
279
+ const urlPath = type === "file" ? item.content : item.id;
280
+ const content = item.content?.slice(0, 60) || "";
281
+ return `${prefix} https://1px.ch/${urlPath} — ${content}${(item.content?.length ?? 0) > 60 ? "..." : ""}`;
282
+ });
283
+ return {
284
+ content: [
285
+ {
286
+ type: "text",
287
+ text: lines.join("\n"),
288
+ },
289
+ ],
290
+ };
291
+ }
292
+ case "delete_item": {
293
+ const type = itemType(args, "type");
294
+ const id = str(args, "id");
295
+ await api(`/${type}/${id}`, {
296
+ method: "DELETE",
297
+ });
298
+ return {
299
+ content: [
300
+ {
301
+ type: "text",
302
+ text: `${type} ${id} deleted.`,
303
+ },
304
+ ],
305
+ };
306
+ }
307
+ case "update_paste": {
308
+ const id = str(args, "id");
309
+ await api(`/paste/${id}`, {
310
+ method: "PATCH",
311
+ body: JSON.stringify({ content: str(args, "content") }),
312
+ });
313
+ return {
314
+ content: [
315
+ {
316
+ type: "text",
317
+ text: `Paste ${id} updated: https://1px.ch/${id}`,
318
+ },
319
+ ],
320
+ };
321
+ }
322
+ case "update_markdown": {
323
+ const id = str(args, "id");
324
+ await api(`/markdown/${id}`, {
325
+ method: "PATCH",
326
+ body: JSON.stringify({ content: str(args, "content") }),
327
+ });
328
+ return {
329
+ content: [
330
+ {
331
+ type: "text",
332
+ text: `Markdown ${id} updated: https://1px.ch/${id}`,
333
+ },
334
+ ],
335
+ };
336
+ }
337
+ default:
338
+ throw new Error(`Unknown tool: ${name}`);
339
+ }
340
+ }
341
+ catch (err) {
342
+ return {
343
+ content: [
344
+ {
345
+ type: "text",
346
+ text: `Error: ${err instanceof Error ? err.message : String(err)}`,
347
+ },
348
+ ],
349
+ isError: true,
350
+ };
351
+ }
352
+ });
353
+ const transport = new StdioServerTransport();
354
+ await server.connect(transport);
355
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,oBAAoB,CAAC;AACrE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;AAE3C,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IACzE,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAeD,KAAK,UAAU,GAAG,CAAI,IAAY,EAAE,UAAuB,EAAE;IAC3D,MAAM,GAAG,GAAG,GAAG,QAAQ,GAAG,IAAI,EAAE,CAAC;IACjC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,GAAG,OAAO;QACV,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,OAAO,EAAE;YAClC,cAAc,EAAE,kBAAkB;YAClC,GAAG,OAAO,CAAC,OAAO;SACnB;KACF,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,I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,EAAE,EAAE;yBAClD;qBACF;iBACF,CAAC;YACJ,CAAC;YAED,KAAK,iBAAiB,CAAC,CAAC,CAAC;gBACvB,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC3B,MAAM,GAAG,CAAC,aAAa,EAAE,EAAE,EAAE;oBAC3B,MAAM,EAAE,OAAO;oBACf,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;iBACxD,CAAC,CAAC;gBACH,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,YAAY,EAAE,4BAA4B,EAAE,EAAE;yBACrD;qBACF;iBACF,CAAC;YACJ,CAAC;YAED;gBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;iBACnE;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@1pxlabs/1px-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for 1px — URL shortener, paste bin, markdown host, and file upload",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "1px-mcp": "./dist/index.js"
10
+ },
11
+ "files": [
12
+ "dist/",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "dev": "tsc --watch",
18
+ "typecheck": "tsc --noEmit",
19
+ "start": "node dist/index.js",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "mcp",
24
+ "1px",
25
+ "url-shortener",
26
+ "pastebin",
27
+ "markdown",
28
+ "file-upload"
29
+ ],
30
+ "author": "1px",
31
+ "license": "MIT",
32
+ "engines": {
33
+ "node": ">=18.0.0"
34
+ },
35
+ "dependencies": {
36
+ "@modelcontextprotocol/sdk": "^1.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^26.4.1",
40
+ "typescript": "^5"
41
+ }
42
+ }