forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructions.ts
More file actions
32 lines (29 loc) · 1.18 KB
/
instructions.ts
File metadata and controls
32 lines (29 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
export function registerInstructionsResource(server: McpServer): void {
server.registerResource(
'instructions',
'instructions://best-practices',
{
title: 'Angular Best Practices and Code Generation Guide',
description:
"A comprehensive guide detailing Angular's best practices for code generation and development." +
' This guide should be used as a reference by an LLM to ensure any generated code' +
' adheres to modern Angular standards, including the use of standalone components,' +
' typed forms, modern control flow syntax, and other current conventions.',
mimeType: 'text/markdown',
},
async () => {
const text = await readFile(join(__dirname, 'best-practices.md'), 'utf-8');
return { contents: [{ uri: 'instructions://best-practices', text }] };
},
);
}