
dnn dotnet mcp server
使用 C# 和 .NET 实现的 DNN 平台 Model Context Protocol (MCP) 服务器。
Repository Info
About This Server
使用 C# 和 .NET 实现的 DNN 平台 Model Context Protocol (MCP) 服务器。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
# DNN API Server (.NET C# Version)
A Model Context Protocol (MCP) server for DNN Platform written in C# using .NET.
## Overview
This server implements the Model Context Protocol to provide tools for interacting with DNN Platform through its APIs. It's a C# port of the Node.js implementation using the official ModelContextProtocol SDK.
## Features
- Authentication with DNN API
- Host management tools
- Portal management tools
- Support for site configuration via environment variables or JSON file
- Easily extensible using MCP SDK attributes
## Requirements
- .NET 7.0 or higher
- DNN Platform instance
## Configuration
The server can be configured using environment variables:
- `DNN_API_URL`: URL to your DNN installation API (required)
- `DNN_USERNAME`: DNN username (required if not using a token)
- `DNN_PASSWORD`: DNN password (required if not using a token)
- `DNN_SITES_FILE`: Path to a JSON file containing site configurations (optional)
- `DNN_SITE`: Name of the site configuration to use from the sites file (optional, default: "dnn18")
### Site Configuration File Format
```json
{
"sites": {
"dnn18": {
"url": "https://your-dnn-site.com",
"token": "your-jwt-token",
"expires": "2025-12-31"
}
}
}
```
## Building and Running
```bash
cd DnnApiServer
dotnet build
dotnet run
```
## Available Tools
### Host Tools
- `get_host`: Get DNN host settings
- `clear_cache`: Clear DNN cache
### Portal Tools
- `get_portal`: Get portal details
- `list_portals`: List all portals
## Adding New Tools
To add new tools, simply add new methods to the DnnTools class:
1. Open `Tools/DnnTools.cs`
2. Add a new method in the appropriate region (or create a new region)
3. Decorate the method with the `[McpServerTool]` and `[Description]` attributes
4. Rebuild the project
For example:
```csharp
[McpServerTool]
[Description("Get page details")]
public async Task<string> GetPage(int pageId, int portalId)
{
var data = await ExecuteCommandAsync(portalId, $"get-page --id {pageId}");
return JsonSerializer.Serialize(data, new JsonSerializerOptions { WriteIndented = true });
}
```
## License
MIT Quick Start
Clone the repository
git clone https://github.com/sachatrauwaen/dnn-dotnet-mcp--serverInstall dependencies
cd dnn-dotnet-mcp--server
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.