Model Context Protocol (MCP)
Table of Contents
Model Context Protocol (MCP)
The Model Context Protocol (MCP) is an open standard that allows seamless integration between large language model (LLM) applications and external tools or data sources. Whether you're building an AI-enhanced IDE, a chat interface, or custom AI workflows, MCP makes it easy to supply LLMs with the context they need.
Features
Model Context Protocol (MCP) Client Feature
The Model Context Protocol (MCP) Client Feature enables your application to connect to remote MCP servers using standard HTTP requests. One of the supported transport types is Server-Sent Events (SSE), which allows real-time data flow between LLMs and external services.
🛠 Connect to a Remote MCP Server (SSE Transport)
To connect your application to a remote MCP server using SSE:
- Open your Orchard Core project.
- Navigate to Artificial Intelligence → MCP Connections.
- Click the Add Connection button.
- Under the Server Sent Events (SSE) source, click Add.
- Enter the following connection details:
- Display Text:
Remote AI Time Server - Endpoint:
https://localhost:1234/ - Additional Headers: Leave empty or supply any required headers.
- Display Text:
- Save the connection.
➕ Create an AI Profile
Now that the connection is added, you can create an AI profile that uses this connection:
👉 Learn how to create an AI Profile
📄 Alternative: Recipe-Based Setup (SSE)
You can also configure the SSE connection programmatically using a recipe:
{
"steps": [
{
"name": "McpConnection",
"connections": [
{
"DisplayText": "Example server",
"Properties": {
"SseMcpConnectionMetadata": {
"Endpoint": "https://localhost:1234/",
"AdditionalHeaders": {}
}
}
}
]
}
]
}
Model Context Protocol (Local MCP) Client Feature
The Local MCP Client Feature allows your application to connect to MCP servers running locally, typically in containers. It uses Standard Input/Output (Stdio) for communication — ideal for offline tools or running local services.
🌐 Example Use Case: Global Time Capabilities with mcp/time
Let's equip your AI model with time zone intelligence using the mcp/time Docker image.
🧭 Step-by-Step: Connect to a Local MCP Server (Stdio Transport)
Step 1: Install Docker Desktop
Download and install Docker Desktop, then launch the app.
Step 2: Pull the MCP Docker Image
- Open Docker Desktop.
- Search for
mcp/timein the Docker Hub tab. - Click on the image and hit Pull.
Step 3: Add the Connection via Orchard Core
- Open your Orchard Core project.
- Navigate to Artificial Intelligence → MCP Connections.
- Click the Add Connection button.
- Under the Standard Input/Output (Stdio) source, click Add.
- Enter the following connection details:
- Display Text:
Global Time Capabilities - Command:
docker - Command Arguments:
["run", "-i", "--rm", "mcp/time"]
- Display Text:
💡 These arguments are based on the official usage from the mcp/time Docker Hub page.
➕ Create an AI Profile
Now that the connection is added, you can create an AI profile that uses it:
👉 Learn how to create an AI Profile
📄 Alternative: Recipe-Based Setup (Stdio)
Prefer configuration through code? Here's how to define the same connection using a recipe:
{
"steps": [
{
"name": "McpConnection",
"connections": [
{
"DisplayText": "Global Time Capabilities",
"Properties": {
"StdioMcpConnectionMetadata": {
"Command": "docker",
"Arguments": [
"run",
"-i",
"--rm",
"mcp/time"
]
}
}
}
]
}
]
}
Model Context Protocol (MCP) Server
The Model Context Protocol (MCP) Server Feature allows your Orchard Core application to expose its AI tools and capabilities to external MCP clients. This feature supports the SSE transport type, enabling real-time communication.
Prompt Support
The MCP server also exposes MCP prompts registered in Orchard Core, so clients can list and invoke prompts via ListPrompts and GetPrompt.
Resource Support
The MCP server exposes MCP resources registered in Orchard Core, allowing clients to access various data sources through the MCP protocol. See MCP Resources for details.
MCP Resources
MCP Resources allow you to expose various data sources through the MCP protocol. Resources are type-based, with each type having its own handler that knows how to read and process the resource content.
Built-in Resource Types
| Type | URI Pattern | Description |
|---|---|---|
| File | file://{itemId}/{path} | Local file system access |
| Content | content://{itemId}/... | Orchard Core content items |
| Recipe Schema | recipe-schema://{itemId}/... | JSON schema definitions |
| FTP/FTPS | ftp://{itemId}/{path} | Remote files via FTP (separate module) |
| SFTP | sftp://{itemId}/{path} | Remote files via SSH (separate module) |
Creating Resources via Admin UI
- Navigate to Artificial Intelligence → MCP Resources
- Click Add Resource
- Select a resource type (e.g., File, Content, FTP)
- Fill in the required fields:
- Display Text: A friendly name for the resource
- URI: The resource URI following the type's pattern
- Name: The MCP resource name (used by clients)
- Title: Optional human-readable title
- Description: Optional description
- MIME Type: Content type of the resource
- Configure type-specific settings (e.g., FTP connection details)
- Save the resource
Content Resource Strategies
The Content resource type supports multiple URI patterns through the strategy provider pattern:
| Pattern | Description |
|---|---|
content://{itemId}/id/{contentItemId} | Get a specific content item by ID |
content://{itemId}/{contentType}/list | List all content items of a type |
content://{itemId}/{contentType}/{contentItemId} | Get content item by type and ID |
Extending Content Resources
You can add custom content resource strategies by implementing IContentResourceStrategyProvider:
public class SearchContentResourceStrategy : IContentResourceStrategyProvider
{
public string[] UriPatterns => ["content://{itemId}/{contentType}/search"];
public bool CanHandle(Uri uri)
{
// Check if URI matches your pattern
return uri.Segments.Length >= 4 &&
uri.Segments[^1].TrimEnd('/') == "search";
}
public async Task<ReadResourceResult> ReadAsync(
McpResource resource,
Uri uri,
CancellationToken cancellationToken)
{
// Implement your search logic
}
}
Register your strategy in Startup.cs:
services.AddContentResourceStrategy<SearchContentResourceStrategy>();
The strategy's URI patterns are automatically added to the Content resource type's displayed patterns in the UI.
Registering Custom Resource Types
You can register custom resource types with their handlers:
services.AddMcpResourceType<DatabaseResourceTypeHandler>("database", entry =>
{
entry.DisplayName = S["Database"];
entry.Description = S["Query data from databases."];
entry.UriPatterns = ["db://{itemId}/{table}/{id}"];
});
Implement the handler:
public class DatabaseResourceTypeHandler : IMcpResourceTypeHandler
{
public string Type => "database";
public async Task<ReadResourceResult> ReadAsync(
McpResource resource,
CancellationToken cancellationToken)
{
var uri = new Uri(resource.Resource.Uri);
// Parse URI and query database
// Return ReadResourceResult with content
}
}
Resource Type Modules
Additional resource type handlers are available as separate modules:
Recipe Support
Resources can be exported and imported via recipes:
{
"steps": [
{
"name": "McpResource",
"Resources": [
{
"Source": "file",
"DisplayText": "Configuration File",
"Resource": {
"Uri": "file://abc123/etc/config.json",
"Name": "config-file",
"Description": "Application configuration",
"MimeType": "application/json"
}
}
]
}
]
}
Admin Chat UI with Time MCP Server Integration (MCP Demonstration)

🔍 Explore More MCP Servers
Looking for more MCP-compatible tools? Explore these resources: