DNN API Server (.NET C# Version)
LocalAbout DNN API Server (.NET C# Version)
DNN API Server (.NET C# Version) is a C# MCP server for interacting with DNN Platform through its APIs. It provides host and portal management tools and supports configuration for multiple sites.
Key features
- 01DNN API authentication
- 02Retrieve host settings
- 03Clear the DNN cache
- 04Retrieve and list portals
- 05Configure sites with environment variables or JSON
- 06Extend tools with MCP SDK attributes
Use cases
- 01Checking DNN host settings
- 02Clearing a site's cache
- 03Retrieving portal details or listing portals
- 04Selecting a site configuration from a JSON file
MCP support
Exposes DNN Platform API operations as MCP tools, including host settings, cache clearing, and portal details. The server uses the official ModelContextProtocol SDK.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEDNN 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
{
"sites": {
"dnn18": {
"url": "https://your-dnn-site.com",
"token": "your-jwt-token",
"expires": "2025-12-31"
}
}
}
Building and Running
cd DnnApiServer
dotnet build
dotnet run
Available Tools
Host Tools
get_host: Get DNN host settingsclear_cache: Clear DNN cache
Portal Tools
get_portal: Get portal detailslist_portals: List all portals
Adding New Tools
To add new tools, simply add new methods to the DnnTools class:
- Open
Tools/DnnTools.cs - Add a new method in the appropriate region (or create a new region)
- Decorate the method with the
[McpServerTool]and[Description]attributes - Rebuild the project
For example:
[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
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.