@kernlang/mcp-server 3.1.6 → 3.1.7
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import { dirname, resolve } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
const SERVER_PATH = resolve(__dirname, '../../dist/index.js');
|
|
6
|
+
function sendMCP(messages) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
const cp = spawn('node', [SERVER_PATH], { stdio: ['pipe', 'pipe', 'pipe'] });
|
|
9
|
+
let stdout = '';
|
|
10
|
+
let stderr = '';
|
|
11
|
+
cp.stdout.on('data', (d) => {
|
|
12
|
+
stdout += d.toString();
|
|
13
|
+
});
|
|
14
|
+
cp.stderr.on('data', (d) => {
|
|
15
|
+
stderr += d.toString();
|
|
16
|
+
});
|
|
17
|
+
for (const msg of messages) {
|
|
18
|
+
cp.stdin.write(`${JSON.stringify(msg)}\n`);
|
|
19
|
+
}
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
cp.kill();
|
|
22
|
+
resolve({ stdout, stderr });
|
|
23
|
+
}, 3000);
|
|
24
|
+
cp.on('error', reject);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function rpc(method, params = {}, id = 1) {
|
|
28
|
+
return { jsonrpc: '2.0', method, params, id };
|
|
29
|
+
}
|
|
30
|
+
describe('KERN MCP Server Integration', () => {
|
|
31
|
+
it('should respond to initialize', async () => {
|
|
32
|
+
const { stdout } = await sendMCP([
|
|
33
|
+
rpc('initialize', {
|
|
34
|
+
protocolVersion: '2024-11-05',
|
|
35
|
+
capabilities: {},
|
|
36
|
+
clientInfo: { name: 'test', version: '1.0' },
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
39
|
+
const response = JSON.parse(stdout.split('\n')[0]);
|
|
40
|
+
expect(response.result.serverInfo.name).toBe('kern');
|
|
41
|
+
expect(response.result.serverInfo.version).toBe('3.0.0');
|
|
42
|
+
expect(response.result.capabilities.tools).toBeDefined();
|
|
43
|
+
expect(response.result.capabilities.resources).toBeDefined();
|
|
44
|
+
expect(response.result.capabilities.prompts).toBeDefined();
|
|
45
|
+
});
|
|
46
|
+
it('should list tools', async () => {
|
|
47
|
+
const { stdout } = await sendMCP([
|
|
48
|
+
rpc('initialize', {
|
|
49
|
+
protocolVersion: '2024-11-05',
|
|
50
|
+
capabilities: {},
|
|
51
|
+
clientInfo: { name: 'test', version: '1.0' },
|
|
52
|
+
}, 1),
|
|
53
|
+
{ jsonrpc: '2.0', method: 'notifications/initialized' },
|
|
54
|
+
rpc('tools/list', {}, 2),
|
|
55
|
+
]);
|
|
56
|
+
const lines = stdout.split('\n').filter(Boolean);
|
|
57
|
+
const listResponse = JSON.parse(lines[lines.length - 1]);
|
|
58
|
+
const toolNames = listResponse.result.tools.map((t) => t.name);
|
|
59
|
+
expect(toolNames).toContain('compile');
|
|
60
|
+
expect(toolNames).toContain('review');
|
|
61
|
+
expect(toolNames).toContain('parse');
|
|
62
|
+
expect(toolNames).toContain('validate');
|
|
63
|
+
expect(toolNames).toContain('list-targets');
|
|
64
|
+
});
|
|
65
|
+
it('should compile .kern source via tools/call', async () => {
|
|
66
|
+
const { stdout } = await sendMCP([
|
|
67
|
+
rpc('initialize', {
|
|
68
|
+
protocolVersion: '2024-11-05',
|
|
69
|
+
capabilities: {},
|
|
70
|
+
clientInfo: { name: 'test', version: '1.0' },
|
|
71
|
+
}, 1),
|
|
72
|
+
{ jsonrpc: '2.0', method: 'notifications/initialized' },
|
|
73
|
+
rpc('tools/call', {
|
|
74
|
+
name: 'compile',
|
|
75
|
+
arguments: {
|
|
76
|
+
source: 'page name=Home\n text value="Hello"',
|
|
77
|
+
target: 'nextjs',
|
|
78
|
+
},
|
|
79
|
+
}, 2),
|
|
80
|
+
]);
|
|
81
|
+
const lines = stdout.split('\n').filter(Boolean);
|
|
82
|
+
const callResponse = JSON.parse(lines[lines.length - 1]);
|
|
83
|
+
expect(callResponse.result.content[0].type).toBe('text');
|
|
84
|
+
expect(callResponse.result.content[0].text).toContain('Compiled to nextjs');
|
|
85
|
+
});
|
|
86
|
+
it('should parse .kern source', async () => {
|
|
87
|
+
const { stdout } = await sendMCP([
|
|
88
|
+
rpc('initialize', {
|
|
89
|
+
protocolVersion: '2024-11-05',
|
|
90
|
+
capabilities: {},
|
|
91
|
+
clientInfo: { name: 'test', version: '1.0' },
|
|
92
|
+
}, 1),
|
|
93
|
+
{ jsonrpc: '2.0', method: 'notifications/initialized' },
|
|
94
|
+
rpc('tools/call', {
|
|
95
|
+
name: 'parse',
|
|
96
|
+
arguments: { source: 'screen name=Dashboard\n text value="Hello"' },
|
|
97
|
+
}, 2),
|
|
98
|
+
]);
|
|
99
|
+
const lines = stdout.split('\n').filter(Boolean);
|
|
100
|
+
const callResponse = JSON.parse(lines[lines.length - 1]);
|
|
101
|
+
expect(callResponse.result.content[0].text).toContain('IR tokens');
|
|
102
|
+
});
|
|
103
|
+
it('should validate .kern source', async () => {
|
|
104
|
+
const { stdout } = await sendMCP([
|
|
105
|
+
rpc('initialize', {
|
|
106
|
+
protocolVersion: '2024-11-05',
|
|
107
|
+
capabilities: {},
|
|
108
|
+
clientInfo: { name: 'test', version: '1.0' },
|
|
109
|
+
}, 1),
|
|
110
|
+
{ jsonrpc: '2.0', method: 'notifications/initialized' },
|
|
111
|
+
rpc('tools/call', {
|
|
112
|
+
name: 'validate',
|
|
113
|
+
arguments: { source: 'button label="Click"' },
|
|
114
|
+
}, 2),
|
|
115
|
+
]);
|
|
116
|
+
const lines = stdout.split('\n').filter(Boolean);
|
|
117
|
+
const callResponse = JSON.parse(lines[lines.length - 1]);
|
|
118
|
+
expect(callResponse.result.content[0].text).toContain('Valid .kern');
|
|
119
|
+
});
|
|
120
|
+
it('should list targets', async () => {
|
|
121
|
+
const { stdout } = await sendMCP([
|
|
122
|
+
rpc('initialize', {
|
|
123
|
+
protocolVersion: '2024-11-05',
|
|
124
|
+
capabilities: {},
|
|
125
|
+
clientInfo: { name: 'test', version: '1.0' },
|
|
126
|
+
}, 1),
|
|
127
|
+
{ jsonrpc: '2.0', method: 'notifications/initialized' },
|
|
128
|
+
rpc('tools/call', { name: 'list-targets', arguments: {} }, 2),
|
|
129
|
+
]);
|
|
130
|
+
const lines = stdout.split('\n').filter(Boolean);
|
|
131
|
+
const callResponse = JSON.parse(lines[lines.length - 1]);
|
|
132
|
+
const text = callResponse.result.content[0].text;
|
|
133
|
+
expect(text).toContain('12 targets');
|
|
134
|
+
expect(text).toContain('mcp');
|
|
135
|
+
expect(text).toContain('nextjs');
|
|
136
|
+
expect(text).toContain('express');
|
|
137
|
+
});
|
|
138
|
+
it('should log server start to stderr', async () => {
|
|
139
|
+
const { stderr } = await sendMCP([
|
|
140
|
+
rpc('initialize', {
|
|
141
|
+
protocolVersion: '2024-11-05',
|
|
142
|
+
capabilities: {},
|
|
143
|
+
clientInfo: { name: 'test', version: '1.0' },
|
|
144
|
+
}),
|
|
145
|
+
]);
|
|
146
|
+
expect(stderr).toContain('server:start');
|
|
147
|
+
expect(stderr).toContain('"name":"kern"');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
//# sourceMappingURL=server.integration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.integration.test.js","sourceRoot":"","sources":["../../src/__tests__/server.integration.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,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MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @kernlang/mcp-server — KERN MCP Server
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* AI agents can
|
|
5
|
+
* Complete MCP interface for KERN: compile, review, parse, decompile, and analyze.
|
|
6
|
+
* AI agents can write .kern, compile to 12 targets, review code, and scan MCP servers.
|
|
7
7
|
*
|
|
8
|
-
* Usage:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Claude Desktop config:
|
|
12
|
-
* { "mcpServers": { "kern": { "command": "kern-mcp" } } }
|
|
8
|
+
* Usage: kern-mcp
|
|
9
|
+
* Config: { "mcpServers": { "kern": { "command": "npx", "args": ["@kernlang/mcp-server"] } } }
|
|
13
10
|
*/
|
|
14
11
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -2,37 +2,30 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @kernlang/mcp-server — KERN MCP Server
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* AI agents can
|
|
5
|
+
* Complete MCP interface for KERN: compile, review, parse, decompile, and analyze.
|
|
6
|
+
* AI agents can write .kern, compile to 12 targets, review code, and scan MCP servers.
|
|
7
7
|
*
|
|
8
|
-
* Usage:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Claude Desktop config:
|
|
12
|
-
* { "mcpServers": { "kern": { "command": "kern-mcp" } } }
|
|
8
|
+
* Usage: kern-mcp
|
|
9
|
+
* Config: { "mcpServers": { "kern": { "command": "npx", "args": ["@kernlang/mcp-server"] } } }
|
|
13
10
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
16
|
-
import { z } from 'zod';
|
|
17
|
-
import { parse, resolveConfig, serializeIR, countTokens, VALID_TARGETS, KERN_VERSION, NODE_TYPES, STYLE_SHORTHANDS, } from '@kernlang/core';
|
|
18
|
-
import { transpileWeb, transpileTailwind, transpileNextjs } from '@kernlang/react';
|
|
11
|
+
import { countTokens, decompile, KERN_VERSION, NODE_SCHEMAS, NODE_TYPES, parse, resolveConfig, STYLE_SHORTHANDS, serializeIR, VALID_TARGETS, } from '@kernlang/core';
|
|
19
12
|
import { transpileExpress } from '@kernlang/express';
|
|
20
13
|
import { transpileFastAPI } from '@kernlang/fastapi';
|
|
21
|
-
import { transpileTerminal, transpileInk } from '@kernlang/terminal';
|
|
22
|
-
import { transpileVue, transpileNuxt } from '@kernlang/vue';
|
|
23
14
|
import { transpileMCP } from '@kernlang/mcp';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
import { transpileNextjs, transpileTailwind, transpileWeb } from '@kernlang/react';
|
|
16
|
+
import { reviewKernSource, reviewSource } from '@kernlang/review';
|
|
17
|
+
import { reviewMCPSource } from '@kernlang/review-mcp';
|
|
18
|
+
import { transpileInk, transpileTerminal } from '@kernlang/terminal';
|
|
19
|
+
import { transpileNuxt, transpileVue } from '@kernlang/vue';
|
|
20
|
+
import { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
21
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
22
|
+
import { z } from 'zod';
|
|
32
23
|
// ── Server ──────────────────────────────────────────────────────────────
|
|
33
24
|
const server = new McpServer({
|
|
34
25
|
name: 'kern',
|
|
35
26
|
version: '3.0.0',
|
|
27
|
+
}, {
|
|
28
|
+
instructions: 'KERN is a declarative DSL that compiles to 12 targets. Use the write-kern prompt to learn the syntax before writing .kern code. Use compile to generate output, review to analyze code, and review-kern to lint .kern source.',
|
|
36
29
|
});
|
|
37
30
|
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
38
31
|
function log(event, details = {}) {
|
|
@@ -41,197 +34,613 @@ function log(event, details = {}) {
|
|
|
41
34
|
function err(event, details = {}) {
|
|
42
35
|
console.error(JSON.stringify({ level: 'error', event, ...details, ts: new Date().toISOString() }));
|
|
43
36
|
}
|
|
37
|
+
function fmtError(error) {
|
|
38
|
+
return error instanceof Error ? error.message : String(error);
|
|
39
|
+
}
|
|
44
40
|
function transpile(ast, target, config) {
|
|
45
41
|
switch (target) {
|
|
46
|
-
case 'web':
|
|
47
|
-
|
|
48
|
-
case '
|
|
49
|
-
|
|
50
|
-
case '
|
|
51
|
-
|
|
52
|
-
case '
|
|
53
|
-
|
|
54
|
-
case '
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
case 'web':
|
|
43
|
+
return transpileWeb(ast, config);
|
|
44
|
+
case 'tailwind':
|
|
45
|
+
return transpileTailwind(ast, config);
|
|
46
|
+
case 'nextjs':
|
|
47
|
+
return transpileNextjs(ast, config);
|
|
48
|
+
case 'express':
|
|
49
|
+
return transpileExpress(ast, config);
|
|
50
|
+
case 'fastapi':
|
|
51
|
+
return transpileFastAPI(ast, config);
|
|
52
|
+
case 'terminal':
|
|
53
|
+
return transpileTerminal(ast, config);
|
|
54
|
+
case 'ink':
|
|
55
|
+
return transpileInk(ast, config);
|
|
56
|
+
case 'vue':
|
|
57
|
+
return transpileVue(ast, config);
|
|
58
|
+
case 'nuxt':
|
|
59
|
+
return transpileNuxt(ast, config);
|
|
60
|
+
case 'mcp':
|
|
61
|
+
return transpileMCP(ast, config);
|
|
62
|
+
default:
|
|
63
|
+
return transpileNextjs(ast, config);
|
|
57
64
|
}
|
|
58
65
|
}
|
|
66
|
+
function countNodes(node) {
|
|
67
|
+
let count = 1;
|
|
68
|
+
for (const child of node.children || [])
|
|
69
|
+
count += countNodes(child);
|
|
70
|
+
return count;
|
|
71
|
+
}
|
|
72
|
+
const targetEnum = z.enum(VALID_TARGETS);
|
|
59
73
|
// ── Tools ───────────────────────────────────────────────────────────────
|
|
60
|
-
// 1. compile
|
|
61
|
-
server.tool('compile', 'Compile .kern source code to a target framework. Returns generated code.', {
|
|
62
|
-
source: z.string().describe('
|
|
63
|
-
target:
|
|
74
|
+
// 1. compile
|
|
75
|
+
server.tool('compile', 'Compile .kern source code to a target framework (Next.js, React, Vue, Express, FastAPI, MCP, etc.). Returns generated code.', {
|
|
76
|
+
source: z.string().describe('.kern source code'),
|
|
77
|
+
target: targetEnum.default('nextjs').describe('Target framework'),
|
|
64
78
|
}, async ({ source, target }) => {
|
|
65
|
-
log('tool:compile', { target,
|
|
79
|
+
log('tool:compile', { target, len: source.length });
|
|
66
80
|
try {
|
|
67
81
|
const ast = parse(source);
|
|
68
82
|
const config = resolveConfig({ target: target });
|
|
69
83
|
const result = transpile(ast, target, config);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
result.
|
|
73
|
-
].join('\n');
|
|
74
|
-
if (result.artifacts && result.artifacts.length > 0) {
|
|
75
|
-
const artifactList = result.artifacts.map(a => `--- ${a.path} ---\n${a.content}`).join('\n\n');
|
|
76
|
-
return { content: [{ type: 'text', text: response + '\n\n' + artifactList }] };
|
|
84
|
+
let text = `// Compiled to ${target} (${result.irTokenCount} KERN → ${result.tsTokenCount} output tokens)\n${result.code}`;
|
|
85
|
+
if (result.artifacts?.length) {
|
|
86
|
+
text += `\n\n${result.artifacts.map((a) => `--- ${a.path} ---\n${a.content}`).join('\n\n')}`;
|
|
77
87
|
}
|
|
78
|
-
return { content: [{ type: 'text', text
|
|
88
|
+
return { content: [{ type: 'text', text }] };
|
|
79
89
|
}
|
|
80
|
-
catch (
|
|
81
|
-
err('tool:compile:error', { error:
|
|
82
|
-
return { isError: true, content: [{ type: 'text', text: `Compile error: ${
|
|
90
|
+
catch (e) {
|
|
91
|
+
err('tool:compile:error', { error: fmtError(e) });
|
|
92
|
+
return { isError: true, content: [{ type: 'text', text: `Compile error: ${fmtError(e)}` }] };
|
|
83
93
|
}
|
|
84
94
|
});
|
|
85
|
-
// 2. review —
|
|
86
|
-
server.tool('review', 'Run KERN static analysis on TypeScript/JavaScript source code.
|
|
87
|
-
source: z.string().describe('
|
|
88
|
-
filePath: z.string().default('input.ts').describe('File path for context
|
|
89
|
-
target:
|
|
95
|
+
// 2. review — TypeScript/JavaScript static analysis
|
|
96
|
+
server.tool('review', 'Run KERN static analysis (76+ rules, taint tracking, OWASP) on TypeScript/JavaScript source code.', {
|
|
97
|
+
source: z.string().describe('TypeScript or JavaScript source code to review'),
|
|
98
|
+
filePath: z.string().default('input.ts').describe('File path for rule context'),
|
|
99
|
+
target: targetEnum.default('nextjs').describe('Target framework for rule selection'),
|
|
90
100
|
}, async ({ source, filePath, target }) => {
|
|
91
|
-
log('tool:review', { filePath, target
|
|
101
|
+
log('tool:review', { filePath, target });
|
|
92
102
|
try {
|
|
93
103
|
const report = reviewSource(source, filePath, { target: target });
|
|
94
104
|
const findings = report.findings;
|
|
95
|
-
if (findings.length
|
|
105
|
+
if (!findings.length)
|
|
96
106
|
return { content: [{ type: 'text', text: 'No issues found.' }] };
|
|
97
|
-
|
|
98
|
-
const lines = findings.map(f => {
|
|
107
|
+
const lines = findings.map((f) => {
|
|
99
108
|
const loc = f.primarySpan?.startLine ? `L${f.primarySpan.startLine}` : '';
|
|
100
109
|
const conf = f.confidence !== undefined ? ` [${f.confidence.toFixed(2)}]` : '';
|
|
101
110
|
const sev = f.severity === 'error' ? '!' : f.severity === 'warning' ? '~' : '-';
|
|
102
|
-
return `${sev} ${loc}: [${f.ruleId}]${conf} ${f.message}`;
|
|
111
|
+
return `${sev} ${loc}: [${f.ruleId}]${conf} ${f.message}${f.suggestion ? `\n → ${f.suggestion}` : ''}`;
|
|
103
112
|
});
|
|
104
|
-
const
|
|
105
|
-
|
|
113
|
+
const errors = findings.filter((f) => f.severity === 'error').length;
|
|
114
|
+
const warnings = findings.filter((f) => f.severity === 'warning').length;
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{
|
|
118
|
+
type: 'text',
|
|
119
|
+
text: `${findings.length} finding(s) — ${errors} errors, ${warnings} warnings\n\n${lines.join('\n')}`,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
106
123
|
}
|
|
107
|
-
catch (
|
|
108
|
-
err('tool:review:error', { error:
|
|
109
|
-
return { isError: true, content: [{ type: 'text', text: `Review error: ${
|
|
124
|
+
catch (e) {
|
|
125
|
+
err('tool:review:error', { error: fmtError(e) });
|
|
126
|
+
return { isError: true, content: [{ type: 'text', text: `Review error: ${fmtError(e)}` }] };
|
|
110
127
|
}
|
|
111
128
|
});
|
|
112
|
-
// 3.
|
|
113
|
-
server.tool('
|
|
114
|
-
source: z.string().describe('
|
|
129
|
+
// 3. review-kern — lint .kern source files
|
|
130
|
+
server.tool('review-kern', 'Lint .kern source code for structural issues, missing props, and pattern violations.', {
|
|
131
|
+
source: z.string().describe('.kern source code to review'),
|
|
115
132
|
}, async ({ source }) => {
|
|
116
|
-
log('tool:
|
|
133
|
+
log('tool:review-kern', { len: source.length });
|
|
134
|
+
try {
|
|
135
|
+
const report = reviewKernSource(source);
|
|
136
|
+
const findings = report.findings;
|
|
137
|
+
if (!findings.length)
|
|
138
|
+
return { content: [{ type: 'text', text: 'No issues found in .kern source.' }] };
|
|
139
|
+
const lines = findings.map((f) => {
|
|
140
|
+
const loc = f.primarySpan?.startLine ? `L${f.primarySpan.startLine}` : '';
|
|
141
|
+
return `${f.severity === 'error' ? '!' : '~'} ${loc}: [${f.ruleId}] ${f.message}`;
|
|
142
|
+
});
|
|
143
|
+
return { content: [{ type: 'text', text: `${findings.length} finding(s)\n\n${lines.join('\n')}` }] };
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
err('tool:review-kern:error', { error: fmtError(e) });
|
|
147
|
+
return { isError: true, content: [{ type: 'text', text: `Review error: ${fmtError(e)}` }] };
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
// 4. review-mcp-server — scan MCP server code for security issues
|
|
151
|
+
server.tool('review-mcp-server', 'Scan MCP server TypeScript/Python code for security vulnerabilities. 13 rules mapped to OWASP MCP Top 10.', {
|
|
152
|
+
source: z.string().describe('MCP server source code to scan'),
|
|
153
|
+
filePath: z.string().default('server.ts').describe('File path for context'),
|
|
154
|
+
}, async ({ source, filePath }) => {
|
|
155
|
+
log('tool:review-mcp-server', { filePath });
|
|
156
|
+
try {
|
|
157
|
+
const findings = reviewMCPSource(source, filePath);
|
|
158
|
+
if (!findings.length)
|
|
159
|
+
return { content: [{ type: 'text', text: 'No MCP security issues found.' }] };
|
|
160
|
+
const lines = findings.map((f) => {
|
|
161
|
+
const loc = f.primarySpan?.startLine ? `L${f.primarySpan.startLine}` : '';
|
|
162
|
+
return `${f.severity === 'error' ? '!' : '~'} ${loc}: [${f.ruleId}] ${f.message}${f.suggestion ? `\n → ${f.suggestion}` : ''}`;
|
|
163
|
+
});
|
|
164
|
+
return { content: [{ type: 'text', text: `${findings.length} MCP security finding(s)\n\n${lines.join('\n')}` }] };
|
|
165
|
+
}
|
|
166
|
+
catch (e) {
|
|
167
|
+
err('tool:review-mcp:error', { error: fmtError(e) });
|
|
168
|
+
return { isError: true, content: [{ type: 'text', text: `MCP review error: ${fmtError(e)}` }] };
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
// 5. parse — .kern to IR
|
|
172
|
+
server.tool('parse', 'Parse .kern source and return the KERN IR (intermediate representation). Useful for debugging and understanding structure.', { source: z.string().describe('.kern source code') }, async ({ source }) => {
|
|
173
|
+
log('tool:parse', { len: source.length });
|
|
117
174
|
try {
|
|
118
175
|
const ast = parse(source);
|
|
119
176
|
const ir = serializeIR(ast);
|
|
120
|
-
|
|
121
|
-
return { content: [{ type: 'text', text: `// ${tokenCount} IR tokens\n${ir}` }] };
|
|
177
|
+
return { content: [{ type: 'text', text: `// ${countTokens(ir)} IR tokens, ${countNodes(ast)} nodes\n${ir}` }] };
|
|
122
178
|
}
|
|
123
|
-
catch (
|
|
124
|
-
|
|
125
|
-
return { isError: true, content: [{ type: 'text', text: `Parse error: ${error instanceof Error ? error.message : String(error)}` }] };
|
|
179
|
+
catch (e) {
|
|
180
|
+
return { isError: true, content: [{ type: 'text', text: `Parse error: ${fmtError(e)}` }] };
|
|
126
181
|
}
|
|
127
182
|
});
|
|
128
|
-
//
|
|
129
|
-
server.tool('
|
|
130
|
-
|
|
131
|
-
}, async ({ source }) => {
|
|
132
|
-
log('tool:validate', { sourceLen: source.length });
|
|
183
|
+
// 6. decompile — IR tree back to readable .kern text
|
|
184
|
+
server.tool('decompile', 'Decompile a parsed KERN IR tree back to human-readable .kern text. Useful for reformatting or inspecting parsed output.', { source: z.string().describe('.kern source code to parse then decompile') }, async ({ source }) => {
|
|
185
|
+
log('tool:decompile', { len: source.length });
|
|
133
186
|
try {
|
|
134
187
|
const ast = parse(source);
|
|
135
|
-
const
|
|
136
|
-
return { content: [{ type: 'text', text:
|
|
188
|
+
const result = decompile(ast);
|
|
189
|
+
return { content: [{ type: 'text', text: result.code }] };
|
|
137
190
|
}
|
|
138
|
-
catch (
|
|
139
|
-
return { isError: true, content: [{ type: 'text', text: `
|
|
191
|
+
catch (e) {
|
|
192
|
+
return { isError: true, content: [{ type: 'text', text: `Decompile error: ${fmtError(e)}` }] };
|
|
140
193
|
}
|
|
141
194
|
});
|
|
142
|
-
//
|
|
143
|
-
server.tool('
|
|
195
|
+
// 7. validate
|
|
196
|
+
server.tool('validate', 'Validate .kern syntax without compiling. Returns parse errors or success.', { source: z.string().describe('.kern source code') }, async ({ source }) => {
|
|
197
|
+
try {
|
|
198
|
+
const ast = parse(source);
|
|
199
|
+
return { content: [{ type: 'text', text: `Valid .kern — ${countNodes(ast)} node(s) parsed.` }] };
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
return { isError: true, content: [{ type: 'text', text: `Syntax error: ${fmtError(e)}` }] };
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
// 8. list-targets
|
|
206
|
+
server.tool('list-targets', 'List all available KERN compile targets.', {}, async () => {
|
|
144
207
|
const targets = {
|
|
145
208
|
nextjs: 'Next.js (App Router, TypeScript/React)',
|
|
146
209
|
tailwind: 'React + Tailwind CSS',
|
|
147
210
|
web: 'Plain React components',
|
|
148
|
-
vue: 'Vue 3
|
|
211
|
+
vue: 'Vue 3 SFC',
|
|
149
212
|
nuxt: 'Nuxt 3 (Vue meta-framework)',
|
|
150
213
|
express: 'Express TypeScript REST API',
|
|
151
214
|
fastapi: 'FastAPI Python async backend',
|
|
152
215
|
native: 'React Native (iOS/Android)',
|
|
153
|
-
cli: 'Node.js CLI
|
|
216
|
+
cli: 'Node.js CLI',
|
|
154
217
|
terminal: 'Terminal UI (ANSI)',
|
|
155
218
|
ink: 'Ink (React for terminals)',
|
|
156
219
|
mcp: 'MCP server (Model Context Protocol)',
|
|
157
220
|
};
|
|
158
221
|
const lines = Object.entries(targets).map(([k, v]) => ` ${k.padEnd(10)} — ${v}`);
|
|
159
|
-
return {
|
|
222
|
+
return {
|
|
223
|
+
content: [
|
|
224
|
+
{ type: 'text', text: `KERN v${KERN_VERSION} — ${VALID_TARGETS.length} targets:\n\n${lines.join('\n')}` },
|
|
225
|
+
],
|
|
226
|
+
};
|
|
227
|
+
});
|
|
228
|
+
// 9. list-nodes — describe available node types with their props
|
|
229
|
+
server.tool('list-nodes', 'List KERN node types with their properties and allowed children. Use this to understand what props a node accepts.', {
|
|
230
|
+
filter: z
|
|
231
|
+
.string()
|
|
232
|
+
.optional()
|
|
233
|
+
.describe('Filter by category: layout, content, interactive, backend, data, state, react, cli, terminal, mcp, or a specific node name'),
|
|
234
|
+
}, async ({ filter }) => {
|
|
235
|
+
const categories = {
|
|
236
|
+
layout: ['screen', 'page', 'row', 'col', 'card', 'grid', 'scroll', 'section', 'form'],
|
|
237
|
+
content: ['text', 'image', 'progress', 'divider', 'codeblock', 'icon', 'svg'],
|
|
238
|
+
interactive: ['button', 'input', 'textarea', 'slider', 'toggle', 'modal', 'select', 'option'],
|
|
239
|
+
navigation: ['tabs', 'tab', 'header', 'link', 'list', 'item'],
|
|
240
|
+
backend: [
|
|
241
|
+
'server',
|
|
242
|
+
'route',
|
|
243
|
+
'middleware',
|
|
244
|
+
'handler',
|
|
245
|
+
'schema',
|
|
246
|
+
'stream',
|
|
247
|
+
'spawn',
|
|
248
|
+
'timer',
|
|
249
|
+
'on',
|
|
250
|
+
'env',
|
|
251
|
+
'websocket',
|
|
252
|
+
],
|
|
253
|
+
data: [
|
|
254
|
+
'model',
|
|
255
|
+
'column',
|
|
256
|
+
'relation',
|
|
257
|
+
'repository',
|
|
258
|
+
'cache',
|
|
259
|
+
'entry',
|
|
260
|
+
'invalidate',
|
|
261
|
+
'dependency',
|
|
262
|
+
'inject',
|
|
263
|
+
'config',
|
|
264
|
+
'store',
|
|
265
|
+
],
|
|
266
|
+
state: ['machine', 'transition', 'state', 'signal', 'cleanup'],
|
|
267
|
+
types: ['type', 'interface', 'field', 'fn', 'const', 'union', 'variant', 'service', 'method', 'error'],
|
|
268
|
+
react: ['hook', 'provider', 'effect', 'logic', 'memo', 'callback', 'ref', 'context', 'prop', 'returns'],
|
|
269
|
+
cli: ['cli', 'command', 'arg', 'flag'],
|
|
270
|
+
terminal: [
|
|
271
|
+
'separator',
|
|
272
|
+
'table',
|
|
273
|
+
'thead',
|
|
274
|
+
'tbody',
|
|
275
|
+
'tr',
|
|
276
|
+
'th',
|
|
277
|
+
'td',
|
|
278
|
+
'scoreboard',
|
|
279
|
+
'metric',
|
|
280
|
+
'spinner',
|
|
281
|
+
'box',
|
|
282
|
+
'gradient',
|
|
283
|
+
],
|
|
284
|
+
ground: [
|
|
285
|
+
'derive',
|
|
286
|
+
'transform',
|
|
287
|
+
'action',
|
|
288
|
+
'assume',
|
|
289
|
+
'invariant',
|
|
290
|
+
'branch',
|
|
291
|
+
'path',
|
|
292
|
+
'resolve',
|
|
293
|
+
'guard',
|
|
294
|
+
'collect',
|
|
295
|
+
'pattern',
|
|
296
|
+
'apply',
|
|
297
|
+
'expect',
|
|
298
|
+
'recover',
|
|
299
|
+
'strategy',
|
|
300
|
+
],
|
|
301
|
+
mcp: ['mcp', 'tool', 'resource', 'prompt', 'param', 'description', 'sampling', 'elicitation'],
|
|
302
|
+
};
|
|
303
|
+
const lines = [];
|
|
304
|
+
if (filter && filter in categories) {
|
|
305
|
+
lines.push(`── ${filter} nodes ──`);
|
|
306
|
+
for (const nodeType of categories[filter]) {
|
|
307
|
+
const schema = NODE_SCHEMAS[nodeType];
|
|
308
|
+
if (schema) {
|
|
309
|
+
const props = Object.entries(schema.props)
|
|
310
|
+
.map(([k, v]) => `${v.required ? k : `${k}?`}:${v.kind}`)
|
|
311
|
+
.join(', ');
|
|
312
|
+
const children = schema.allowedChildren ? ` → [${schema.allowedChildren.join(', ')}]` : '';
|
|
313
|
+
lines.push(` ${nodeType}(${props})${children}`);
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
lines.push(` ${nodeType}`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
else if (filter) {
|
|
321
|
+
// Specific node lookup
|
|
322
|
+
const schema = NODE_SCHEMAS[filter];
|
|
323
|
+
if (schema) {
|
|
324
|
+
lines.push(`${filter}:`);
|
|
325
|
+
lines.push(` Props: ${Object.entries(schema.props)
|
|
326
|
+
.map(([k, v]) => `${k}${v.required ? ' (required)' : ''}: ${v.kind}`)
|
|
327
|
+
.join(', ')}`);
|
|
328
|
+
if (schema.allowedChildren)
|
|
329
|
+
lines.push(` Children: ${schema.allowedChildren.join(', ')}`);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
lines.push(`Node type "${filter}" has no schema definition. It may still be valid — check examples.`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
lines.push(`KERN node categories (use filter to drill down):\n`);
|
|
337
|
+
for (const [cat, nodes] of Object.entries(categories)) {
|
|
338
|
+
lines.push(` ${cat.padEnd(12)} — ${nodes.slice(0, 6).join(', ')}${nodes.length > 6 ? ', ...' : ''}`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
160
342
|
});
|
|
161
343
|
// ── Resources ───────────────────────────────────────────────────────────
|
|
162
|
-
//
|
|
163
|
-
server.resource('kern-spec', 'kern://spec', {
|
|
344
|
+
// Full spec
|
|
345
|
+
server.resource('kern-spec', 'kern://spec', {
|
|
346
|
+
description: 'KERN language specification — grammar, node types, style shorthands, all compile targets',
|
|
347
|
+
mimeType: 'text/plain',
|
|
348
|
+
}, async (uri) => {
|
|
164
349
|
const nodeList = NODE_TYPES.join(', ');
|
|
165
|
-
const shorthandList = Object.entries(STYLE_SHORTHANDS)
|
|
166
|
-
|
|
350
|
+
const shorthandList = Object.entries(STYLE_SHORTHANDS)
|
|
351
|
+
.map(([k, v]) => ` ${k} → ${v}`)
|
|
352
|
+
.join('\n');
|
|
353
|
+
const schemaList = Object.entries(NODE_SCHEMAS)
|
|
354
|
+
.map(([name, s]) => {
|
|
355
|
+
const props = Object.entries(s.props)
|
|
356
|
+
.map(([k, v]) => `${v.required ? k : `${k}?`}:${v.kind}`)
|
|
357
|
+
.join(', ');
|
|
358
|
+
const children = s.allowedChildren ? ` children=[${s.allowedChildren.join(',')}]` : '';
|
|
359
|
+
return ` ${name}(${props})${children}`;
|
|
360
|
+
})
|
|
361
|
+
.join('\n');
|
|
362
|
+
const text = [
|
|
167
363
|
`KERN v${KERN_VERSION} Language Specification`,
|
|
168
364
|
'',
|
|
169
365
|
'── Grammar ──',
|
|
170
|
-
|
|
366
|
+
'document = node+',
|
|
367
|
+
'node = indent type (SP prop)* (SP style)? NL child*',
|
|
368
|
+
'prop = ident "=" value',
|
|
369
|
+
'value = quoted | bare',
|
|
370
|
+
'style = "{" spair ("," spair)* "}"',
|
|
371
|
+
'',
|
|
372
|
+
'── Rules ──',
|
|
373
|
+
'- Indent: 2 spaces (no tabs)',
|
|
374
|
+
'- Props: key=value (strings in double quotes)',
|
|
375
|
+
'- Styles: inline {shorthand: value} blocks',
|
|
376
|
+
'- Handlers: <<< code >>> blocks for inline code',
|
|
377
|
+
'- Theme refs: $refName to reference theme nodes',
|
|
171
378
|
'',
|
|
172
379
|
`── Node Types (${NODE_TYPES.length}) ──`,
|
|
173
380
|
nodeList,
|
|
174
381
|
'',
|
|
382
|
+
'── Node Schemas (props + children) ──',
|
|
383
|
+
schemaList,
|
|
384
|
+
'',
|
|
175
385
|
'── Style Shorthands ──',
|
|
176
386
|
shorthandList,
|
|
177
387
|
'',
|
|
178
388
|
`── Compile Targets (${VALID_TARGETS.length}) ──`,
|
|
179
389
|
VALID_TARGETS.join(', '),
|
|
180
390
|
].join('\n');
|
|
181
|
-
return { contents: [{ uri: uri.href, mimeType: 'text/plain', text
|
|
391
|
+
return { contents: [{ uri: uri.href, mimeType: 'text/plain', text }] };
|
|
182
392
|
});
|
|
183
|
-
//
|
|
393
|
+
// Examples by category
|
|
394
|
+
server.resource('kern-examples', new ResourceTemplate('kern://examples/{category}', {
|
|
395
|
+
list: async () => ({
|
|
396
|
+
resources: [
|
|
397
|
+
{ uri: 'kern://examples/ui', name: 'UI examples (screens, layouts, lists)' },
|
|
398
|
+
{ uri: 'kern://examples/api', name: 'API examples (Express, FastAPI routes)' },
|
|
399
|
+
{ uri: 'kern://examples/state-machine', name: 'State machine examples' },
|
|
400
|
+
{ uri: 'kern://examples/mcp', name: 'MCP server examples' },
|
|
401
|
+
{ uri: 'kern://examples/terminal', name: 'Terminal UI examples' },
|
|
402
|
+
],
|
|
403
|
+
}),
|
|
404
|
+
}), { description: 'KERN example code by category', mimeType: 'text/plain' }, async (uri, { category }) => {
|
|
405
|
+
const examples = {
|
|
406
|
+
ui: `# UI Example — Dashboard Screen
|
|
407
|
+
|
|
408
|
+
screen name=Dashboard {bg:#F8F9FA}
|
|
409
|
+
row {p:16,jc:sb,ai:center}
|
|
410
|
+
text value="Dashboard" {fs:24,fw:bold}
|
|
411
|
+
image src=avatar {w:40,h:40,br:20}
|
|
412
|
+
card {p:16,br:12,bg:#FFF,m:16}
|
|
413
|
+
progress label=Users current=1840 target=2200 color=#FF6B6B
|
|
414
|
+
progress label=Revenue current=96 target=140 color=#4ECDC4
|
|
415
|
+
list title="Recent Activity" separator=true
|
|
416
|
+
item id=1 name="New signup" time=08:15
|
|
417
|
+
item id=2 name="Purchase" time=12:40
|
|
418
|
+
tabs active=Dashboard
|
|
419
|
+
tab icon=home label=Dashboard
|
|
420
|
+
tab icon=chart label=Stats
|
|
421
|
+
tab icon=gear label=Settings
|
|
422
|
+
|
|
423
|
+
# Card Grid
|
|
424
|
+
page name=Products
|
|
425
|
+
grid columns=3 {gap:16,p:16}
|
|
426
|
+
card {br:8,bg:#FFF}
|
|
427
|
+
image src=product1 {w:full,h:200}
|
|
428
|
+
text value="Product Name" {p:12,fw:bold}
|
|
429
|
+
button label="Buy" {bg:#007AFF,c:#FFF}`,
|
|
430
|
+
api: `# Express API Example
|
|
431
|
+
|
|
432
|
+
server name=UserAPI port=3001
|
|
433
|
+
middleware name=cors
|
|
434
|
+
middleware name=json
|
|
435
|
+
|
|
436
|
+
route GET /api/users
|
|
437
|
+
auth required
|
|
438
|
+
validate UserQuerySchema
|
|
439
|
+
handler <<<
|
|
440
|
+
const users = await db.query('SELECT * FROM users');
|
|
441
|
+
res.json(users);
|
|
442
|
+
>>>
|
|
443
|
+
error 401 "Unauthorized"
|
|
444
|
+
|
|
445
|
+
route POST /api/users
|
|
446
|
+
auth required
|
|
447
|
+
validate CreateUserSchema
|
|
448
|
+
derive user expr={{await db.users.create(body)}}
|
|
449
|
+
respond 201 json=user
|
|
450
|
+
error 400 "Invalid request"
|
|
451
|
+
|
|
452
|
+
route GET /api/users/:id
|
|
453
|
+
derive user expr={{await db.users.findById(params.id)}}
|
|
454
|
+
guard name=exists expr={{user}} else=404
|
|
455
|
+
respond 200 json=user
|
|
456
|
+
|
|
457
|
+
route DELETE /api/users/:id
|
|
458
|
+
auth required
|
|
459
|
+
derive result expr={{await db.users.delete(params.id)}}
|
|
460
|
+
respond 204`,
|
|
461
|
+
'state-machine': `# State Machine — 7 lines → 140+ lines TypeScript
|
|
462
|
+
|
|
463
|
+
machine name=Order initial=pending
|
|
464
|
+
transition from=pending to=confirmed event=confirm
|
|
465
|
+
transition from=confirmed to=shipped event=ship
|
|
466
|
+
transition from=shipped to=delivered event=deliver
|
|
467
|
+
transition from=pending to=cancelled event=cancel
|
|
468
|
+
transition from=confirmed to=cancelled event=cancel
|
|
469
|
+
|
|
470
|
+
# Generates: enums, transition functions, exhaustive checks, error classes`,
|
|
471
|
+
mcp: `# MCP Server Example — secure file tools
|
|
472
|
+
|
|
473
|
+
mcp name=FileTools version=1.0
|
|
474
|
+
|
|
475
|
+
tool name=readFile
|
|
476
|
+
description text="Read a file within allowed directories"
|
|
477
|
+
param name=filePath type=string required=true
|
|
478
|
+
guard type=pathContainment param=filePath allowlist=/data,/home
|
|
479
|
+
handler <<<
|
|
480
|
+
const fs = await import('node:fs/promises');
|
|
481
|
+
const content = await fs.readFile(params.filePath as string, 'utf-8');
|
|
482
|
+
return { content: [{ type: "text", text: content }] };
|
|
483
|
+
>>>
|
|
484
|
+
|
|
485
|
+
tool name=searchFiles
|
|
486
|
+
description text="Search for files matching a pattern"
|
|
487
|
+
param name=query type=string required=true
|
|
488
|
+
param name=maxResults type=number default=50
|
|
489
|
+
guard type=sanitize param=query
|
|
490
|
+
guard type=validate param=maxResults min=1 max=500
|
|
491
|
+
handler <<<
|
|
492
|
+
const { globSync } = await import('node:fs');
|
|
493
|
+
const results = globSync(params.query as string).slice(0, params.maxResults as number);
|
|
494
|
+
return { content: [{ type: "text", text: results.join('\\n') }] };
|
|
495
|
+
>>>
|
|
496
|
+
|
|
497
|
+
resource name=config uri="config://app"
|
|
498
|
+
description text="Application configuration"
|
|
499
|
+
handler <<<
|
|
500
|
+
return { contents: [{ uri: uri.href, text: JSON.stringify({ version: "1.0" }) }] };
|
|
501
|
+
>>>
|
|
502
|
+
|
|
503
|
+
# Guards: sanitize, pathContainment, validate, auth, rateLimit, sizeLimit
|
|
504
|
+
# Transports: stdio (default), http (streamable HTTP)`,
|
|
505
|
+
terminal: `# Terminal UI Example
|
|
506
|
+
|
|
507
|
+
screen name=AgonTerminal
|
|
508
|
+
gradient text="AGON" colors=[208,214,220,226]
|
|
509
|
+
box color=214
|
|
510
|
+
text value="Any AI can join. They compete. You ship." {fw:bold}
|
|
511
|
+
separator width=48
|
|
512
|
+
text value="Engines:" {c:#a1a1aa}
|
|
513
|
+
text value=" claude codex gemini" {c:#f97316,fw:bold}
|
|
514
|
+
separator width=48
|
|
515
|
+
scoreboard title="Results" winner="claude"
|
|
516
|
+
metric name=Score values=["89","74","71"]
|
|
517
|
+
metric name=Diff values=["436","570","317"]
|
|
518
|
+
table
|
|
519
|
+
thead
|
|
520
|
+
tr
|
|
521
|
+
th value="Engine"
|
|
522
|
+
th value="Score"
|
|
523
|
+
tbody
|
|
524
|
+
tr
|
|
525
|
+
td value="claude"
|
|
526
|
+
td value="89"`,
|
|
527
|
+
};
|
|
528
|
+
const text = examples[category] || `Unknown category: ${category}. Available: ${Object.keys(examples).join(', ')}`;
|
|
529
|
+
return { contents: [{ uri: uri.href, mimeType: 'text/plain', text }] };
|
|
530
|
+
});
|
|
531
|
+
// Targets resource
|
|
184
532
|
server.resource('kern-targets', 'kern://targets', { description: 'Available KERN compile targets', mimeType: 'application/json' }, async (uri) => {
|
|
185
533
|
return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(VALID_TARGETS) }] };
|
|
186
534
|
});
|
|
187
535
|
// ── Prompts ─────────────────────────────────────────────────────────────
|
|
188
|
-
server.prompt('write-kern', '
|
|
536
|
+
server.prompt('write-kern', 'Comprehensive system prompt for writing .kern code — spec, rules, examples, patterns', async () => {
|
|
189
537
|
const nodeList = NODE_TYPES.join(', ');
|
|
538
|
+
const shorthandList = Object.entries(STYLE_SHORTHANDS)
|
|
539
|
+
.map(([k, v]) => `${k}→${v}`)
|
|
540
|
+
.join(', ');
|
|
190
541
|
return {
|
|
191
|
-
messages: [
|
|
542
|
+
messages: [
|
|
543
|
+
{
|
|
192
544
|
role: 'user',
|
|
193
545
|
content: {
|
|
194
546
|
type: 'text',
|
|
195
|
-
text:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
547
|
+
text: `You are writing KERN (.kern) code — a declarative, indent-based DSL designed for LLMs.
|
|
548
|
+
|
|
549
|
+
## Grammar
|
|
550
|
+
- Indent: 2 spaces (no tabs, strict)
|
|
551
|
+
- Nodes: type name=value prop=value
|
|
552
|
+
- Strings: double quotes ("hello")
|
|
553
|
+
- Styles: inline {shorthand: value, shorthand: value}
|
|
554
|
+
- Handlers: <<< multi-line code >>>
|
|
555
|
+
- Theme refs: $refName
|
|
556
|
+
|
|
557
|
+
## Available Node Types
|
|
558
|
+
${nodeList}
|
|
559
|
+
|
|
560
|
+
## Style Shorthands
|
|
561
|
+
${shorthandList}
|
|
562
|
+
|
|
563
|
+
## Compile Targets
|
|
564
|
+
${VALID_TARGETS.join(', ')}
|
|
565
|
+
|
|
566
|
+
## Key Patterns
|
|
567
|
+
|
|
568
|
+
### UI Screen
|
|
569
|
+
\`\`\`kern
|
|
570
|
+
screen name=Dashboard {bg:#F8F9FA}
|
|
571
|
+
row {p:16,jc:sb,ai:center}
|
|
572
|
+
text value="Title" {fs:24,fw:bold}
|
|
573
|
+
card {p:16,br:12,bg:#FFF}
|
|
574
|
+
text value="Metric" {fs:14,c:gray}
|
|
575
|
+
text value="1,234" {fs:32,fw:bold}
|
|
576
|
+
button text="Action" {bg:#007AFF,c:#FFF,br:8}
|
|
577
|
+
\`\`\`
|
|
578
|
+
|
|
579
|
+
### API Server
|
|
580
|
+
\`\`\`kern
|
|
581
|
+
server name=API port=3001
|
|
582
|
+
middleware name=cors
|
|
583
|
+
middleware name=json
|
|
584
|
+
route GET /api/items
|
|
585
|
+
auth required
|
|
586
|
+
handler <<<
|
|
587
|
+
const items = await db.items.findAll();
|
|
588
|
+
res.json(items);
|
|
589
|
+
>>>
|
|
590
|
+
\`\`\`
|
|
591
|
+
|
|
592
|
+
### State Machine (7 lines → 140+ TypeScript)
|
|
593
|
+
\`\`\`kern
|
|
594
|
+
machine name=Order initial=pending
|
|
595
|
+
transition from=pending to=confirmed event=confirm
|
|
596
|
+
transition from=confirmed to=shipped event=ship
|
|
597
|
+
transition from=shipped to=delivered event=deliver
|
|
598
|
+
\`\`\`
|
|
599
|
+
|
|
600
|
+
### MCP Server
|
|
601
|
+
\`\`\`kern
|
|
602
|
+
mcp name=Tools version=1.0
|
|
603
|
+
tool name=search
|
|
604
|
+
description text="Search for items"
|
|
605
|
+
param name=query type=string required=true
|
|
606
|
+
guard type=sanitize param=query
|
|
607
|
+
handler <<<
|
|
608
|
+
return { content: [{ type: "text", text: "results" }] };
|
|
609
|
+
>>>
|
|
610
|
+
\`\`\`
|
|
611
|
+
|
|
612
|
+
### Type System
|
|
613
|
+
\`\`\`kern
|
|
614
|
+
type name=Status values=active|inactive|pending
|
|
615
|
+
interface name=User
|
|
616
|
+
field name=id type=string
|
|
617
|
+
field name=email type=string
|
|
618
|
+
field name=status type=Status
|
|
619
|
+
\`\`\`
|
|
620
|
+
|
|
621
|
+
### Hooks (React)
|
|
622
|
+
\`\`\`kern
|
|
623
|
+
hook name=useAuth
|
|
624
|
+
state name=user type=User|null initial=null
|
|
625
|
+
effect deps=[]
|
|
626
|
+
handler <<<
|
|
627
|
+
const session = await getSession();
|
|
628
|
+
setUser(session?.user ?? null);
|
|
629
|
+
>>>
|
|
630
|
+
returns user, isAuthenticated:boolean
|
|
631
|
+
\`\`\`
|
|
632
|
+
|
|
633
|
+
## Rules
|
|
634
|
+
- Every node is a line. Children are indented 2 spaces deeper.
|
|
635
|
+
- Props on the same line as the node type.
|
|
636
|
+
- Style blocks are CSS shorthand: {fs:24} = font-size:24, {fw:bold} = font-weight:bold, {p:16} = padding:16, {m:8} = margin:8, {bg:#FFF} = background:#FFF, {c:gray} = color:gray, {br:8} = border-radius:8, {w:full} = width:100%, {jc:sb} = justify-content:space-between, {ai:center} = align-items:center
|
|
637
|
+
- Handler blocks: <<< on new line, code, >>> on new line. For short handlers, inline is fine.
|
|
638
|
+
- Always use the simplest node structure. Don't over-nest.`,
|
|
223
639
|
},
|
|
224
|
-
}
|
|
640
|
+
},
|
|
641
|
+
],
|
|
225
642
|
};
|
|
226
643
|
});
|
|
227
|
-
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
228
|
-
function countNodes(node) {
|
|
229
|
-
let count = 1;
|
|
230
|
-
for (const child of node.children || []) {
|
|
231
|
-
count += countNodes(child);
|
|
232
|
-
}
|
|
233
|
-
return count;
|
|
234
|
-
}
|
|
235
644
|
// ── Start ───────────────────────────────────────────────────────────────
|
|
236
645
|
async function main() {
|
|
237
646
|
log('server:start', { name: 'kern', version: '3.0.0', kernVersion: KERN_VERSION });
|
|
@@ -239,7 +648,7 @@ async function main() {
|
|
|
239
648
|
await server.connect(transport);
|
|
240
649
|
}
|
|
241
650
|
void main().catch((error) => {
|
|
242
|
-
err('server:fatal', { error:
|
|
651
|
+
err('server:fatal', { error: fmtError(error) });
|
|
243
652
|
process.exitCode = 1;
|
|
244
653
|
});
|
|
245
654
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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AAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kernlang/mcp-server",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"description": "KERN MCP server — compile, review, and analyze .kern files via MCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,19 +29,24 @@
|
|
|
29
29
|
"license": "AGPL-3.0",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
32
|
-
"zod": "^3.
|
|
33
|
-
"@kernlang/
|
|
34
|
-
"@kernlang/
|
|
35
|
-
"@kernlang/
|
|
36
|
-
"@kernlang/
|
|
37
|
-
"@kernlang/
|
|
38
|
-
"@kernlang/review": "3.1.
|
|
39
|
-
"@kernlang/
|
|
40
|
-
"@kernlang/
|
|
41
|
-
"@kernlang/
|
|
32
|
+
"zod": "^4.3.6",
|
|
33
|
+
"@kernlang/mcp": "3.1.7",
|
|
34
|
+
"@kernlang/react": "3.1.7",
|
|
35
|
+
"@kernlang/core": "3.1.7",
|
|
36
|
+
"@kernlang/express": "3.1.7",
|
|
37
|
+
"@kernlang/fastapi": "3.1.7",
|
|
38
|
+
"@kernlang/review": "3.1.7",
|
|
39
|
+
"@kernlang/review-mcp": "3.1.7",
|
|
40
|
+
"@kernlang/terminal": "3.1.7",
|
|
41
|
+
"@kernlang/vue": "3.1.7"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/express": "^5.0.6",
|
|
45
|
+
"express": "^5.2.1"
|
|
42
46
|
},
|
|
43
47
|
"scripts": {
|
|
44
48
|
"build": "tsc -b",
|
|
45
|
-
"start": "node dist/index.js"
|
|
49
|
+
"start": "node dist/index.js",
|
|
50
|
+
"test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --passWithNoTests --config jest.config.js"
|
|
46
51
|
}
|
|
47
52
|
}
|