A generic, reusable MCP (Model Context Protocol) engine that discovers and exposes Agent Skills as MCP Prompts and Resources. Built on the MCP C# SDK.
For Orchard Core–specific skills, see the companion package CrestApps.AgentSkills.Mcp.OrchardCore, which builds on top of this project and bundles Orchard Core skills.
dotnet add package CrestApps.AgentSkills.Mcpbuilder.Services.AddMcpServer(mcp =>
{
mcp.AddAgentSkills();
});To register the skill services in DI without eagerly loading them:
builder.Services.AddAgentSkillServices();The consumer is then responsible for resolving IMcpPromptProvider and IMcpResourceProvider and attaching them to the MCP server.
builder.Services.AddMcpServer(mcp =>
{
mcp.AddAgentSkills(options =>
{
options.Path = "./my-skills";
});
});The file store and providers are registered as singletons and can be injected:
public sealed class MyService
{
private readonly IMcpPromptProvider _promptProvider;
private readonly IMcpResourceProvider _resourceProvider;
public MyService(
IMcpPromptProvider promptProvider,
IMcpResourceProvider resourceProvider)
{
_promptProvider = promptProvider;
_resourceProvider = resourceProvider;
}
public async Task ListPromptsAsync()
{
var prompts = await _promptProvider.GetPromptsAsync();
// ...
}
}Skills are discovered from subdirectories under the configured skills path. Each skill directory must contain one of the following skill definition files:
A SKILL.md file with YAML front-matter:
---
name: my-skill
description: A description of my skill.
---
# Prompt content
This is the body that becomes the MCP prompt.A SKILL.yaml or SKILL.yml file:
name: my-skill
description: A description of my skill.
body: |
# Prompt content
This is the body that becomes the MCP prompt.Both formats require:
| Field | Description |
|---|---|
name |
Unique skill identifier |
description |
Human-readable description |
The body field (or Markdown body after front-matter) provides the prompt content.
Each skill directory may include a references/ subdirectory containing additional .md files. These are exposed as MCP Resources:
.agents/skills/
my-skill/
SKILL.md (or SKILL.yaml / SKILL.yml)
references/
example1.md
example2.md
| MCP Type | Source | Description |
|---|---|---|
| Prompts | Skill file body content | Prompt templates from SKILL.md body or SKILL.yaml body field |
| Resources | Skill files | Full skill file content (metadata + body) |
| Resources | references/*.md files |
Additional reference documents for each skill |
| Service | Lifetime | Purpose |
|---|---|---|
IAgentSkillFilesStore |
Singleton | Abstraction for skill file access |
IMcpPromptProvider |
Singleton | Reads skill files → cached McpServerPrompt instances |
IMcpResourceProvider |
Singleton | Reads skill + reference files → cached McpServerResource instances |
| Parser | Formats | Purpose |
|---|---|---|
SkillFrontMatterParser |
.md |
Parses YAML front-matter from Markdown files |
SkillYamlParser |
.yaml, .yml |
Parses YAML skill definitions |
SkillFileParser |
All | Unified parser that detects format and delegates |
- Place skill directories under
.agents/skills/(or a custom path). - Each skill directory contains a
SKILL.md,SKILL.yaml, orSKILL.ymlfile. AddAgentSkills()registersIAgentSkillFilesStore,IMcpPromptProvider, andIMcpResourceProvideras singletons.- At runtime, providers discover skill files, parse metadata, and create MCP prompts/resources.
- Results are cached after the first call for optimal performance.
- MCP clients can discover and use these prompts and resources via the MCP protocol.
dotnet builddotnet testPlace your skill files in a directory and use the test infrastructure:
var fileStore = new PhysicalSkillFileStore("/path/to/skills");
var provider = new SkillPromptProvider(fileStore, NullLogger<SkillPromptProvider>.Instance);
var prompts = await provider.GetPromptsAsync();CrestApps.AgentSkills.Mcp ← Generic, reusable MCP engine (this package)
This is the base package that other skill distribution packages can build upon.
- .NET 10.0+
- MCP C# SDK (
ModelContextProtocolNuGet package) - An MCP server host (e.g., ASP.NET Core with
ModelContextProtocol.AspNetCore)
This project is licensed under the MIT License.