@mac-claw/mcp 1.1.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,268 @@
1
+ # @macclaw/mcp
2
+
3
+ MCP server for **Mac Claw** - AI-powered Mac mini / Mac Studio CtoC marketplace. 47 tools for items, market analysis, checkout, watches, inspections, notifications, and more.
4
+
5
+ ## What is Mac Claw?
6
+
7
+ Mac Claw (macclaw.jp) is a specialized CtoC marketplace for Mac mini and Mac Studio, focused on AI/ML engineers. AI agents can analyze market prices, manage listings, handle transactions, set up watch alerts, and perform remote inspections — all through MCP tools.
8
+
9
+ ## Installation
10
+
11
+ ### For Claude Code
12
+
13
+ ```bash
14
+ claude mcp add macclaw -- npx -y @macclaw/mcp
15
+ ```
16
+
17
+ Then set the environment variable:
18
+ ```bash
19
+ export MACCLAW_API_KEY="mc_your_key_here"
20
+ ```
21
+
22
+ Or add to your MCP settings file (`~/.claude/mcp.json`):
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "macclaw": {
28
+ "command": "npx",
29
+ "args": ["-y", "@macclaw/mcp"],
30
+ "env": {
31
+ "MACCLAW_API_KEY": "mc_your_key_here"
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### For Cursor
39
+
40
+ Add to `.cursor/mcp.json` in your project:
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "macclaw": {
46
+ "command": "npx",
47
+ "args": ["-y", "@macclaw/mcp"],
48
+ "env": {
49
+ "MACCLAW_API_KEY": "mc_your_key_here"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ ### HTTP Mode
57
+
58
+ Start the server in HTTP mode:
59
+
60
+ ```bash
61
+ MACCLAW_API_KEY=mc_xxx MACCLAW_TRANSPORT=http MACCLAW_PORT=3006 npx @macclaw/mcp
62
+ ```
63
+
64
+ Then connect to `http://localhost:3006/mcp`
65
+
66
+ ## Getting an API Key
67
+
68
+ 1. Visit [https://macclaw.jp](https://macclaw.jp)
69
+ 2. Sign up with magic link authentication
70
+ 3. Go to **My Page** > **API Keys** (`/mypage/api-keys/`)
71
+ 4. Create a new API key
72
+ 5. Copy the generated key (starts with `mc_`, 52 characters)
73
+
74
+ **Limits:** Up to 10 API keys per user. Rate limits: 200 reads/min, 30 writes/min per key.
75
+
76
+ ## Environment Variables
77
+
78
+ | Variable | Default | Description |
79
+ |----------|---------|-------------|
80
+ | `MACCLAW_API_KEY` | (required) | Your API key (starts with `mc_`) |
81
+ | `MACCLAW_BASE_URL` | `https://macclaw.jp` | API base URL |
82
+ | `MACCLAW_TRANSPORT` | `stdio` | Transport mode: `stdio` (local) or `http` (server) |
83
+ | `MACCLAW_PORT` | `3006` | HTTP server port (only used when `MACCLAW_TRANSPORT=http`) |
84
+
85
+ ## Available Tools (47 total)
86
+
87
+ ### Items (7 tools)
88
+
89
+ | Tool | Description | Type |
90
+ |------|-------------|------|
91
+ | `items_list` | List items with filters, sorting, pagination | read |
92
+ | `items_get` | Get item details (images, comments) | read |
93
+ | `items_search` | Full-text search items | read |
94
+ | `items_create` | Create a new listing | write |
95
+ | `items_update` | Update a listing | write |
96
+ | `items_publish` | Publish a draft listing | write |
97
+ | `items_cancel` | Cancel a listing | write |
98
+
99
+ ### Market Analysis (5 tools)
100
+
101
+ | Tool | Description | Type |
102
+ |------|-------------|------|
103
+ | `market_price_range` | Price range by chip/memory | read |
104
+ | `market_recent_sales` | Recent completed sales data | read |
105
+ | `market_price_suggest` | AI-suggested market price | read |
106
+ | `market_retail_compare` | Compare with retail prices | read |
107
+ | `market_demand_score` | Demand score (0-100) | read |
108
+
109
+ ### Checkout (3 tools)
110
+
111
+ | Tool | Description | Type |
112
+ |------|-------------|------|
113
+ | `checkout_create` | Generate Stripe Checkout URL | write |
114
+ | `payment_status` | Check payment status | read |
115
+ | `payment_refund` | Request a refund | write |
116
+
117
+ ### Transactions (3 tools)
118
+
119
+ | Tool | Description | Type |
120
+ |------|-------------|------|
121
+ | `transactions_list` | List transactions | read |
122
+ | `transactions_get` | Get transaction details | read |
123
+ | `transactions_ship` | Register shipment | write |
124
+
125
+ ### Messages (2 tools)
126
+
127
+ | Tool | Description | Type |
128
+ |------|-------------|------|
129
+ | `messages_list` | List messages in a transaction | read |
130
+ | `messages_send` | Send a message | write |
131
+
132
+ ### Users (3 tools)
133
+
134
+ | Tool | Description | Type |
135
+ |------|-------------|------|
136
+ | `users_me` | Get your profile + stats | read |
137
+ | `users_get` | Get another user's info | read |
138
+ | `users_update_profile` | Update your profile | write |
139
+
140
+ ### Social (3 tools)
141
+
142
+ | Tool | Description | Type |
143
+ |------|-------------|------|
144
+ | `social_like` | Toggle like on an item | write |
145
+ | `social_comment` | Post a comment | write |
146
+ | `social_follow` | Toggle follow on a user | write |
147
+
148
+ ### Reviews (2 tools)
149
+
150
+ | Tool | Description | Type |
151
+ |------|-------------|------|
152
+ | `reviews_list` | List reviews for a user | read |
153
+ | `reviews_post` | Post a review | write |
154
+
155
+ ### Watch Alerts (5 tools)
156
+
157
+ | Tool | Description | Type |
158
+ |------|-------------|------|
159
+ | `watch_create` | Create a watch alert (chip, memory, price range) | write |
160
+ | `watch_list` | List your watch alerts | read |
161
+ | `watch_delete` | Delete a watch alert | write |
162
+ | `watch_check` | Run all watch condition checks | write |
163
+ | `watch_matches` | Get watch match history | read |
164
+
165
+ ### Inspections (2 tools)
166
+
167
+ | Tool | Description | Type |
168
+ |------|-------------|------|
169
+ | `inspect_submit` | Submit hardware inspection data | write |
170
+ | `inspect_get` | Get inspection data for an item | read |
171
+
172
+ ### Notifications (3 tools)
173
+
174
+ | Tool | Description | Type |
175
+ |------|-------------|------|
176
+ | `notifications_broadcast` | Broadcast to watch users on new listing | write |
177
+ | `notifications_list` | List your notifications | read |
178
+ | `notifications_read` | Mark notification as read | write |
179
+
180
+ ### Agent (1 tool)
181
+
182
+ | Tool | Description | Type |
183
+ |------|-------------|------|
184
+ | `agent_upgrade_plan` | AI upgrade simulation (trade-in value + recommendation) | read |
185
+
186
+ ### Stripe Connect (2 tools)
187
+
188
+ | Tool | Description | Type |
189
+ |------|-------------|------|
190
+ | `connect_status` | Check Stripe Connect onboarding status | read |
191
+ | `connect_balance` | Check Connect balance | read |
192
+
193
+ ### Specs (3 tools)
194
+
195
+ | Tool | Description | Type |
196
+ |------|-------------|------|
197
+ | `specs_chip_list` | List Apple Silicon chips | read |
198
+ | `specs_chip_detail` | Get chip configurations (memory, storage options) | read |
199
+ | `specs_device_models` | Get device model cascade | read |
200
+
201
+ ### Stats (1 tool)
202
+
203
+ | Tool | Description | Type |
204
+ |------|-------------|------|
205
+ | `stats_dashboard` | Platform dashboard statistics | read |
206
+
207
+ ### Health (1 tool)
208
+
209
+ | Tool | Description | Type |
210
+ |------|-------------|------|
211
+ | `health` | Health check (no auth required) | read |
212
+
213
+ ## Use Cases
214
+
215
+ ### 1. Market Research
216
+
217
+ ```javascript
218
+ // Check market prices for M4 Pro Mac Mini
219
+ market_price_range({ chip: "M4 Pro", memory: 48 })
220
+ market_demand_score({ chip: "M4 Pro", device_type: "mac_mini" })
221
+ market_recent_sales({ chip: "M4 Pro", limit: 10 })
222
+ ```
223
+
224
+ ### 2. Smart Listing
225
+
226
+ ```javascript
227
+ // Get price suggestion and create listing
228
+ const suggestion = market_price_suggest({ chip: "M2 Ultra", memory: 192 })
229
+ items_create({
230
+ title: "Mac Studio M2 Ultra 192GB",
231
+ price: suggestion.suggested_price,
232
+ chip: "M2 Ultra",
233
+ memory: 192,
234
+ storage: 2000
235
+ })
236
+ ```
237
+
238
+ ### 3. Watch Alerts
239
+
240
+ ```javascript
241
+ // Set up alert for M4 Pro under 200,000 yen
242
+ watch_create({
243
+ chip: "M4 Pro",
244
+ max_price: 200000,
245
+ device_type: "mac_mini"
246
+ })
247
+ // Check for matches
248
+ watch_check({})
249
+ ```
250
+
251
+ ## Error Handling
252
+
253
+ | Code | Description |
254
+ |------|-------------|
255
+ | `401` | Invalid API key |
256
+ | `403` | Permission denied |
257
+ | `404` | Resource not found |
258
+ | `422` | Validation error |
259
+ | `429` | Rate limit exceeded |
260
+
261
+ ## Support
262
+
263
+ - **Website:** [https://macclaw.jp](https://macclaw.jp)
264
+ - **Agent Docs:** [https://macclaw.jp/agent/](https://macclaw.jp/agent/)
265
+
266
+ ## License
267
+
268
+ MIT License - Copyright (c) 2026 ASI Productions
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Mac Claw REST API Client
3
+ * AI Mac Marketplace
4
+ */
5
+
6
+ export class MacClawApiClient {
7
+ constructor(apiKey, baseUrl = 'https://macclaw.jp') {
8
+ this.apiKey = apiKey;
9
+ this.baseUrl = baseUrl.replace(/\/$/, '');
10
+ }
11
+
12
+ async request(action, params = {}) {
13
+ const url = `${this.baseUrl}/api/mcp.php`;
14
+ const response = await fetch(url, {
15
+ method: 'POST',
16
+ headers: {
17
+ 'Authorization': `Bearer ${this.apiKey}`,
18
+ 'Content-Type': 'application/json',
19
+ },
20
+ body: JSON.stringify({ action, params }),
21
+ });
22
+
23
+ const json = await response.json();
24
+ if (!response.ok || !json.success) {
25
+ throw new Error(json.message || `API error: ${response.status}`);
26
+ }
27
+ return json.data;
28
+ }
29
+
30
+ // ==========================================
31
+ // 商品 (7)
32
+ // ==========================================
33
+
34
+ async itemsList(params) { return this.request('items.list', params); }
35
+ async itemsGet(id) { return this.request('items.get', { id }); }
36
+ async itemsSearch(query, params = {}) { return this.request('items.search', { query, ...params }); }
37
+ async itemsCreate(data) { return this.request('items.create', data); }
38
+ async itemsUpdate(id, data) { return this.request('items.update', { id, ...data }); }
39
+ async itemsPublish(id) { return this.request('items.publish', { id }); }
40
+ async itemsCancel(id) { return this.request('items.cancel', { id }); }
41
+
42
+ // ==========================================
43
+ // 相場 (5)
44
+ // ==========================================
45
+
46
+ async marketPriceRange(params = {}) { return this.request('market.price_range', params); }
47
+ async marketRecentSales(params = {}) { return this.request('market.recent_sales', params); }
48
+ async marketPriceSuggest(params) { return this.request('market.price_suggest', params); }
49
+ async marketRetailCompare(params) { return this.request('market.retail_compare', params); }
50
+ async marketDemandScore(itemId) { return this.request('market.demand_score', { item_id: itemId }); }
51
+
52
+ // ==========================================
53
+ // 決済 (1)
54
+ // ==========================================
55
+
56
+ async checkoutCreate(itemId) { return this.request('checkout.create', { item_id: itemId }); }
57
+
58
+ // ==========================================
59
+ // 取引 (3)
60
+ // ==========================================
61
+
62
+ async transactionsList(params = {}) { return this.request('transactions.list', params); }
63
+ async transactionsGet(id) { return this.request('transactions.get', { id }); }
64
+ async transactionsShip(id, trackingNumber) { return this.request('transactions.ship', { id, tracking_number: trackingNumber }); }
65
+
66
+ // ==========================================
67
+ // メッセージ (2)
68
+ // ==========================================
69
+
70
+ async messagesList(transactionId) { return this.request('messages.list', { transaction_id: transactionId }); }
71
+ async messagesSend(transactionId, body) { return this.request('messages.send', { transaction_id: transactionId, body }); }
72
+
73
+ // ==========================================
74
+ // ユーザー (3)
75
+ // ==========================================
76
+
77
+ async usersMe() { return this.request('users.me'); }
78
+ async usersGet(id) { return this.request('users.get', { id }); }
79
+ async usersUpdateProfile(data) { return this.request('users.update_profile', data); }
80
+
81
+ // ==========================================
82
+ // ソーシャル (3)
83
+ // ==========================================
84
+
85
+ async socialLike(itemId) { return this.request('social.like', { item_id: itemId }); }
86
+ async socialComment(itemId, body) { return this.request('social.comment', { item_id: itemId, body }); }
87
+ async socialFollow(userId) { return this.request('social.follow', { user_id: userId }); }
88
+
89
+ // ==========================================
90
+ // レビュー (2)
91
+ // ==========================================
92
+
93
+ async reviewsList(params = {}) { return this.request('reviews.list', params); }
94
+ async reviewsPost(transactionId, rating, comment) { return this.request('reviews.post', { transaction_id: transactionId, rating, comment }); }
95
+
96
+ // ==========================================
97
+ // ウォッチ (5)
98
+ // ==========================================
99
+
100
+ async watchCreate(data) { return this.request('watch.create', data); }
101
+ async watchList() { return this.request('watch.list'); }
102
+ async watchDelete(id) { return this.request('watch.delete', { id }); }
103
+ async watchCheck() { return this.request('watch.check'); }
104
+ async watchMatches(params = {}) { return this.request('watch.matches', params); }
105
+
106
+ // ==========================================
107
+ // 検品 (2)
108
+ // ==========================================
109
+
110
+ async inspectSubmit(data) { return this.request('inspect.submit', data); }
111
+ async inspectGet(itemId) { return this.request('inspect.get', { item_id: itemId }); }
112
+
113
+ // ==========================================
114
+ // 通知 (3)
115
+ // ==========================================
116
+
117
+ async notificationsBroadcast(itemId) { return this.request('notifications.broadcast', { item_id: itemId }); }
118
+ async notificationsList(params = {}) { return this.request('notifications.list', params); }
119
+ async notificationsRead(params = {}) { return this.request('notifications.read', params); }
120
+
121
+ // ==========================================
122
+ // エージェント (1)
123
+ // ==========================================
124
+
125
+ async agentUpgradePlan(params) { return this.request('agent.upgrade_plan', params); }
126
+
127
+ // ==========================================
128
+ // 決済追加 (2)
129
+ // ==========================================
130
+
131
+ async paymentStatus(transactionId) { return this.request('payment.status', { transaction_id: transactionId }); }
132
+ async paymentRefund(transactionId, reason) { return this.request('payment.refund', { transaction_id: transactionId, reason }); }
133
+
134
+ // ==========================================
135
+ // Connect (2)
136
+ // ==========================================
137
+
138
+ async connectStatus() { return this.request('connect.status'); }
139
+ async connectBalance() { return this.request('connect.balance'); }
140
+
141
+ // ==========================================
142
+ // スペック (3)
143
+ // ==========================================
144
+
145
+ async specsChipList() { return this.request('specs.chip_list'); }
146
+ async specsChipDetail(chip) { return this.request('specs.chip_detail', { chip }); }
147
+ async specsDeviceModels() { return this.request('specs.device_models'); }
148
+
149
+ // ==========================================
150
+ // 統計 (1)
151
+ // ==========================================
152
+
153
+ async statsDashboard() { return this.request('stats.dashboard'); }
154
+
155
+ // ==========================================
156
+ // ヘルス (認証不要)
157
+ // ==========================================
158
+
159
+ async health() {
160
+ const url = `${this.baseUrl}/api/mcp.php`;
161
+ const response = await fetch(url, {
162
+ method: 'POST',
163
+ headers: { 'Content-Type': 'application/json' },
164
+ body: JSON.stringify({ action: 'health' }),
165
+ });
166
+ return response.json();
167
+ }
168
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@mac-claw/mcp",
3
+ "version": "1.1.0",
4
+ "description": "MCP Server for Mac Claw - AI Mac Marketplace. 47 tools for items, market analysis, checkout, watches, inspections, notifications, and more.",
5
+ "main": "server.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "macclaw-mcp": "server.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node server.js",
12
+ "start:http": "MACCLAW_TRANSPORT=http node server.js"
13
+ },
14
+ "keywords": ["mcp", "macclaw", "mac", "marketplace", "ai", "claude-code"],
15
+ "files": ["server.js", "lib/**/*.js", "README.md"],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/asi-productions/mothership"
19
+ },
20
+ "homepage": "https://macclaw.jp/agent/",
21
+ "bugs": {
22
+ "url": "https://github.com/asi-productions/mothership/issues"
23
+ },
24
+ "author": "ASI Productions",
25
+ "license": "MIT",
26
+ "engines": {
27
+ "node": ">=18.0.0"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "dependencies": {
33
+ "@modelcontextprotocol/sdk": "^1.0.0"
34
+ }
35
+ }