/
githubmirror
/
angular-cli
Обзор
Документация
Войти
/
githubmirror
/
angular-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular/cli/src/commands/mcp/resources/instructions.ts
32 строки
1 KB
Charles Lyding
refactor(@angular/cli): migrate MCP server to @modelcontextprotocol/server v2
04 авг 2026, 09:55
04 авг 2026, 09:55
b81b880
Код
Авторство
О чём код?
/** * @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/server'; 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 }] }; }, ); }