@astralkit/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/LICENSE +7 -0
- package/bin/index.js +3 -0
- package/dist/api.d.ts +57 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +112 -0
- package/dist/api.js.map +1 -0
- package/dist/auth.d.ts +11 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +53 -0
- package/dist/auth.js.map +1 -0
- package/dist/data/rules.d.ts +2 -0
- package/dist/data/rules.d.ts.map +1 -0
- package/dist/data/rules.js +70 -0
- package/dist/data/rules.js.map +1 -0
- package/dist/data/tokens.d.ts +2 -0
- package/dist/data/tokens.d.ts.map +1 -0
- package/dist/data/tokens.js +80 -0
- package/dist/data/tokens.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +514 -0
- package/dist/server.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2024-present Blue Beacon Creative LLC. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software is proprietary and confidential. Unauthorized copying, modification,
|
|
4
|
+
distribution, or use of this software, via any medium, is strictly prohibited.
|
|
5
|
+
|
|
6
|
+
This software is licensed, not sold. You may use it only under the terms of a valid
|
|
7
|
+
AstralKit subscription agreement. See https://astralkit.com/terms for details.
|
package/bin/index.js
ADDED
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare function configure(key: string | null, baseUrl?: string): void;
|
|
2
|
+
export declare class ApiError extends Error {
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly code: string;
|
|
5
|
+
constructor(message: string, status: number, code: string);
|
|
6
|
+
}
|
|
7
|
+
export interface WhoamiResponse {
|
|
8
|
+
email: string;
|
|
9
|
+
plan: string;
|
|
10
|
+
valid: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ComponentListItem {
|
|
13
|
+
slug: string;
|
|
14
|
+
name: string;
|
|
15
|
+
short_description: string;
|
|
16
|
+
is_pro: boolean;
|
|
17
|
+
supported_frameworks: string[];
|
|
18
|
+
version: string;
|
|
19
|
+
category: string;
|
|
20
|
+
category_slug: string;
|
|
21
|
+
has_code: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ComponentListResponse {
|
|
24
|
+
components: ComponentListItem[];
|
|
25
|
+
pagination: {
|
|
26
|
+
total: number;
|
|
27
|
+
limit: number;
|
|
28
|
+
offset: number;
|
|
29
|
+
hasMore: boolean;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface ComponentFile {
|
|
33
|
+
path: string;
|
|
34
|
+
content: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ComponentDetailResponse {
|
|
37
|
+
name: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
files: ComponentFile[];
|
|
40
|
+
dependencies: string[];
|
|
41
|
+
license: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function whoami(): Promise<WhoamiResponse>;
|
|
44
|
+
export declare function listComponents(params?: {
|
|
45
|
+
category?: string;
|
|
46
|
+
framework?: string;
|
|
47
|
+
search?: string;
|
|
48
|
+
limit?: number;
|
|
49
|
+
offset?: number;
|
|
50
|
+
}): Promise<ComponentListResponse>;
|
|
51
|
+
export declare function getComponent(slug: string, framework?: string): Promise<ComponentDetailResponse>;
|
|
52
|
+
export declare function listBoosters(params?: {
|
|
53
|
+
framework?: string;
|
|
54
|
+
search?: string;
|
|
55
|
+
}): Promise<any>;
|
|
56
|
+
export declare function getBooster(slug: string, framework?: string): Promise<any>;
|
|
57
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAMA,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,CA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EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAQtC;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAAgB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAE9G;AAED,wBAAsB,YAAY,CAAC,MAAM,GAAE;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,GAAG,CAAC,CAKpB;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,CAEzF"}
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const DEFAULT_API_BASE = 'https://astralkit.com';
|
|
2
|
+
const REQUEST_TIMEOUT_MS = 30_000;
|
|
3
|
+
let apiKey = null;
|
|
4
|
+
let apiBase = DEFAULT_API_BASE;
|
|
5
|
+
export function configure(key, baseUrl) {
|
|
6
|
+
apiKey = key;
|
|
7
|
+
if (baseUrl) {
|
|
8
|
+
try {
|
|
9
|
+
const parsed = new URL(baseUrl);
|
|
10
|
+
const isLocalhost = parsed.hostname === 'localhost' ||
|
|
11
|
+
parsed.hostname === '127.0.0.1' ||
|
|
12
|
+
parsed.hostname === '::1';
|
|
13
|
+
if (parsed.protocol !== 'https:' && !(parsed.protocol === 'http:' && isLocalhost)) {
|
|
14
|
+
console.error('[astralkit-mcp] ASTRALKIT_API_URL must use https://. Falling back to default.');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
apiBase = baseUrl.replace(/\/+$/, '');
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
console.error('[astralkit-mcp] Invalid ASTRALKIT_API_URL. Falling back to default.');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class ApiError extends Error {
|
|
25
|
+
status;
|
|
26
|
+
code;
|
|
27
|
+
constructor(message, status, code) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.status = status;
|
|
30
|
+
this.code = code;
|
|
31
|
+
this.name = 'ApiError';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function request(path) {
|
|
35
|
+
const url = `${apiBase}${path}`;
|
|
36
|
+
const headers = {
|
|
37
|
+
'Accept': 'application/json',
|
|
38
|
+
'User-Agent': '@astralkit/mcp/1.0.0',
|
|
39
|
+
'X-AstralKit-CLI': 'mcp-1.0.0',
|
|
40
|
+
};
|
|
41
|
+
if (apiKey) {
|
|
42
|
+
headers['x-api-key'] = apiKey;
|
|
43
|
+
}
|
|
44
|
+
const controller = new AbortController();
|
|
45
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
46
|
+
let response;
|
|
47
|
+
try {
|
|
48
|
+
response = await fetch(url, { headers, signal: controller.signal });
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
clearTimeout(timeout);
|
|
52
|
+
if (err.name === 'AbortError') {
|
|
53
|
+
throw new ApiError('Request timed out. Check your connection.', 0, 'TIMEOUT');
|
|
54
|
+
}
|
|
55
|
+
throw new ApiError('Could not reach astralkit.com. Check your internet connection.', 0, 'NETWORK_ERROR');
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
clearTimeout(timeout);
|
|
59
|
+
}
|
|
60
|
+
if (response.status === 401) {
|
|
61
|
+
throw new ApiError('Authentication required. Set ASTRALKIT_API_KEY environment variable.', 401, 'AUTH_REQUIRED');
|
|
62
|
+
}
|
|
63
|
+
if (response.status === 403) {
|
|
64
|
+
throw new ApiError('Pro subscription required. Upgrade at https://astralkit.com/pricing', 403, 'PRO_REQUIRED');
|
|
65
|
+
}
|
|
66
|
+
if (!response.ok) {
|
|
67
|
+
const body = await response.text().catch(() => '');
|
|
68
|
+
const stripped = body.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '').slice(0, 500);
|
|
69
|
+
let safeMessage;
|
|
70
|
+
try {
|
|
71
|
+
const parsed = JSON.parse(stripped);
|
|
72
|
+
safeMessage = typeof parsed.error === 'string' ? parsed.error : `API error (HTTP ${response.status})`;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
safeMessage = `API error (HTTP ${response.status})`;
|
|
76
|
+
}
|
|
77
|
+
throw new ApiError(safeMessage, response.status, 'API_ERROR');
|
|
78
|
+
}
|
|
79
|
+
return response.json();
|
|
80
|
+
}
|
|
81
|
+
export async function whoami() {
|
|
82
|
+
return request('/api/cli/whoami');
|
|
83
|
+
}
|
|
84
|
+
export async function listComponents(params = {}) {
|
|
85
|
+
const qs = new URLSearchParams();
|
|
86
|
+
if (params.category)
|
|
87
|
+
qs.set('category', params.category);
|
|
88
|
+
if (params.framework)
|
|
89
|
+
qs.set('framework', params.framework);
|
|
90
|
+
if (params.search)
|
|
91
|
+
qs.set('search', params.search);
|
|
92
|
+
if (params.limit)
|
|
93
|
+
qs.set('limit', String(params.limit));
|
|
94
|
+
if (params.offset)
|
|
95
|
+
qs.set('offset', String(params.offset));
|
|
96
|
+
return request(`/api/cli/components?${qs}`);
|
|
97
|
+
}
|
|
98
|
+
export async function getComponent(slug, framework = 'react') {
|
|
99
|
+
return request(`/api/cli/components/${encodeURIComponent(slug)}?framework=${encodeURIComponent(framework)}`);
|
|
100
|
+
}
|
|
101
|
+
export async function listBoosters(params = {}) {
|
|
102
|
+
const qs = new URLSearchParams();
|
|
103
|
+
if (params.framework)
|
|
104
|
+
qs.set('framework', params.framework);
|
|
105
|
+
if (params.search)
|
|
106
|
+
qs.set('search', params.search);
|
|
107
|
+
return request(`/api/cli/boosters?${qs}`);
|
|
108
|
+
}
|
|
109
|
+
export async function getBooster(slug, framework = 'nextjs') {
|
|
110
|
+
return request(`/api/cli/boosters/${encodeURIComponent(slug)}?framework=${encodeURIComponent(framework)}`);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,IAAI,MAAM,GAAkB,IAAI,CAAC;AACjC,IAAI,OAAO,GAAW,gBAAgB,CAAC;AAEvC,MAAM,UAAU,SAAS,CAAC,GAAkB,EAAE,OAAgB;IAC5D,MAAM,GAAG,GAAG,CAAC;IACb,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;YAChC,MAAM,WAAW,GACf,MAAM,CAAC,QAAQ,KAAK,WAAW;gBAC/B,MAAM,CAAC,QAAQ,KAAK,WAAW;gBAC/B,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC;YAC5B,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,WAAW,CAAC,EAAE,CAAC;gBAClF,OAAO,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;gBAC/F,OAAO;YACT,CAAC;YACD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,OAAO,QAAS,SAAQ,KAAK;IAGf;IACA;IAHlB,YACE,OAAe,EACC,MAAc,EACd,IAAY;QAE5B,KAAK,CAAC,OAAO,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AAC,IAAI,CAAC,cAAc,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC7G,CAAC"}
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AuthResult {
|
|
2
|
+
email: string;
|
|
3
|
+
tier: string;
|
|
4
|
+
valid: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function validatePremiumAccess(apiKey: string | null): Promise<AuthResult>;
|
|
7
|
+
export declare function canAccessBoosters(tier: string): boolean;
|
|
8
|
+
export declare class AuthError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,CAwDtF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,qBAAa,SAAU,SAAQ,KAAK;gBACtB,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { whoami, ApiError } from './api.js';
|
|
2
|
+
const PRO_TIERS = ['pro', 'plus', 'lifetime'];
|
|
3
|
+
export async function validatePremiumAccess(apiKey) {
|
|
4
|
+
if (!apiKey) {
|
|
5
|
+
throw new AuthError('No API key provided. Set the ASTRALKIT_API_KEY environment variable.\n' +
|
|
6
|
+
'Get your API key at https://astralkit.com/settings\n\n' +
|
|
7
|
+
'AstralKit MCP requires a Pro or higher subscription.\n' +
|
|
8
|
+
'Upgrade at https://astralkit.com/pricing');
|
|
9
|
+
}
|
|
10
|
+
if (!apiKey.startsWith('ak_') || apiKey.length < 10) {
|
|
11
|
+
throw new AuthError(`Invalid API key format. Keys start with "ak_" and are at least 10 characters.\n` +
|
|
12
|
+
'Get your API key at https://astralkit.com/settings');
|
|
13
|
+
}
|
|
14
|
+
let result;
|
|
15
|
+
try {
|
|
16
|
+
result = await whoami();
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
if (err instanceof ApiError) {
|
|
20
|
+
if (err.code === 'AUTH_REQUIRED') {
|
|
21
|
+
throw new AuthError('Invalid or expired API key. Get a new one at https://astralkit.com/settings');
|
|
22
|
+
}
|
|
23
|
+
if (err.code === 'NETWORK_ERROR' || err.code === 'TIMEOUT') {
|
|
24
|
+
throw new AuthError(`Could not validate API key: ${err.message}\n` +
|
|
25
|
+
'Check your internet connection and try again.');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
if (!result.valid) {
|
|
31
|
+
throw new AuthError('API key is no longer valid. Generate a new one at https://astralkit.com/settings');
|
|
32
|
+
}
|
|
33
|
+
if (!PRO_TIERS.includes(result.plan)) {
|
|
34
|
+
throw new AuthError(`AstralKit MCP requires a Pro or higher subscription.\n` +
|
|
35
|
+
`Your current plan: ${result.plan}\n\n` +
|
|
36
|
+
'Upgrade at https://astralkit.com/pricing');
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
email: result.email,
|
|
40
|
+
tier: result.plan,
|
|
41
|
+
valid: true,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function canAccessBoosters(tier) {
|
|
45
|
+
return tier === 'plus' || tier === 'lifetime';
|
|
46
|
+
}
|
|
47
|
+
export class AuthError extends Error {
|
|
48
|
+
constructor(message) {
|
|
49
|
+
super(message);
|
|
50
|
+
this.name = 'AuthError';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=auth.js.map
|
package/d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,CACnF,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CACjB,wDAAwD;YACxD,sBAAsB,MAAM,CAAC,IAAI,MAAM;YACvC,0CAA0C,CAC3C,CAAC;IACJ,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,UAAU,CAAC;AAChD,CAAC;AAED,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const CODING_STANDARDS = "# AstralKit Coding Standards\n\n## Setup\n- Package: `astralkit` (npm)\n- CSS: `@import \"astralkit/theme\"; @import \"astralkit/utilities\";` (after Tailwind imports)\n- Tailwind v3 plugin: `require('astralkit/tailwind.cjs')` in tailwind.config\n- Tailwind v4: `@import \"astralkit/theme-v4\"; @import \"astralkit/utilities\";`\n- Icons: `@phosphor-icons/react` exclusively. Never Lucide, Heroicons, or inline SVGs.\n- Fonts: DM Sans (body), DM Serif Display (display), JetBrains Mono (code)\n\n## Token-First Rule\nALWAYS use `ak-*` tokens. NEVER use arbitrary bracket values.\n```tsx\n// CORRECT\n<div className=\"p-ak-3 gap-ak-2 text-ak-base rounded-ak-lg\">\n// WRONG \u2014 arbitrary values silently collapse in Tailwind v4\n<div className=\"p-[1.5rem] gap-[1rem] text-[16px] rounded-[0.75rem]\">\n```\n\n## Semantic Colors \u2014 No Raw Tailwind\n```tsx\n// CORRECT: bg-ak-surface, text-ak-text, border-ak-border, bg-ak-primary\n// WRONG: bg-gray-50, text-gray-900, border-gray-200, bg-blue-600\n```\n\n## Typography \u2014 16px Floor\n- Body text, descriptions, nav items, table cells: `text-ak-base` (16px) minimum\n- UI text: `font-medium` minimum \u2014 `font-normal` is for long-form prose only\n- Labels/badges: `text-ak-sm` (14px) or `text-ak-xs` (12px uppercase) acceptable\n- Helper/error text: `text-ak-sm` (14px) is the only exception\n\n## Spacing \u2014 ak-* Tokens Only\n```tsx\n// CORRECT: p-ak-3, gap-ak-2, mb-ak-1_5\n// WRONG: p-6, gap-4, mb-3\n```\n\n## Icons \u2014 Phosphor Only\n```tsx\nimport { House, Gear } from '@phosphor-icons/react'\n<House size={20} aria-hidden=\"true\" />\n```\n\n## No Inline Styles\nUse Tailwind classes. `style={{}}` only for CSS variables with no Tailwind equivalent.\n\n## No Shadows on Panels/Dropdowns \u2014 Borders Only\nUse `border border-ak-border`. Reserve shadows for modals and elevated cards.\n\n## No Framer Motion \u2014 CSS Animations or Lenis\nLicensing issue. Use CSS animations with `duration-ak-base`, `ease-ak-default`.\n\n## Touch Targets \u2014 48px Minimum\n- Buttons: `min-h-[3rem]` + `cursor-pointer`\n- Form inputs: `h-14` (56px)\n\n## Empty States \u2014 Every Data Container\nEvery list, table, or feed must handle: Loading \u2192 Error \u2192 Empty \u2192 Data.\nEmpty states need: icon, title, description, CTA.\n\n## Error Handling \u2014 Never Show Raw Errors\nUser-facing errors need: title (jargon-free), description, action (Retry/Go Back).\n\n## cn() Utility\n```tsx\nimport { cn } from '@/lib/utils'\n<div className={cn(\"p-ak-3\", isActive && \"bg-ak-primary\")}>\n```\n";
|
|
2
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/data/rules.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6gFAoE5B,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const CODING_STANDARDS = `# AstralKit Coding Standards
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
- Package: \`astralkit\` (npm)
|
|
5
|
+
- CSS: \`@import "astralkit/theme"; @import "astralkit/utilities";\` (after Tailwind imports)
|
|
6
|
+
- Tailwind v3 plugin: \`require('astralkit/tailwind.cjs')\` in tailwind.config
|
|
7
|
+
- Tailwind v4: \`@import "astralkit/theme-v4"; @import "astralkit/utilities";\`
|
|
8
|
+
- Icons: \`@phosphor-icons/react\` exclusively. Never Lucide, Heroicons, or inline SVGs.
|
|
9
|
+
- Fonts: DM Sans (body), DM Serif Display (display), JetBrains Mono (code)
|
|
10
|
+
|
|
11
|
+
## Token-First Rule
|
|
12
|
+
ALWAYS use \`ak-*\` tokens. NEVER use arbitrary bracket values.
|
|
13
|
+
\`\`\`tsx
|
|
14
|
+
// CORRECT
|
|
15
|
+
<div className="p-ak-3 gap-ak-2 text-ak-base rounded-ak-lg">
|
|
16
|
+
// WRONG — arbitrary values silently collapse in Tailwind v4
|
|
17
|
+
<div className="p-[1.5rem] gap-[1rem] text-[16px] rounded-[0.75rem]">
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
## Semantic Colors — No Raw Tailwind
|
|
21
|
+
\`\`\`tsx
|
|
22
|
+
// CORRECT: bg-ak-surface, text-ak-text, border-ak-border, bg-ak-primary
|
|
23
|
+
// WRONG: bg-gray-50, text-gray-900, border-gray-200, bg-blue-600
|
|
24
|
+
\`\`\`
|
|
25
|
+
|
|
26
|
+
## Typography — 16px Floor
|
|
27
|
+
- Body text, descriptions, nav items, table cells: \`text-ak-base\` (16px) minimum
|
|
28
|
+
- UI text: \`font-medium\` minimum — \`font-normal\` is for long-form prose only
|
|
29
|
+
- Labels/badges: \`text-ak-sm\` (14px) or \`text-ak-xs\` (12px uppercase) acceptable
|
|
30
|
+
- Helper/error text: \`text-ak-sm\` (14px) is the only exception
|
|
31
|
+
|
|
32
|
+
## Spacing — ak-* Tokens Only
|
|
33
|
+
\`\`\`tsx
|
|
34
|
+
// CORRECT: p-ak-3, gap-ak-2, mb-ak-1_5
|
|
35
|
+
// WRONG: p-6, gap-4, mb-3
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
## Icons — Phosphor Only
|
|
39
|
+
\`\`\`tsx
|
|
40
|
+
import { House, Gear } from '@phosphor-icons/react'
|
|
41
|
+
<House size={20} aria-hidden="true" />
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
## No Inline Styles
|
|
45
|
+
Use Tailwind classes. \`style={{}}\` only for CSS variables with no Tailwind equivalent.
|
|
46
|
+
|
|
47
|
+
## No Shadows on Panels/Dropdowns — Borders Only
|
|
48
|
+
Use \`border border-ak-border\`. Reserve shadows for modals and elevated cards.
|
|
49
|
+
|
|
50
|
+
## No Framer Motion — CSS Animations or Lenis
|
|
51
|
+
Licensing issue. Use CSS animations with \`duration-ak-base\`, \`ease-ak-default\`.
|
|
52
|
+
|
|
53
|
+
## Touch Targets — 48px Minimum
|
|
54
|
+
- Buttons: \`min-h-[3rem]\` + \`cursor-pointer\`
|
|
55
|
+
- Form inputs: \`h-14\` (56px)
|
|
56
|
+
|
|
57
|
+
## Empty States — Every Data Container
|
|
58
|
+
Every list, table, or feed must handle: Loading → Error → Empty → Data.
|
|
59
|
+
Empty states need: icon, title, description, CTA.
|
|
60
|
+
|
|
61
|
+
## Error Handling — Never Show Raw Errors
|
|
62
|
+
User-facing errors need: title (jargon-free), description, action (Retry/Go Back).
|
|
63
|
+
|
|
64
|
+
## cn() Utility
|
|
65
|
+
\`\`\`tsx
|
|
66
|
+
import { cn } from '@/lib/utils'
|
|
67
|
+
<div className={cn("p-ak-3", isActive && "bg-ak-primary")}>
|
|
68
|
+
\`\`\`
|
|
69
|
+
`;
|
|
70
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/data/rules.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoE/B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const DESIGN_TOKENS = "# AstralKit Design Token Reference\n\n## Surfaces\n- `bg-ak-bg` \u2014 page background\n- `bg-ak-surface` \u2014 card/panel background\n- `bg-ak-surface-2` \u2014 secondary surface (nested panels)\n- `bg-ak-hover` \u2014 hover state background\n- `bg-ak-elevated` \u2014 elevated surface (modals, popovers)\n\n## Text\n- `text-ak-text` \u2014 primary body text\n- `text-ak-text-secondary` \u2014 descriptions, supporting copy\n- `text-ak-text-muted` \u2014 timestamps, captions, tertiary info\n- `text-ak-text-disabled` \u2014 disabled controls\n- `text-ak-text-inverse` \u2014 text on dark/ink backgrounds\n- `text-ak-text-link` \u2014 inline hyperlinks\n- `text-ak-on-primary` \u2014 text on primary-colored backgrounds\n\n## Borders\n- `border-ak-border` \u2014 default border\n- `border-ak-border-subtle` \u2014 lighter border\n- `border-ak-border-strong` \u2014 emphasis border\n\n## Primary (buttons, CTAs)\n- `bg-ak-primary` \u2014 primary action background\n- `bg-ak-primary-hover` \u2014 primary hover state\n- `text-ak-on-primary` \u2014 text on primary background\n- `bg-ak-primary-subtle` \u2014 soft tint (badges, soft buttons)\n\n## Status Colors\n- `ak-success` / `ak-warning` / `ak-danger` / `ak-info`\n- Each has `-subtle` and `-text` variants\n\n## Spacing Scale\n- `ak-0_5` (4px) \u00B7 `ak-1` (8px) \u00B7 `ak-1_5` (12px) \u00B7 `ak-2` (16px)\n- `ak-2_5` (20px) \u00B7 `ak-3` (24px) \u00B7 `ak-4` (32px) \u00B7 `ak-5` (40px) \u00B7 `ak-6` (48px)\n\n## Typography Scale\n- `text-ak-xs` (12px) \u00B7 `text-ak-sm` (14px) \u00B7 `text-ak-base` (16px)\n- `text-ak-lg` (18px) \u00B7 `text-ak-xl` (20px) \u00B7 `text-ak-2xl` (24px)\n\n## Fluid Typography (headings)\n- `text-ak-fl-lg` \u00B7 `text-ak-fl-xl` \u00B7 `text-ak-fl-2xl` \u00B7 `text-ak-fl-3xl`\n- `text-ak-fl-4xl` \u00B7 `text-ak-fl-5xl`\n\n## Radii\n- `rounded-ak-sm` \u00B7 `rounded-ak-md` \u00B7 `rounded-ak-lg` \u00B7 `rounded-ak-xl` \u00B7 `rounded-ak-full`\n\n## Control Heights\n- `min-h-ak-control-sm` (32px) \u00B7 `min-h-ak-control-md` (40px)\n- `min-h-ak-control-lg` (48px) \u00B7 `min-h-ak-control-xl` (56px)\n\n## Layout\n- `max-w-ak-page` (80rem) \u2014 max page width\n- `h-ak-nav` \u2014 nav bar height\n- `px-ak-fl-page-margin` \u2014 fluid side padding (16px mobile \u2192 80px desktop)\n\n## Fonts\n- `font-ak-sans` \u2014 DM Sans (body)\n- `font-ak-serif` \u2014 DM Serif Display (display/headlines)\n- `font-ak-mono` \u2014 JetBrains Mono (code)\n\n## Common Patterns\n```tsx\n// Card\n<div className=\"border border-ak-border rounded-ak-lg p-ak-3 bg-ak-surface\">\n\n// Primary button\n<button className=\"bg-ak-primary text-ak-on-primary px-ak-2_5 py-ak-1_25 min-h-[3rem] rounded-ak-lg font-semibold cursor-pointer\">\n\n// Section\n<section className=\"py-ak-fl-xl-3xl bg-ak-bg\">\n <div className=\"max-w-ak-page mx-auto px-ak-3\">\n\n// Icon\nimport { House } from '@phosphor-icons/react'\n<House size={20} aria-hidden=\"true\" />\n```\n";
|
|
2
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/data/tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,i4FA8EzB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export const DESIGN_TOKENS = `# AstralKit Design Token Reference
|
|
2
|
+
|
|
3
|
+
## Surfaces
|
|
4
|
+
- \`bg-ak-bg\` — page background
|
|
5
|
+
- \`bg-ak-surface\` — card/panel background
|
|
6
|
+
- \`bg-ak-surface-2\` — secondary surface (nested panels)
|
|
7
|
+
- \`bg-ak-hover\` — hover state background
|
|
8
|
+
- \`bg-ak-elevated\` — elevated surface (modals, popovers)
|
|
9
|
+
|
|
10
|
+
## Text
|
|
11
|
+
- \`text-ak-text\` — primary body text
|
|
12
|
+
- \`text-ak-text-secondary\` — descriptions, supporting copy
|
|
13
|
+
- \`text-ak-text-muted\` — timestamps, captions, tertiary info
|
|
14
|
+
- \`text-ak-text-disabled\` — disabled controls
|
|
15
|
+
- \`text-ak-text-inverse\` — text on dark/ink backgrounds
|
|
16
|
+
- \`text-ak-text-link\` — inline hyperlinks
|
|
17
|
+
- \`text-ak-on-primary\` — text on primary-colored backgrounds
|
|
18
|
+
|
|
19
|
+
## Borders
|
|
20
|
+
- \`border-ak-border\` — default border
|
|
21
|
+
- \`border-ak-border-subtle\` — lighter border
|
|
22
|
+
- \`border-ak-border-strong\` — emphasis border
|
|
23
|
+
|
|
24
|
+
## Primary (buttons, CTAs)
|
|
25
|
+
- \`bg-ak-primary\` — primary action background
|
|
26
|
+
- \`bg-ak-primary-hover\` — primary hover state
|
|
27
|
+
- \`text-ak-on-primary\` — text on primary background
|
|
28
|
+
- \`bg-ak-primary-subtle\` — soft tint (badges, soft buttons)
|
|
29
|
+
|
|
30
|
+
## Status Colors
|
|
31
|
+
- \`ak-success\` / \`ak-warning\` / \`ak-danger\` / \`ak-info\`
|
|
32
|
+
- Each has \`-subtle\` and \`-text\` variants
|
|
33
|
+
|
|
34
|
+
## Spacing Scale
|
|
35
|
+
- \`ak-0_5\` (4px) · \`ak-1\` (8px) · \`ak-1_5\` (12px) · \`ak-2\` (16px)
|
|
36
|
+
- \`ak-2_5\` (20px) · \`ak-3\` (24px) · \`ak-4\` (32px) · \`ak-5\` (40px) · \`ak-6\` (48px)
|
|
37
|
+
|
|
38
|
+
## Typography Scale
|
|
39
|
+
- \`text-ak-xs\` (12px) · \`text-ak-sm\` (14px) · \`text-ak-base\` (16px)
|
|
40
|
+
- \`text-ak-lg\` (18px) · \`text-ak-xl\` (20px) · \`text-ak-2xl\` (24px)
|
|
41
|
+
|
|
42
|
+
## Fluid Typography (headings)
|
|
43
|
+
- \`text-ak-fl-lg\` · \`text-ak-fl-xl\` · \`text-ak-fl-2xl\` · \`text-ak-fl-3xl\`
|
|
44
|
+
- \`text-ak-fl-4xl\` · \`text-ak-fl-5xl\`
|
|
45
|
+
|
|
46
|
+
## Radii
|
|
47
|
+
- \`rounded-ak-sm\` · \`rounded-ak-md\` · \`rounded-ak-lg\` · \`rounded-ak-xl\` · \`rounded-ak-full\`
|
|
48
|
+
|
|
49
|
+
## Control Heights
|
|
50
|
+
- \`min-h-ak-control-sm\` (32px) · \`min-h-ak-control-md\` (40px)
|
|
51
|
+
- \`min-h-ak-control-lg\` (48px) · \`min-h-ak-control-xl\` (56px)
|
|
52
|
+
|
|
53
|
+
## Layout
|
|
54
|
+
- \`max-w-ak-page\` (80rem) — max page width
|
|
55
|
+
- \`h-ak-nav\` — nav bar height
|
|
56
|
+
- \`px-ak-fl-page-margin\` — fluid side padding (16px mobile → 80px desktop)
|
|
57
|
+
|
|
58
|
+
## Fonts
|
|
59
|
+
- \`font-ak-sans\` — DM Sans (body)
|
|
60
|
+
- \`font-ak-serif\` — DM Serif Display (display/headlines)
|
|
61
|
+
- \`font-ak-mono\` — JetBrains Mono (code)
|
|
62
|
+
|
|
63
|
+
## Common Patterns
|
|
64
|
+
\`\`\`tsx
|
|
65
|
+
// Card
|
|
66
|
+
<div className="border border-ak-border rounded-ak-lg p-ak-3 bg-ak-surface">
|
|
67
|
+
|
|
68
|
+
// Primary button
|
|
69
|
+
<button className="bg-ak-primary text-ak-on-primary px-ak-2_5 py-ak-1_25 min-h-[3rem] rounded-ak-lg font-semibold cursor-pointer">
|
|
70
|
+
|
|
71
|
+
// Section
|
|
72
|
+
<section className="py-ak-fl-xl-3xl bg-ak-bg">
|
|
73
|
+
<div className="max-w-ak-page mx-auto px-ak-3">
|
|
74
|
+
|
|
75
|
+
// Icon
|
|
76
|
+
import { House } from '@phosphor-icons/react'
|
|
77
|
+
<House size={20} aria-hidden="true" />
|
|
78
|
+
\`\`\`
|
|
79
|
+
`;
|
|
80
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/data/tokens.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E5B,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AA2iBA,wBAAsB,WAAW,kBA2BhC"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { configure, listComponents, getComponent, listBoosters, getBooster, ApiError } from './api.js';
|
|
5
|
+
import { validatePremiumAccess, canAccessBoosters, AuthError } from './auth.js';
|
|
6
|
+
import { DESIGN_TOKENS } from './data/tokens.js';
|
|
7
|
+
import { CODING_STANDARDS } from './data/rules.js';
|
|
8
|
+
const VERSION = '1.0.0';
|
|
9
|
+
// ─── Security: Input validation ───────────────────────────────────────────────
|
|
10
|
+
const MAX_QUERY_LENGTH = 200;
|
|
11
|
+
const MAX_SLUG_LENGTH = 100;
|
|
12
|
+
const MAX_CODE_LENGTH = 100_000;
|
|
13
|
+
const MAX_DESCRIPTION_LENGTH = 2_000;
|
|
14
|
+
const SLUG_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
|
|
15
|
+
function validateSlug(slug) {
|
|
16
|
+
if (slug.length > MAX_SLUG_LENGTH)
|
|
17
|
+
return 'Slug too long (max 100 characters).';
|
|
18
|
+
if (!SLUG_PATTERN.test(slug))
|
|
19
|
+
return 'Invalid slug format. Slugs contain only lowercase letters, numbers, and hyphens.';
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
// ─── Security: Periodic auth revalidation ─────────────────────────────────────
|
|
23
|
+
const REVALIDATION_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes
|
|
24
|
+
class AuthGuard {
|
|
25
|
+
lastCheck;
|
|
26
|
+
apiKey;
|
|
27
|
+
revoked = false;
|
|
28
|
+
constructor(apiKey) {
|
|
29
|
+
this.apiKey = apiKey;
|
|
30
|
+
this.lastCheck = Date.now();
|
|
31
|
+
}
|
|
32
|
+
async check() {
|
|
33
|
+
if (this.revoked) {
|
|
34
|
+
throw new AuthError('Your AstralKit subscription has been revoked or expired.\n' +
|
|
35
|
+
'Restart the MCP server after renewing at https://astralkit.com/pricing');
|
|
36
|
+
}
|
|
37
|
+
if (Date.now() - this.lastCheck < REVALIDATION_INTERVAL_MS)
|
|
38
|
+
return;
|
|
39
|
+
try {
|
|
40
|
+
await validatePremiumAccess(this.apiKey);
|
|
41
|
+
this.lastCheck = Date.now();
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (err instanceof AuthError) {
|
|
45
|
+
this.revoked = true;
|
|
46
|
+
console.error('[astralkit-mcp] Subscription revalidation failed — access revoked.');
|
|
47
|
+
}
|
|
48
|
+
// Network errors (ApiError with TIMEOUT/NETWORK_ERROR) are transient —
|
|
49
|
+
// don't permanently revoke; the next check will retry.
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// ─── Security: API key redaction ──────────────────────────────────────────────
|
|
55
|
+
function redactApiKey(text, apiKey) {
|
|
56
|
+
if (!apiKey || apiKey.length < 6)
|
|
57
|
+
return text;
|
|
58
|
+
return text.replaceAll(apiKey, 'ak_***REDACTED***');
|
|
59
|
+
}
|
|
60
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
61
|
+
function textResult(text) {
|
|
62
|
+
return { content: [{ type: 'text', text }] };
|
|
63
|
+
}
|
|
64
|
+
function jsonResult(data) {
|
|
65
|
+
return textResult(JSON.stringify(data, null, 2));
|
|
66
|
+
}
|
|
67
|
+
function errorResult(message) {
|
|
68
|
+
return { content: [{ type: 'text', text: message }], isError: true };
|
|
69
|
+
}
|
|
70
|
+
function createServer(auth, guard, apiKey) {
|
|
71
|
+
const server = new McpServer({ name: 'astralkit', version: VERSION }, { capabilities: { tools: {}, resources: {}, prompts: {} } });
|
|
72
|
+
// ─── Tools ───────────────────────────────────────────────────────────
|
|
73
|
+
server.registerTool('search_components', {
|
|
74
|
+
title: 'Search Components',
|
|
75
|
+
description: 'Search AstralKit components by name, description, or category. ' +
|
|
76
|
+
'Returns matching components with metadata.',
|
|
77
|
+
inputSchema: {
|
|
78
|
+
query: z.string().max(MAX_QUERY_LENGTH).describe('Search query (component name, description, or keyword)'),
|
|
79
|
+
category: z.string().max(MAX_SLUG_LENGTH).optional().describe('Filter by category slug'),
|
|
80
|
+
limit: z.number().optional().default(20).describe('Max results (default 20, max 100)'),
|
|
81
|
+
},
|
|
82
|
+
}, async ({ query, category, limit }) => {
|
|
83
|
+
try {
|
|
84
|
+
await guard.check();
|
|
85
|
+
const result = await listComponents({
|
|
86
|
+
search: query,
|
|
87
|
+
category: category ?? undefined,
|
|
88
|
+
limit: Math.min(limit ?? 20, 100),
|
|
89
|
+
});
|
|
90
|
+
return jsonResult({
|
|
91
|
+
count: result.components.length,
|
|
92
|
+
total: result.pagination.total,
|
|
93
|
+
components: result.components.map(c => ({
|
|
94
|
+
slug: c.slug,
|
|
95
|
+
name: c.name,
|
|
96
|
+
description: c.short_description,
|
|
97
|
+
category: c.category,
|
|
98
|
+
is_pro: c.is_pro,
|
|
99
|
+
frameworks: c.supported_frameworks,
|
|
100
|
+
})),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
if (err instanceof AuthError)
|
|
105
|
+
return errorResult(err.message);
|
|
106
|
+
return errorResult(`Search failed: ${err instanceof Error ? redactApiKey(err.message, apiKey) : 'Unknown error'}`);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
server.registerTool('list_components', {
|
|
110
|
+
title: 'List Components',
|
|
111
|
+
description: 'List all available AstralKit components. Optionally filter by category. ' +
|
|
112
|
+
'Use this to browse the full component catalog.',
|
|
113
|
+
inputSchema: {
|
|
114
|
+
category: z.string().max(MAX_SLUG_LENGTH).optional().describe('Filter by category slug (e.g. "buttons", "forms", "navigation")'),
|
|
115
|
+
limit: z.number().optional().default(50).describe('Max results (default 50, max 100)'),
|
|
116
|
+
offset: z.number().optional().default(0).describe('Pagination offset'),
|
|
117
|
+
},
|
|
118
|
+
}, async ({ category, limit, offset }) => {
|
|
119
|
+
try {
|
|
120
|
+
await guard.check();
|
|
121
|
+
const result = await listComponents({
|
|
122
|
+
category: category ?? undefined,
|
|
123
|
+
limit: Math.min(limit ?? 50, 100),
|
|
124
|
+
offset: offset ?? 0,
|
|
125
|
+
});
|
|
126
|
+
return jsonResult({
|
|
127
|
+
count: result.components.length,
|
|
128
|
+
total: result.pagination.total,
|
|
129
|
+
hasMore: result.pagination.hasMore,
|
|
130
|
+
components: result.components.map(c => ({
|
|
131
|
+
slug: c.slug,
|
|
132
|
+
name: c.name,
|
|
133
|
+
description: c.short_description,
|
|
134
|
+
category: c.category,
|
|
135
|
+
is_pro: c.is_pro,
|
|
136
|
+
frameworks: c.supported_frameworks,
|
|
137
|
+
})),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
if (err instanceof AuthError)
|
|
142
|
+
return errorResult(err.message);
|
|
143
|
+
return errorResult(`List failed: ${err instanceof Error ? redactApiKey(err.message, apiKey) : 'Unknown error'}`);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
server.registerTool('list_categories', {
|
|
147
|
+
title: 'List Categories',
|
|
148
|
+
description: 'List all available component categories. Use the returned category slugs ' +
|
|
149
|
+
'to filter list_components or search_components.',
|
|
150
|
+
inputSchema: {},
|
|
151
|
+
}, async () => {
|
|
152
|
+
try {
|
|
153
|
+
await guard.check();
|
|
154
|
+
const result = await listComponents({ limit: 100 });
|
|
155
|
+
const categories = new Map();
|
|
156
|
+
for (const c of result.components) {
|
|
157
|
+
const existing = categories.get(c.category_slug);
|
|
158
|
+
if (existing) {
|
|
159
|
+
existing.count++;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
categories.set(c.category_slug, { slug: c.category_slug, name: c.category, count: 1 });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return jsonResult({
|
|
166
|
+
categories: Array.from(categories.values()).sort((a, b) => a.name.localeCompare(b.name)),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
if (err instanceof AuthError)
|
|
171
|
+
return errorResult(err.message);
|
|
172
|
+
return errorResult(`Failed to list categories: ${err instanceof Error ? redactApiKey(err.message, apiKey) : 'Unknown error'}`);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
server.registerTool('get_component', {
|
|
176
|
+
title: 'Get Component',
|
|
177
|
+
description: 'Get the full source code, dependencies, and usage info for a specific AstralKit component. ' +
|
|
178
|
+
'Use search_components or list_components first to find the slug.',
|
|
179
|
+
inputSchema: {
|
|
180
|
+
slug: z.string().max(MAX_SLUG_LENGTH).describe('Component slug (e.g. "button-sizes", "data-table", "sidebar-analytics")'),
|
|
181
|
+
framework: z.enum(['react', 'nextjs', 'html']).optional().default('react')
|
|
182
|
+
.describe('Framework variant (default: react)'),
|
|
183
|
+
},
|
|
184
|
+
}, async ({ slug, framework }) => {
|
|
185
|
+
const slugErr = validateSlug(slug);
|
|
186
|
+
if (slugErr)
|
|
187
|
+
return errorResult(slugErr);
|
|
188
|
+
try {
|
|
189
|
+
await guard.check();
|
|
190
|
+
const result = await getComponent(slug, framework ?? 'react');
|
|
191
|
+
return jsonResult({
|
|
192
|
+
name: result.name,
|
|
193
|
+
slug: result.slug,
|
|
194
|
+
framework: framework ?? 'react',
|
|
195
|
+
files: result.files.map(f => ({ path: f.path, content: f.content })),
|
|
196
|
+
dependencies: result.dependencies,
|
|
197
|
+
install_command: `npx @astralkit/cli add ${result.slug}`,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
if (err instanceof AuthError)
|
|
202
|
+
return errorResult(err.message);
|
|
203
|
+
if (err instanceof ApiError && err.code === 'PRO_REQUIRED') {
|
|
204
|
+
return errorResult(`Component "${slug}" requires a Pro subscription for ${framework ?? 'react'} framework.\n` +
|
|
205
|
+
'Upgrade at https://astralkit.com/pricing');
|
|
206
|
+
}
|
|
207
|
+
return errorResult(`Failed to get component: ${err instanceof Error ? redactApiKey(err.message, apiKey) : 'Unknown error'}`);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
server.registerTool('get_design_tokens', {
|
|
211
|
+
title: 'Get Design Tokens',
|
|
212
|
+
description: 'Get the complete AstralKit design token reference — surfaces, text colors, borders, ' +
|
|
213
|
+
'spacing scale, typography scale, radii, control heights, fonts, and common patterns. ' +
|
|
214
|
+
'Use this when styling components to ensure correct token usage.',
|
|
215
|
+
inputSchema: {},
|
|
216
|
+
}, async () => {
|
|
217
|
+
try {
|
|
218
|
+
await guard.check();
|
|
219
|
+
}
|
|
220
|
+
catch (err) {
|
|
221
|
+
if (err instanceof AuthError)
|
|
222
|
+
return errorResult(err.message);
|
|
223
|
+
throw err;
|
|
224
|
+
}
|
|
225
|
+
return textResult(DESIGN_TOKENS);
|
|
226
|
+
});
|
|
227
|
+
server.registerTool('get_coding_standards', {
|
|
228
|
+
title: 'Get Coding Standards',
|
|
229
|
+
description: 'Get AstralKit coding standards — the mandatory rules for building with AstralKit. ' +
|
|
230
|
+
'Covers token usage, semantic colors, typography floor, spacing, icons, touch targets, ' +
|
|
231
|
+
'error handling, and empty states. Read this before writing any AstralKit code.',
|
|
232
|
+
inputSchema: {},
|
|
233
|
+
}, async () => {
|
|
234
|
+
try {
|
|
235
|
+
await guard.check();
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
if (err instanceof AuthError)
|
|
239
|
+
return errorResult(err.message);
|
|
240
|
+
throw err;
|
|
241
|
+
}
|
|
242
|
+
return textResult(CODING_STANDARDS);
|
|
243
|
+
});
|
|
244
|
+
server.registerTool('install_component', {
|
|
245
|
+
title: 'Install Component',
|
|
246
|
+
description: 'Get the CLI command to install an AstralKit component into the user\'s project. ' +
|
|
247
|
+
'Returns the command string — the AI tool should execute it or present it to the user.',
|
|
248
|
+
inputSchema: {
|
|
249
|
+
slug: z.string().max(MAX_SLUG_LENGTH).describe('Component slug to install'),
|
|
250
|
+
packageManager: z.enum(['npm', 'pnpm', 'yarn', 'bun']).optional().default('npm')
|
|
251
|
+
.describe('Package manager (default: npm)'),
|
|
252
|
+
},
|
|
253
|
+
}, async ({ slug, packageManager }) => {
|
|
254
|
+
const slugErr = validateSlug(slug);
|
|
255
|
+
if (slugErr)
|
|
256
|
+
return errorResult(slugErr);
|
|
257
|
+
try {
|
|
258
|
+
await guard.check();
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
if (err instanceof AuthError)
|
|
262
|
+
return errorResult(err.message);
|
|
263
|
+
throw err;
|
|
264
|
+
}
|
|
265
|
+
const pm = packageManager ?? 'npm';
|
|
266
|
+
const prefix = pm === 'npm' ? 'npx' : pm === 'pnpm' ? 'pnpm dlx' : pm === 'yarn' ? 'yarn dlx' : 'bunx';
|
|
267
|
+
const command = `${prefix} @astralkit/cli add ${slug}`;
|
|
268
|
+
return jsonResult({
|
|
269
|
+
slug,
|
|
270
|
+
command,
|
|
271
|
+
description: `Install the ${slug} component into your project. Run this in your project root.`,
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
server.registerTool('validate_code', {
|
|
275
|
+
title: 'Validate Code',
|
|
276
|
+
description: 'Check if code follows AstralKit conventions. Validates token usage, semantic colors, ' +
|
|
277
|
+
'spacing, typography, icons, inline styles, and touch targets. ' +
|
|
278
|
+
'Use this to audit component code before shipping.',
|
|
279
|
+
inputSchema: {
|
|
280
|
+
code: z.string().max(MAX_CODE_LENGTH).describe('The TSX/JSX/HTML code to validate'),
|
|
281
|
+
},
|
|
282
|
+
}, async ({ code }) => {
|
|
283
|
+
try {
|
|
284
|
+
await guard.check();
|
|
285
|
+
}
|
|
286
|
+
catch (err) {
|
|
287
|
+
if (err instanceof AuthError)
|
|
288
|
+
return errorResult(err.message);
|
|
289
|
+
throw err;
|
|
290
|
+
}
|
|
291
|
+
const issues = [];
|
|
292
|
+
const rawTailwindColors = code.match(/\b(bg|text|border)-(gray|slate|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-\d{2,3}\b/g);
|
|
293
|
+
if (rawTailwindColors) {
|
|
294
|
+
issues.push(`Raw Tailwind colors found: ${[...new Set(rawTailwindColors)].slice(0, 5).join(', ')}. ` +
|
|
295
|
+
'Use semantic AstralKit tokens instead (bg-ak-surface, text-ak-text, border-ak-border).');
|
|
296
|
+
}
|
|
297
|
+
const arbitraryValues = code.match(/\b(p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|gap|space-[xy]|w|h|text|rounded|leading)-\[[^\]]+\]/g);
|
|
298
|
+
if (arbitraryValues) {
|
|
299
|
+
const nonExempt = arbitraryValues.filter(v => !v.startsWith('min-h-[3rem]') && !v.startsWith('h-14'));
|
|
300
|
+
if (nonExempt.length > 0) {
|
|
301
|
+
issues.push(`Arbitrary bracket values found: ${nonExempt.slice(0, 5).join(', ')}. ` +
|
|
302
|
+
'Use ak-* tokens instead (p-ak-3, gap-ak-2, rounded-ak-lg). They have fluid clamp() built in.');
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
const rawSpacing = code.match(/\b(p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|gap|space-[xy])-(?!ak)\d+\b/g);
|
|
306
|
+
if (rawSpacing) {
|
|
307
|
+
issues.push(`Raw Tailwind spacing found: ${[...new Set(rawSpacing)].slice(0, 5).join(', ')}. ` +
|
|
308
|
+
'Use ak-* spacing tokens (p-ak-3, gap-ak-2, mb-ak-1_5).');
|
|
309
|
+
}
|
|
310
|
+
if (/style\s*=\s*\{\{/.test(code)) {
|
|
311
|
+
const styleBlocks = code.match(/style\s*=\s*\{\{[^}]*\}\}/g) || [];
|
|
312
|
+
const nonVarStyles = styleBlocks.filter(s => !s.includes('var(--'));
|
|
313
|
+
if (nonVarStyles.length > 0) {
|
|
314
|
+
issues.push('Inline style={{}} found. Use Tailwind classes. Inline styles are only acceptable for CSS variables.');
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (/from\s+['"]lucide-react['"]/.test(code) || /from\s+['"]@heroicons/.test(code)) {
|
|
318
|
+
issues.push('Non-Phosphor icons detected. AstralKit uses @phosphor-icons/react exclusively.');
|
|
319
|
+
}
|
|
320
|
+
if (/<svg[\s>]/.test(code) && !/<svg[^>]*aria-hidden/.test(code)) {
|
|
321
|
+
issues.push('Inline SVG found without aria-hidden. Use Phosphor Icons instead of inline SVGs.');
|
|
322
|
+
}
|
|
323
|
+
const hasButtons = /<button/.test(code) || /className="[^"]*btn/.test(code);
|
|
324
|
+
if (hasButtons && !code.includes('min-h-[3rem]') && !code.includes('min-h-ak-control')) {
|
|
325
|
+
issues.push('Buttons found without 48px minimum touch target. Add min-h-[3rem] to all buttons.');
|
|
326
|
+
}
|
|
327
|
+
if (hasButtons && !code.includes('cursor-pointer')) {
|
|
328
|
+
issues.push('Buttons found without cursor-pointer. Add cursor-pointer to all interactive buttons.');
|
|
329
|
+
}
|
|
330
|
+
if (/framer-motion/.test(code) || /from\s+['"]motion['"]/.test(code)) {
|
|
331
|
+
issues.push('Framer Motion detected. AstralKit uses CSS animations only (licensing issue).');
|
|
332
|
+
}
|
|
333
|
+
return jsonResult({
|
|
334
|
+
valid: issues.length === 0,
|
|
335
|
+
issueCount: issues.length,
|
|
336
|
+
issues,
|
|
337
|
+
summary: issues.length === 0
|
|
338
|
+
? 'Code follows AstralKit conventions.'
|
|
339
|
+
: `Found ${issues.length} issue${issues.length === 1 ? '' : 's'} to fix.`,
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
// Boosters (Plus/Lifetime only)
|
|
343
|
+
if (canAccessBoosters(auth.tier)) {
|
|
344
|
+
server.registerTool('list_boosters', {
|
|
345
|
+
title: 'List Boosters',
|
|
346
|
+
description: 'List available AstralKit boosters — pre-built functionality modules (auth, CRUD, cart, etc.). ' +
|
|
347
|
+
'Requires Plus or Lifetime subscription.',
|
|
348
|
+
inputSchema: {
|
|
349
|
+
search: z.string().max(MAX_QUERY_LENGTH).optional().describe('Search query'),
|
|
350
|
+
},
|
|
351
|
+
}, async ({ search }) => {
|
|
352
|
+
try {
|
|
353
|
+
await guard.check();
|
|
354
|
+
const result = await listBoosters({ search: search ?? undefined });
|
|
355
|
+
return jsonResult(result);
|
|
356
|
+
}
|
|
357
|
+
catch (err) {
|
|
358
|
+
if (err instanceof AuthError)
|
|
359
|
+
return errorResult(err.message);
|
|
360
|
+
return errorResult(`Failed to list boosters: ${err instanceof Error ? redactApiKey(err.message, apiKey) : 'Unknown error'}`);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
server.registerTool('get_booster', {
|
|
364
|
+
title: 'Get Booster',
|
|
365
|
+
description: 'Get booster code and integration guide. Requires Plus or Lifetime subscription.',
|
|
366
|
+
inputSchema: {
|
|
367
|
+
slug: z.string().max(MAX_SLUG_LENGTH).describe('Booster slug'),
|
|
368
|
+
framework: z.enum(['react', 'nextjs']).optional().default('nextjs')
|
|
369
|
+
.describe('Framework variant (default: nextjs)'),
|
|
370
|
+
},
|
|
371
|
+
}, async ({ slug, framework }) => {
|
|
372
|
+
const slugErr = validateSlug(slug);
|
|
373
|
+
if (slugErr)
|
|
374
|
+
return errorResult(slugErr);
|
|
375
|
+
try {
|
|
376
|
+
await guard.check();
|
|
377
|
+
const result = await getBooster(slug, framework ?? 'nextjs');
|
|
378
|
+
return jsonResult(result);
|
|
379
|
+
}
|
|
380
|
+
catch (err) {
|
|
381
|
+
if (err instanceof AuthError)
|
|
382
|
+
return errorResult(err.message);
|
|
383
|
+
return errorResult(`Failed to get booster: ${err instanceof Error ? redactApiKey(err.message, apiKey) : 'Unknown error'}`);
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
// ─── Resources ───────────────────────────────────────────────────────
|
|
388
|
+
server.registerResource('AstralKit Design Tokens', 'astralkit://tokens', { description: 'Complete design token reference — surfaces, text, borders, spacing, typography, radii, fonts', mimeType: 'text/markdown' }, async () => {
|
|
389
|
+
await guard.check();
|
|
390
|
+
return {
|
|
391
|
+
contents: [{ uri: 'astralkit://tokens', text: DESIGN_TOKENS, mimeType: 'text/markdown' }],
|
|
392
|
+
};
|
|
393
|
+
});
|
|
394
|
+
server.registerResource('AstralKit Coding Rules', 'astralkit://rules', { description: 'Mandatory coding standards — token usage, semantic colors, typography, spacing, icons, touch targets', mimeType: 'text/markdown' }, async () => {
|
|
395
|
+
await guard.check();
|
|
396
|
+
return {
|
|
397
|
+
contents: [{ uri: 'astralkit://rules', text: CODING_STANDARDS, mimeType: 'text/markdown' }],
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
server.registerResource('AstralKit Component Catalog', 'astralkit://catalog', { description: 'Browse the full component catalog with names, categories, and descriptions', mimeType: 'application/json' }, async () => {
|
|
401
|
+
await guard.check();
|
|
402
|
+
try {
|
|
403
|
+
const result = await listComponents({ limit: 100 });
|
|
404
|
+
const catalog = result.components.map(c => ({
|
|
405
|
+
slug: c.slug,
|
|
406
|
+
name: c.name,
|
|
407
|
+
description: c.short_description,
|
|
408
|
+
category: c.category,
|
|
409
|
+
is_pro: c.is_pro,
|
|
410
|
+
frameworks: c.supported_frameworks,
|
|
411
|
+
}));
|
|
412
|
+
return {
|
|
413
|
+
contents: [{
|
|
414
|
+
uri: 'astralkit://catalog',
|
|
415
|
+
text: JSON.stringify({ total: result.pagination.total, components: catalog }, null, 2),
|
|
416
|
+
mimeType: 'application/json',
|
|
417
|
+
}],
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
catch (err) {
|
|
421
|
+
if (err instanceof AuthError)
|
|
422
|
+
throw err;
|
|
423
|
+
return {
|
|
424
|
+
contents: [{
|
|
425
|
+
uri: 'astralkit://catalog',
|
|
426
|
+
text: JSON.stringify({ error: 'Failed to load catalog. Check your connection.' }),
|
|
427
|
+
mimeType: 'application/json',
|
|
428
|
+
}],
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
// ─── Prompts ─────────────────────────────────────────────────────────
|
|
433
|
+
server.registerPrompt('build-with-astralkit', {
|
|
434
|
+
title: 'Build with AstralKit',
|
|
435
|
+
description: 'Generate a guided prompt for building a UI with AstralKit components and design tokens.',
|
|
436
|
+
argsSchema: {
|
|
437
|
+
description: z.string().max(MAX_DESCRIPTION_LENGTH).describe('What to build (e.g. "a pricing page with 3 tiers", "a settings dashboard")'),
|
|
438
|
+
},
|
|
439
|
+
}, async ({ description }) => ({
|
|
440
|
+
messages: [{
|
|
441
|
+
role: 'user',
|
|
442
|
+
content: {
|
|
443
|
+
type: 'text',
|
|
444
|
+
text: `Build the following using AstralKit components and design tokens:\n\n` +
|
|
445
|
+
`${description}\n\n` +
|
|
446
|
+
`## Requirements\n` +
|
|
447
|
+
`1. Use ONLY ak-* design tokens for spacing, colors, typography, and radii\n` +
|
|
448
|
+
`2. Use semantic color tokens (bg-ak-surface, text-ak-text, border-ak-border) — never raw Tailwind colors\n` +
|
|
449
|
+
`3. Use Phosphor Icons from @phosphor-icons/react — never Lucide, Heroicons, or inline SVGs\n` +
|
|
450
|
+
`4. Body text minimum: text-ak-base (16px). UI text: font-medium minimum\n` +
|
|
451
|
+
`5. All buttons: min-h-[3rem] + cursor-pointer. All inputs: h-14\n` +
|
|
452
|
+
`6. No inline styles, no Framer Motion, no shadows on panels (borders only)\n` +
|
|
453
|
+
`7. Use cn() utility for conditional classes\n\n` +
|
|
454
|
+
`Before writing code, use the search_components tool to find relevant existing AstralKit components. ` +
|
|
455
|
+
`Use get_design_tokens for the token reference and get_coding_standards for the full rules.`,
|
|
456
|
+
},
|
|
457
|
+
}],
|
|
458
|
+
}));
|
|
459
|
+
server.registerPrompt('audit-astralkit', {
|
|
460
|
+
title: 'Audit AstralKit Compliance',
|
|
461
|
+
description: 'Generate a guided prompt for auditing code against AstralKit standards.',
|
|
462
|
+
argsSchema: {
|
|
463
|
+
code: z.string().max(MAX_CODE_LENGTH).describe('The code to audit'),
|
|
464
|
+
},
|
|
465
|
+
}, async ({ code }) => ({
|
|
466
|
+
messages: [{
|
|
467
|
+
role: 'user',
|
|
468
|
+
content: {
|
|
469
|
+
type: 'text',
|
|
470
|
+
text: `Audit the following code for AstralKit design system compliance:\n\n` +
|
|
471
|
+
`\`\`\`tsx\n${code}\n\`\`\`\n\n` +
|
|
472
|
+
`## Check for these violations:\n` +
|
|
473
|
+
`1. Raw Tailwind colors (bg-gray-100, text-blue-600) — must use ak-* semantic tokens\n` +
|
|
474
|
+
`2. Arbitrary bracket values (p-[1.5rem], text-[22px]) — must use ak-* tokens\n` +
|
|
475
|
+
`3. Raw Tailwind spacing (p-6, gap-4) — must use ak-* spacing (p-ak-3, gap-ak-2)\n` +
|
|
476
|
+
`4. Non-Phosphor icons (Lucide, Heroicons, inline SVG)\n` +
|
|
477
|
+
`5. Inline style={{}} attributes (only acceptable for CSS variables)\n` +
|
|
478
|
+
`6. Missing touch targets (buttons without min-h-[3rem], inputs without h-14)\n` +
|
|
479
|
+
`7. Missing cursor-pointer on buttons\n` +
|
|
480
|
+
`8. Framer Motion usage (use CSS animations instead)\n` +
|
|
481
|
+
`9. Shadows on panels/dropdowns (use borders instead)\n` +
|
|
482
|
+
`10. Typography below 16px floor for body text\n` +
|
|
483
|
+
`11. font-normal on UI text (should be font-medium minimum)\n\n` +
|
|
484
|
+
`Use the validate_code tool first, then provide detailed findings and fixes.`,
|
|
485
|
+
},
|
|
486
|
+
}],
|
|
487
|
+
}));
|
|
488
|
+
return server;
|
|
489
|
+
}
|
|
490
|
+
export async function startServer() {
|
|
491
|
+
const apiKey = process.env.ASTRALKIT_API_KEY ?? null;
|
|
492
|
+
const apiUrl = process.env.ASTRALKIT_API_URL;
|
|
493
|
+
configure(apiKey, apiUrl);
|
|
494
|
+
let auth;
|
|
495
|
+
try {
|
|
496
|
+
auth = await validatePremiumAccess(apiKey);
|
|
497
|
+
}
|
|
498
|
+
catch (err) {
|
|
499
|
+
if (err instanceof AuthError) {
|
|
500
|
+
console.error(`\n[astralkit-mcp] ${err.message}\n`);
|
|
501
|
+
process.exit(1);
|
|
502
|
+
}
|
|
503
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
504
|
+
console.error(`\n[astralkit-mcp] Unexpected error during authentication:\n${redactApiKey(errMsg, apiKey)}\n`);
|
|
505
|
+
process.exit(1);
|
|
506
|
+
}
|
|
507
|
+
console.error(`[astralkit-mcp] Authenticated as ${auth.email} (${auth.tier})`);
|
|
508
|
+
const guard = new AuthGuard(apiKey);
|
|
509
|
+
const server = createServer(auth, guard, apiKey);
|
|
510
|
+
const transport = new StdioServerTransport();
|
|
511
|
+
await server.connect(transport);
|
|
512
|
+
console.error(`[astralkit-mcp] Server running on stdio (v${VERSION})`);
|
|
513
|
+
}
|
|
514
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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,CAAC,CAAC;QAC9G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,oCAAoC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAE/E,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,MAAO,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAO,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,CAAC,KAAK,CAAC,6CAA6C,OAAO,GAAG,CAAC,CAAC;AACzE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@astralkit/mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AstralKit MCP Server — search, browse, and install UI components from any AI coding tool",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"astralkit-mcp": "bin/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/server.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"dist",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18.0.0"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"astralkit",
|
|
20
|
+
"mcp",
|
|
21
|
+
"model-context-protocol",
|
|
22
|
+
"ui",
|
|
23
|
+
"components",
|
|
24
|
+
"tailwind",
|
|
25
|
+
"react",
|
|
26
|
+
"nextjs",
|
|
27
|
+
"ai",
|
|
28
|
+
"claude",
|
|
29
|
+
"cursor",
|
|
30
|
+
"copilot"
|
|
31
|
+
],
|
|
32
|
+
"homepage": "https://astralkit.com",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/astral-kit/mcp.git"
|
|
36
|
+
},
|
|
37
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc",
|
|
44
|
+
"dev": "tsc --watch",
|
|
45
|
+
"start": "node bin/index.js"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
49
|
+
"zod": "^3.24.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"typescript": "^5.7.0",
|
|
53
|
+
"@types/node": "^22.0.0"
|
|
54
|
+
}
|
|
55
|
+
}
|