awesome-copilot-mcp 0.0.1-beta
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 +21 -0
- package/README.md +95 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +590 -0
- package/dist/cli.js.map +1 -0
- package/dist/github-adapter.d.ts +33 -0
- package/dist/github-adapter.d.ts.map +1 -0
- package/dist/github-adapter.js +226 -0
- package/dist/github-adapter.js.map +1 -0
- package/dist/http-server.d.ts +55 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +270 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +25 -0
- package/dist/logger.js.map +1 -0
- package/dist/mcp-prompts.d.ts +18 -0
- package/dist/mcp-prompts.d.ts.map +1 -0
- package/dist/mcp-prompts.js +81 -0
- package/dist/mcp-prompts.js.map +1 -0
- package/dist/mcp-resources.d.ts +37 -0
- package/dist/mcp-resources.d.ts.map +1 -0
- package/dist/mcp-resources.js +394 -0
- package/dist/mcp-resources.js.map +1 -0
- package/dist/mcp-server.d.ts +11 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +49 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/mcp-shared.d.ts +10 -0
- package/dist/mcp-shared.d.ts.map +1 -0
- package/dist/mcp-shared.js +160 -0
- package/dist/mcp-shared.js.map +1 -0
- package/dist/mcp-tools.d.ts +41 -0
- package/dist/mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools.js +249 -0
- package/dist/mcp-tools.js.map +1 -0
- package/dist/sse.d.ts +15 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +11 -0
- package/dist/sse.js.map +1 -0
- package/dist/types.d.ts +94 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/metadata.json +5767 -0
- package/package.json +85 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAEjB,QAAA,MAAM,GAAG,iBAAO,CAAC,YAAY,CAAC;IACzC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,MAAM;IACtC,MAAM,EAAE,iBAAO,CAAC,MAAM,CAAC,OAAO,CAC5B,iBAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAC1B,iBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EACtC,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CACtB;IACD,WAAW,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;IAC/C,UAAU,EAAE;QACV,IAAI,iBAAO,CAAC,UAAU,CAAC,OAAO,CAAC;YAC7B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;YAC5E,iBAAiB,EAAE,CAAC,MAAM,CAAC;YAC3B,MAAM,EAAE,iBAAO,CAAC,MAAM,CAAC,OAAO,CAC5B,iBAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CACxB;SACF,CAAC;KACH;CACF,CAAC,CAAC;AAEH,mCAAmC;AACnC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;IAC1C,cAAM,CAAC,GAAG,CAAC,IAAI,iBAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACnF,cAAM,CAAC,GAAG,CAAC,IAAI,iBAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Prompt } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
export interface PromptDefinition {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
arguments?: Array<{
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export declare class MCPPrompts {
|
|
12
|
+
private prompts;
|
|
13
|
+
getPrompts(): Prompt[];
|
|
14
|
+
getSearchPromptContent(keyword: string): string;
|
|
15
|
+
getPromptByName(name: string): PromptDefinition | undefined;
|
|
16
|
+
validatePromptName(name: string): boolean;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=mcp-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-prompts.d.ts","sourceRoot":"","sources":["../src/mcp-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAI5D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;CACJ;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAab;IAEF,UAAU,IAAI,MAAM,EAAE;IAQtB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IA+C/C,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAI3D,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAG1C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MCPPrompts = void 0;
|
|
7
|
+
const dedent_1 = __importDefault(require("dedent"));
|
|
8
|
+
class MCPPrompts {
|
|
9
|
+
prompts = [
|
|
10
|
+
{
|
|
11
|
+
name: 'get_search_prompt',
|
|
12
|
+
description: 'Provides an interactive prompt for searching awesome-copilot content',
|
|
13
|
+
arguments: [
|
|
14
|
+
{
|
|
15
|
+
name: 'keyword',
|
|
16
|
+
description: 'The keyword to search for',
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
getPrompts() {
|
|
23
|
+
return this.prompts.map(p => ({
|
|
24
|
+
name: p.name,
|
|
25
|
+
description: p.description,
|
|
26
|
+
arguments: p.arguments || []
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
getSearchPromptContent(keyword) {
|
|
30
|
+
return (0, dedent_1.default) `
|
|
31
|
+
Please search all the skills, instructions, prompts, agents, and collections that are related to the search keyword: \`${keyword}\`
|
|
32
|
+
|
|
33
|
+
**IMPORTANT: Execute the search tool immediately. Do not ask for confirmation before searching.**
|
|
34
|
+
|
|
35
|
+
Here's the process to follow:
|
|
36
|
+
1. Use the \`awesome-copilot\` MCP server. Call the \`search\` tool NOW with query="${keyword}".
|
|
37
|
+
3. Do NOT load any skills, instructions, prompts, or agents from the MCP server until the user asks to do so.
|
|
38
|
+
4. Scan local skills, instructions, prompts, and agents markdown files (NOTE: Collections are NOT saved locally, they are index files).
|
|
39
|
+
- Skills: \`.github/skills/<skill_name>/\` (folder, not individual files)
|
|
40
|
+
- Instructions: \`.github/instructions/*.instructions.md\`
|
|
41
|
+
- Prompts: \`.github/prompts/*.prompt.md\`
|
|
42
|
+
- Agents: \`.github/agents/*.agent.md\`
|
|
43
|
+
5. Compare existing skills, instructions, prompts, and agents with the search results.
|
|
44
|
+
6. Provide a structured response in a table format.
|
|
45
|
+
- For Skills: The "Name" column MUST be the skill folder name (e.g., 'dev-toolkit'), NOT 'SKILL.md'.
|
|
46
|
+
- For Others: Use the full filename.
|
|
47
|
+
- Example:
|
|
48
|
+
|
|
49
|
+
| Exists | Type | Name | Title | Description |
|
|
50
|
+
|--------|--------------|-------------------------------|---------------|---------------|
|
|
51
|
+
| ✅ | skills | dev-toolkit | Dev Toolkit | Description 1 |
|
|
52
|
+
| ❌ | instructions | instruction1.instructions.md | Instruction 1 | Description 1 |
|
|
53
|
+
| ✅ | prompts | prompt1.prompt.md | Prompt 1 | Description 1 |
|
|
54
|
+
| ❌ | agents | agent1.agent.md | Agent 1 | Description 1 |
|
|
55
|
+
|
|
56
|
+
✅ indicates that the item already exists in this repository, while ❌ indicates that it does not.
|
|
57
|
+
|
|
58
|
+
7. If any item doesn't exist in the repository, ask which item the user wants to save.
|
|
59
|
+
8. If the user wants to save it:
|
|
60
|
+
a. Use the \`load\` tool to fetch the full content of the selected item by its name.
|
|
61
|
+
b. Save the retrieved content in the appropriate directory with NO modification.
|
|
62
|
+
c. For skills: Use \`load_skill_directory\` tool with the skill name.
|
|
63
|
+
- This returns ALL files in the skill folder at once.
|
|
64
|
+
- Save each file to \`.github/skills/<skill_name>/\` preserving the structure.
|
|
65
|
+
d. For others: Save in corresponding directory with appropriate extension.
|
|
66
|
+
9. **Collections Handling**: Collections are INDEX FILES that reference multiple resources.
|
|
67
|
+
- Display any matching collections with their name, description, tags, and items list.
|
|
68
|
+
- Collections themselves are NOT saved locally - they are for discovery only.
|
|
69
|
+
- If user wants items FROM a collection, save those individual items (prompts, agents, etc.) instead.
|
|
70
|
+
10. Do NOT automatically install or save any items. Wait for explicit user confirmation.
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
getPromptByName(name) {
|
|
74
|
+
return this.prompts.find(p => p.name === name);
|
|
75
|
+
}
|
|
76
|
+
validatePromptName(name) {
|
|
77
|
+
return this.getPromptByName(name) !== undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.MCPPrompts = MCPPrompts;
|
|
81
|
+
//# sourceMappingURL=mcp-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-prompts.js","sourceRoot":"","sources":["../src/mcp-prompts.ts"],"names":[],"mappings":";;;;;;AACA,oDAA4B;AAa5B,MAAa,UAAU;IACb,OAAO,GAAuB;QACpC;YACE,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,sEAAsE;YACnF,SAAS,EAAE;gBACT;oBACE,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,2BAA2B;oBACxC,QAAQ,EAAE,IAAI;iBACf;aACF;SACF;KAEF,CAAC;IAEF,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC5B,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,EAAE;SAC7B,CAAC,CAAC,CAAC;IACN,CAAC;IAED,sBAAsB,CAAC,OAAe;QACpC,OAAO,IAAA,gBAAM,EAAA;+HAC8G,OAAO;;;;;4FAK1C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmC9F,CAAC;IACJ,CAAC;IAID,eAAe,CAAC,IAAY;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,kBAAkB,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAClD,CAAC;CACF;AA9ED,gCA8EC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Resource, ResourceTemplate } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { GitHubAdapter } from './github-adapter';
|
|
3
|
+
export interface ResourceContent {
|
|
4
|
+
uri: string;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class MCPResources {
|
|
9
|
+
private adapter;
|
|
10
|
+
constructor(adapter: GitHubAdapter);
|
|
11
|
+
/**
|
|
12
|
+
* Lists all available direct resources (fixed URIs)
|
|
13
|
+
*/
|
|
14
|
+
getResources(): Promise<Resource[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Lists all available resource templates (URIs with parameters)
|
|
17
|
+
*/
|
|
18
|
+
getResourceTemplates(): Promise<ResourceTemplate[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Reads the content of a resource by its URI
|
|
21
|
+
*/
|
|
22
|
+
readResource(uri: string): Promise<ResourceContent>;
|
|
23
|
+
private readMetadata;
|
|
24
|
+
private readAgentsIndex;
|
|
25
|
+
private readPromptsIndex;
|
|
26
|
+
private readInstructionsIndex;
|
|
27
|
+
private readSkillsIndex;
|
|
28
|
+
private readCollectionsIndex;
|
|
29
|
+
private readAgentByName;
|
|
30
|
+
private readPromptByName;
|
|
31
|
+
private readInstructionByName;
|
|
32
|
+
private readSkillByName;
|
|
33
|
+
private readCollectionByName;
|
|
34
|
+
private readSearchResults;
|
|
35
|
+
private readResourcesByTag;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=mcp-resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-resources.d.ts","sourceRoot":"","sources":["../src/mcp-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,OAAO,CAAgB;gBAEnB,OAAO,EAAE,aAAa;IAIlC;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAyCzC;;OAEG;IACG,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA+CzD;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;YA0D3C,YAAY;YASZ,eAAe;YAgBf,gBAAgB;YAgBhB,qBAAqB;YAgBrB,eAAe;YAgBf,oBAAoB;YAiBpB,eAAe;YAiBf,gBAAgB;YAiBhB,qBAAqB;YAiBrB,eAAe;YAiBf,oBAAoB;YAgBpB,iBAAiB;YAuEjB,kBAAkB;CAgCnC"}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCPResources = void 0;
|
|
4
|
+
const logger_1 = require("./logger");
|
|
5
|
+
class MCPResources {
|
|
6
|
+
adapter;
|
|
7
|
+
constructor(adapter) {
|
|
8
|
+
this.adapter = adapter;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Lists all available direct resources (fixed URIs)
|
|
12
|
+
*/
|
|
13
|
+
async getResources() {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
uri: 'awesome://metadata',
|
|
17
|
+
name: 'Complete Metadata Index',
|
|
18
|
+
description: 'Full index of all agents, prompts, instructions, skills, and collections',
|
|
19
|
+
mimeType: 'application/json'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
uri: 'awesome://agents/index',
|
|
23
|
+
name: 'Agents Index',
|
|
24
|
+
description: 'List of all available AI agents',
|
|
25
|
+
mimeType: 'application/json'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
uri: 'awesome://prompts/index',
|
|
29
|
+
name: 'Prompts Index',
|
|
30
|
+
description: 'List of all available prompts',
|
|
31
|
+
mimeType: 'application/json'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
uri: 'awesome://instructions/index',
|
|
35
|
+
name: 'Instructions Index',
|
|
36
|
+
description: 'List of all available instructions',
|
|
37
|
+
mimeType: 'application/json'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
uri: 'awesome://skills/index',
|
|
41
|
+
name: 'Skills Index',
|
|
42
|
+
description: 'List of all available skills',
|
|
43
|
+
mimeType: 'application/json'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
uri: 'awesome://collections/index',
|
|
47
|
+
name: 'Collections Index',
|
|
48
|
+
description: 'List of all available collections',
|
|
49
|
+
mimeType: 'application/json'
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Lists all available resource templates (URIs with parameters)
|
|
55
|
+
*/
|
|
56
|
+
async getResourceTemplates() {
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
uriTemplate: 'awesome://agents/{name}',
|
|
60
|
+
name: 'agent-info',
|
|
61
|
+
description: 'Get metadata and download URL for a specific agent by name',
|
|
62
|
+
mimeType: 'application/json'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
uriTemplate: 'awesome://prompts/{name}',
|
|
66
|
+
name: 'prompt-info',
|
|
67
|
+
description: 'Get metadata and download URL for a specific prompt by name',
|
|
68
|
+
mimeType: 'application/json'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
uriTemplate: 'awesome://instructions/{name}',
|
|
72
|
+
name: 'instruction-info',
|
|
73
|
+
description: 'Get metadata and download URL for a specific instruction by name',
|
|
74
|
+
mimeType: 'application/json'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
uriTemplate: 'awesome://skills/{name}',
|
|
78
|
+
name: 'skill-info',
|
|
79
|
+
description: 'Get metadata and download URL for a specific skill by name',
|
|
80
|
+
mimeType: 'application/json'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
uriTemplate: 'awesome://collections/{name}',
|
|
84
|
+
name: 'collection-info',
|
|
85
|
+
description: 'Get metadata for a specific collection by name',
|
|
86
|
+
mimeType: 'application/json'
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
uriTemplate: 'awesome://search/{type}/{query}',
|
|
90
|
+
name: 'search-resources',
|
|
91
|
+
description: 'Search resources by type (agents/prompts/instructions/skills/collections/all) and query',
|
|
92
|
+
mimeType: 'application/json'
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
uriTemplate: 'awesome://tags/{tag}',
|
|
96
|
+
name: 'browse-by-tag',
|
|
97
|
+
description: 'Browse all resources with a specific tag',
|
|
98
|
+
mimeType: 'application/json'
|
|
99
|
+
}
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Reads the content of a resource by its URI
|
|
104
|
+
*/
|
|
105
|
+
async readResource(uri) {
|
|
106
|
+
try {
|
|
107
|
+
logger_1.logger.info(`Reading resource: ${uri}`);
|
|
108
|
+
// Handle metadata
|
|
109
|
+
if (uri === 'awesome://metadata') {
|
|
110
|
+
return await this.readMetadata();
|
|
111
|
+
}
|
|
112
|
+
// Handle index resources
|
|
113
|
+
if (uri === 'awesome://agents/index') {
|
|
114
|
+
return await this.readAgentsIndex();
|
|
115
|
+
}
|
|
116
|
+
if (uri === 'awesome://prompts/index') {
|
|
117
|
+
return await this.readPromptsIndex();
|
|
118
|
+
}
|
|
119
|
+
if (uri === 'awesome://instructions/index') {
|
|
120
|
+
return await this.readInstructionsIndex();
|
|
121
|
+
}
|
|
122
|
+
if (uri === 'awesome://skills/index') {
|
|
123
|
+
return await this.readSkillsIndex();
|
|
124
|
+
}
|
|
125
|
+
if (uri === 'awesome://collections/index') {
|
|
126
|
+
return await this.readCollectionsIndex();
|
|
127
|
+
}
|
|
128
|
+
// Handle template resources
|
|
129
|
+
if (uri.startsWith('awesome://agents/')) {
|
|
130
|
+
return await this.readAgentByName(uri);
|
|
131
|
+
}
|
|
132
|
+
if (uri.startsWith('awesome://prompts/')) {
|
|
133
|
+
return await this.readPromptByName(uri);
|
|
134
|
+
}
|
|
135
|
+
if (uri.startsWith('awesome://instructions/')) {
|
|
136
|
+
return await this.readInstructionByName(uri);
|
|
137
|
+
}
|
|
138
|
+
if (uri.startsWith('awesome://skills/')) {
|
|
139
|
+
return await this.readSkillByName(uri);
|
|
140
|
+
}
|
|
141
|
+
if (uri.startsWith('awesome://collections/')) {
|
|
142
|
+
return await this.readCollectionByName(uri);
|
|
143
|
+
}
|
|
144
|
+
if (uri.startsWith('awesome://search/')) {
|
|
145
|
+
return await this.readSearchResults(uri);
|
|
146
|
+
}
|
|
147
|
+
if (uri.startsWith('awesome://tags/')) {
|
|
148
|
+
return await this.readResourcesByTag(uri);
|
|
149
|
+
}
|
|
150
|
+
throw new Error(`Unknown resource URI: ${uri}`);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
logger_1.logger.error(`Failed to read resource ${uri}: ${error}`);
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Private helper methods for reading specific resources
|
|
158
|
+
async readMetadata() {
|
|
159
|
+
const index = await this.adapter.fetchIndex();
|
|
160
|
+
return {
|
|
161
|
+
uri: 'awesome://metadata',
|
|
162
|
+
mimeType: 'application/json',
|
|
163
|
+
text: JSON.stringify(index, null, 2)
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
async readAgentsIndex() {
|
|
167
|
+
const index = await this.adapter.fetchIndex();
|
|
168
|
+
const agentsList = index.agents.map(agent => ({
|
|
169
|
+
name: agent.name,
|
|
170
|
+
description: agent.description,
|
|
171
|
+
tags: agent.tags,
|
|
172
|
+
path: agent.path,
|
|
173
|
+
url: agent.url
|
|
174
|
+
}));
|
|
175
|
+
return {
|
|
176
|
+
uri: 'awesome://agents/index',
|
|
177
|
+
mimeType: 'application/json',
|
|
178
|
+
text: JSON.stringify(agentsList, null, 2)
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
async readPromptsIndex() {
|
|
182
|
+
const index = await this.adapter.fetchIndex();
|
|
183
|
+
const promptsList = index.prompts.map(prompt => ({
|
|
184
|
+
name: prompt.name,
|
|
185
|
+
description: prompt.description,
|
|
186
|
+
tags: prompt.tags,
|
|
187
|
+
path: prompt.path,
|
|
188
|
+
url: prompt.url
|
|
189
|
+
}));
|
|
190
|
+
return {
|
|
191
|
+
uri: 'awesome://prompts/index',
|
|
192
|
+
mimeType: 'application/json',
|
|
193
|
+
text: JSON.stringify(promptsList, null, 2)
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async readInstructionsIndex() {
|
|
197
|
+
const index = await this.adapter.fetchIndex();
|
|
198
|
+
const instructionsList = index.instructions.map(instruction => ({
|
|
199
|
+
name: instruction.name,
|
|
200
|
+
description: instruction.description,
|
|
201
|
+
tags: instruction.tags,
|
|
202
|
+
path: instruction.path,
|
|
203
|
+
url: instruction.url
|
|
204
|
+
}));
|
|
205
|
+
return {
|
|
206
|
+
uri: 'awesome://instructions/index',
|
|
207
|
+
mimeType: 'application/json',
|
|
208
|
+
text: JSON.stringify(instructionsList, null, 2)
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
async readSkillsIndex() {
|
|
212
|
+
const index = await this.adapter.fetchIndex();
|
|
213
|
+
const skillsList = index.skills.map(skill => ({
|
|
214
|
+
name: skill.name,
|
|
215
|
+
description: skill.description,
|
|
216
|
+
tags: skill.tags,
|
|
217
|
+
path: skill.path,
|
|
218
|
+
url: skill.url
|
|
219
|
+
}));
|
|
220
|
+
return {
|
|
221
|
+
uri: 'awesome://skills/index',
|
|
222
|
+
mimeType: 'application/json',
|
|
223
|
+
text: JSON.stringify(skillsList, null, 2)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
async readCollectionsIndex() {
|
|
227
|
+
const index = await this.adapter.fetchIndex();
|
|
228
|
+
const collectionsList = index.collections.map(collection => ({
|
|
229
|
+
name: collection.name,
|
|
230
|
+
description: collection.description,
|
|
231
|
+
tags: collection.tags,
|
|
232
|
+
items: collection.items,
|
|
233
|
+
path: collection.path,
|
|
234
|
+
url: collection.url
|
|
235
|
+
}));
|
|
236
|
+
return {
|
|
237
|
+
uri: 'awesome://collections/index',
|
|
238
|
+
mimeType: 'application/json',
|
|
239
|
+
text: JSON.stringify(collectionsList, null, 2)
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
async readAgentByName(uri) {
|
|
243
|
+
const name = uri.replace('awesome://agents/', '');
|
|
244
|
+
const index = await this.adapter.fetchIndex();
|
|
245
|
+
const agent = index.agents.find(a => a.name === name);
|
|
246
|
+
if (!agent) {
|
|
247
|
+
throw new Error(`Agent not found: "${name}". \nHint: Resource templates require an EXACT name match. If you are unsure of the name, use "awesome://search/agents/${name}" to search, or check "awesome://agents/index" for a full list of available agents.`);
|
|
248
|
+
}
|
|
249
|
+
// Return URL for direct download instead of content
|
|
250
|
+
return {
|
|
251
|
+
uri,
|
|
252
|
+
mimeType: 'application/json',
|
|
253
|
+
text: JSON.stringify({ name: agent.name, type: agent.type, url: agent.url, path: agent.path, description: agent.description })
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
async readPromptByName(uri) {
|
|
257
|
+
const name = uri.replace('awesome://prompts/', '');
|
|
258
|
+
const index = await this.adapter.fetchIndex();
|
|
259
|
+
const prompt = index.prompts.find(p => p.name === name);
|
|
260
|
+
if (!prompt) {
|
|
261
|
+
throw new Error(`Prompt not found: "${name}". \nHint: Resource templates require an EXACT name match. If you are unsure of the name, use "awesome://search/prompts/${name}" to search, or check "awesome://prompts/index" for a full list of available prompts.`);
|
|
262
|
+
}
|
|
263
|
+
// Return URL for direct download instead of content
|
|
264
|
+
return {
|
|
265
|
+
uri,
|
|
266
|
+
mimeType: 'application/json',
|
|
267
|
+
text: JSON.stringify({ name: prompt.name, type: prompt.type, url: prompt.url, path: prompt.path, description: prompt.description })
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
async readInstructionByName(uri) {
|
|
271
|
+
const name = uri.replace('awesome://instructions/', '');
|
|
272
|
+
const index = await this.adapter.fetchIndex();
|
|
273
|
+
const instruction = index.instructions.find(i => i.name === name);
|
|
274
|
+
if (!instruction) {
|
|
275
|
+
throw new Error(`Instruction not found: "${name}". \nHint: Resource templates require an EXACT name match. If you are unsure of the name, use "awesome://search/instructions/${name}" to search, or check "awesome://instructions/index" for a full list of available instructions.`);
|
|
276
|
+
}
|
|
277
|
+
// Return URL for direct download instead of content
|
|
278
|
+
return {
|
|
279
|
+
uri,
|
|
280
|
+
mimeType: 'application/json',
|
|
281
|
+
text: JSON.stringify({ name: instruction.name, type: instruction.type, url: instruction.url, path: instruction.path, description: instruction.description })
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
async readSkillByName(uri) {
|
|
285
|
+
const name = uri.replace('awesome://skills/', '');
|
|
286
|
+
const index = await this.adapter.fetchIndex();
|
|
287
|
+
const skill = index.skills.find(s => s.name === name);
|
|
288
|
+
if (!skill) {
|
|
289
|
+
throw new Error(`Skill not found: "${name}". \nHint: Resource templates require an EXACT name match. If you are unsure of the name, use "awesome://search/skills/${name}" to search, or check "awesome://skills/index" for a full list of available skills.`);
|
|
290
|
+
}
|
|
291
|
+
// Return URL for direct download instead of content
|
|
292
|
+
return {
|
|
293
|
+
uri,
|
|
294
|
+
mimeType: 'application/json',
|
|
295
|
+
text: JSON.stringify({ name: skill.name, type: skill.type, url: skill.url, path: skill.path, description: skill.description })
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
async readCollectionByName(uri) {
|
|
299
|
+
const name = uri.replace('awesome://collections/', '');
|
|
300
|
+
const index = await this.adapter.fetchIndex();
|
|
301
|
+
const collection = index.collections.find(c => c.name === name);
|
|
302
|
+
if (!collection) {
|
|
303
|
+
throw new Error(`Collection not found: "${name}". \nHint: Resource templates require an EXACT name match. If you are unsure of the name, use "awesome://search/collections/${name}" to search, or check "awesome://collections/index" for a full list of available collections.`);
|
|
304
|
+
}
|
|
305
|
+
return {
|
|
306
|
+
uri,
|
|
307
|
+
mimeType: 'application/json',
|
|
308
|
+
text: JSON.stringify(collection, null, 2)
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
async readSearchResults(uri) {
|
|
312
|
+
// Parse URI: awesome://search/{type}/{query}
|
|
313
|
+
const parts = uri.replace('awesome://search/', '').split('/');
|
|
314
|
+
if (parts.length < 2) {
|
|
315
|
+
throw new Error('Invalid search URI format. Expected: awesome://search/{type}/{query}');
|
|
316
|
+
}
|
|
317
|
+
const type = parts[0];
|
|
318
|
+
const query = parts.slice(1).join('/').toLowerCase();
|
|
319
|
+
const index = await this.adapter.fetchIndex();
|
|
320
|
+
const results = [];
|
|
321
|
+
// Search based on type
|
|
322
|
+
if (type === 'agents' || type === 'all') {
|
|
323
|
+
const agentResults = index.agents.filter(agent => agent.name.toLowerCase().includes(query) ||
|
|
324
|
+
agent.description.toLowerCase().includes(query) ||
|
|
325
|
+
agent.tags.some(tag => tag.toLowerCase().includes(query)));
|
|
326
|
+
results.push(...agentResults);
|
|
327
|
+
}
|
|
328
|
+
if (type === 'prompts' || type === 'all') {
|
|
329
|
+
const promptResults = index.prompts.filter(prompt => prompt.name.toLowerCase().includes(query) ||
|
|
330
|
+
prompt.description.toLowerCase().includes(query) ||
|
|
331
|
+
prompt.tags.some(tag => tag.toLowerCase().includes(query)));
|
|
332
|
+
results.push(...promptResults);
|
|
333
|
+
}
|
|
334
|
+
if (type === 'instructions' || type === 'all') {
|
|
335
|
+
const instructionResults = index.instructions.filter(instruction => instruction.name.toLowerCase().includes(query) ||
|
|
336
|
+
instruction.description.toLowerCase().includes(query) ||
|
|
337
|
+
instruction.tags.some(tag => tag.toLowerCase().includes(query)));
|
|
338
|
+
results.push(...instructionResults);
|
|
339
|
+
}
|
|
340
|
+
if (type === 'skills' || type === 'all') {
|
|
341
|
+
const skillResults = index.skills.filter(skill => skill.name.toLowerCase().includes(query) ||
|
|
342
|
+
skill.description.toLowerCase().includes(query) ||
|
|
343
|
+
skill.tags.some(tag => tag.toLowerCase().includes(query)));
|
|
344
|
+
results.push(...skillResults);
|
|
345
|
+
}
|
|
346
|
+
if (type === 'collections' || type === 'all') {
|
|
347
|
+
const collectionResults = index.collections.filter(collection => collection.name.toLowerCase().includes(query) ||
|
|
348
|
+
collection.description.toLowerCase().includes(query) ||
|
|
349
|
+
collection.tags.some(tag => tag.toLowerCase().includes(query)));
|
|
350
|
+
results.push(...collectionResults);
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
uri,
|
|
354
|
+
mimeType: 'application/json',
|
|
355
|
+
text: JSON.stringify({
|
|
356
|
+
query,
|
|
357
|
+
type,
|
|
358
|
+
count: results.length,
|
|
359
|
+
results
|
|
360
|
+
}, null, 2)
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
async readResourcesByTag(uri) {
|
|
364
|
+
// Parse URI: awesome://tags/{tag}
|
|
365
|
+
const tag = uri.replace('awesome://tags/', '').toLowerCase();
|
|
366
|
+
const index = await this.adapter.fetchIndex();
|
|
367
|
+
const results = {
|
|
368
|
+
tag,
|
|
369
|
+
agents: index.agents.filter(a => a.tags.some(t => t.toLowerCase() === tag)),
|
|
370
|
+
prompts: index.prompts.filter(p => p.tags.some(t => t.toLowerCase() === tag)),
|
|
371
|
+
instructions: index.instructions.filter(i => i.tags.some(t => t.toLowerCase() === tag)),
|
|
372
|
+
skills: index.skills.filter(s => s.tags.some(t => t.toLowerCase() === tag)),
|
|
373
|
+
collections: index.collections.filter(c => c.tags.some(t => t.toLowerCase() === tag))
|
|
374
|
+
};
|
|
375
|
+
const totalCount = results.agents.length + results.prompts.length +
|
|
376
|
+
results.instructions.length + results.skills.length +
|
|
377
|
+
results.collections.length;
|
|
378
|
+
return {
|
|
379
|
+
uri,
|
|
380
|
+
mimeType: 'application/json',
|
|
381
|
+
text: JSON.stringify({
|
|
382
|
+
tag,
|
|
383
|
+
totalCount,
|
|
384
|
+
agents: results.agents,
|
|
385
|
+
prompts: results.prompts,
|
|
386
|
+
instructions: results.instructions,
|
|
387
|
+
skills: results.skills,
|
|
388
|
+
collections: results.collections
|
|
389
|
+
}, null, 2)
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
exports.MCPResources = MCPResources;
|
|
394
|
+
//# sourceMappingURL=mcp-resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-resources.js","sourceRoot":"","sources":["../src/mcp-resources.ts"],"names":[],"mappings":";;;AAEA,qCAAkC;AAQlC,MAAa,YAAY;IACb,OAAO,CAAgB;IAE/B,YAAY,OAAsB;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY;QACd,OAAO;YACH;gBACI,GAAG,EAAE,oBAAoB;gBACzB,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EAAE,0EAA0E;gBACvF,QAAQ,EAAE,kBAAkB;aAC/B;YACD;gBACI,GAAG,EAAE,wBAAwB;gBAC7B,IAAI,EAAE,cAAc;gBACpB,WAAW,EAAE,iCAAiC;gBAC9C,QAAQ,EAAE,kBAAkB;aAC/B;YACD;gBACI,GAAG,EAAE,yBAAyB;gBAC9B,IAAI,EAAE,eAAe;gBACrB,WAAW,EAAE,+BAA+B;gBAC5C,QAAQ,EAAE,kBAAkB;aAC/B;YACD;gBACI,GAAG,EAAE,8BAA8B;gBACnC,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,oCAAoC;gBACjD,QAAQ,EAAE,kBAAkB;aAC/B;YACD;gBACI,GAAG,EAAE,wBAAwB;gBAC7B,IAAI,EA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gBACjB,GAAG;gBACH,UAAU;gBACV,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,WAAW,EAAE,OAAO,CAAC,WAAW;aACnC,EAAE,IAAI,EAAE,CAAC,CAAC;SACd,CAAC;IACN,CAAC;CACJ;AAvbD,oCAubC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RepoConfig } from './types';
|
|
2
|
+
export declare class MCPServer {
|
|
3
|
+
private server;
|
|
4
|
+
private tools;
|
|
5
|
+
private prompts;
|
|
6
|
+
private resources;
|
|
7
|
+
constructor(config: RepoConfig);
|
|
8
|
+
start(): Promise<void>;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=mcp-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKrC,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,SAAS,CAAe;gBAEpB,MAAM,EAAE,UAAU;IAoBxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAI5B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MCPServer = void 0;
|
|
7
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
8
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
9
|
+
const mcp_tools_1 = require("./mcp-tools");
|
|
10
|
+
const mcp_prompts_1 = require("./mcp-prompts");
|
|
11
|
+
const mcp_resources_1 = require("./mcp-resources");
|
|
12
|
+
const github_adapter_1 = require("./github-adapter");
|
|
13
|
+
const logger_1 = require("./logger");
|
|
14
|
+
const mcp_shared_1 = require("./mcp-shared");
|
|
15
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
|
16
|
+
class MCPServer {
|
|
17
|
+
server;
|
|
18
|
+
tools;
|
|
19
|
+
prompts;
|
|
20
|
+
resources;
|
|
21
|
+
constructor(config) {
|
|
22
|
+
const adapter = new github_adapter_1.GitHubAdapter(config);
|
|
23
|
+
this.tools = new mcp_tools_1.MCPTools(adapter);
|
|
24
|
+
this.prompts = new mcp_prompts_1.MCPPrompts();
|
|
25
|
+
this.resources = new mcp_resources_1.MCPResources(adapter);
|
|
26
|
+
this.server = new index_js_1.Server({
|
|
27
|
+
name: 'awesome-copilot-mcp',
|
|
28
|
+
version: package_json_1.default.version,
|
|
29
|
+
}, {
|
|
30
|
+
capabilities: {
|
|
31
|
+
tools: {},
|
|
32
|
+
prompts: {},
|
|
33
|
+
resources: {},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
(0, mcp_shared_1.registerMcpHandlers)(this.server, this.tools, this.prompts, this.resources);
|
|
37
|
+
}
|
|
38
|
+
async start() {
|
|
39
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
40
|
+
await this.server.connect(transport);
|
|
41
|
+
logger_1.logger.info('MCP Server started and connected');
|
|
42
|
+
}
|
|
43
|
+
async stop() {
|
|
44
|
+
await this.server.close();
|
|
45
|
+
logger_1.logger.info('MCP Server stopped');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.MCPServer = MCPServer;
|
|
49
|
+
//# sourceMappingURL=mcp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