dnn-dotnet -
MCP server from sachatrauwaen/dnn-dotnet-mcp--server
claude mcp add --transport stdio sachatrauwaen-dnn-dotnet-mcp--server dotnet run -p DnnApiServer/DnnApiServer.csproj \ --env DNN_SITE="Name of the site configuration to use from the sites file (optional, default: dnn18)" \ --env DNN_API_URL="URL to your DNN installation API (required)" \ --env DNN_PASSWORD="DNN password (required if not using a token)" \ --env DNN_USERNAME="DNN username (required if not using a token)" \ --env DNN_SITES_FILE="Path to a JSON file containing site configurations (optional)"
How to use
This MCP server provides a .NET C# implementation of the Model Context Protocol for interacting with a DNN Platform instance. It exposes tools grouped under Host Tools and Portal Tools to retrieve and manage DNN host settings and portal configurations through the MCP API. The server authenticates against the DNN API and can use a local JSON sites file to select configurations for different environments. Typical usage involves starting the server with the required DNN API URL and credentials, then invoking the available MCP tools through the MCP client to query or modify host and portal data. The project emphasizes extensibility by allowing new MCP tools to be added via attributes on methods in the DnnTools class, making it straightforward to expand capabilities like page management, site settings, or configuration retrieval as your needs evolve.
How to install
Prerequisites:
- .NET 7.0 or higher installed on your system
- Access to a DNN Platform instance
- Git (optional, for cloning the repository)
- Clone the repository or download the source code:
- git clone https://github.com/your-repo/sachatrauwaen-dnn-dotnet-mcp--server.git
- cd sachatrauwaen-dnn-dotnet-mcp--server
- Restore dependencies:
- dotnet restore
- Build the project:
- dotnet build
- Configure environment variables (example):
- On Windows (PowerShell):
$env:DNN_API_URL="https://your-dnn-instance/api"
$env:DNN_USERNAME="your-username"
$env:DNN_PASSWORD="your-password"
Optional:
$env:DNN_SITES_FILE="sites.json" $env:DNN_SITE="dnn18" - On Linux/macOS (bash):
export DNN_API_URL="https://your-dnn-instance/api"
export DNN_USERNAME="your-username"
export DNN_PASSWORD="your-password"
Optional:
export DNN_SITES_FILE="sites.json" export DNN_SITE="dnn18"
- Run the server:
- dotnet run -p DnnApiServer/DnnApiServer.csproj
- Verify the MCP server is running by hitting its MCP endpoints with your MCP client or curl commands as documented in the MCP SDK.
Additional notes
Environment variable usage:
- DNN_API_URL is required to connect to the DNN instance.
- If you prefer token-based authentication, you can bypass DNN_USERNAME and DNN_PASSWORD by providing the token in the API calls or configuring your DNN site configuration accordingly.
- DNN_SITES_FILE can be a local JSON file defining multiple site configurations; if omitted, the default site name dnn18 will be used from the DNN_SITE variable when present.
Common issues:
- Ensure the DNN API URL is reachable from the host running the MCP server.
- Confirm the DNN credentials have the necessary permissions for the operations you intend to perform (host and portal management).
- If you upgrade the .NET runtime, re-build the project to ensure compatibility with the MCP SDK attributes and tooling.
Related MCP Servers
mssql
MSSQL Server MCP implementation written in C#
McpDotNet.Extensions.SemanticKernel
Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.
DatabaseMcpServer
MCP server from ttcc666/DatabaseMcpServer
mcp-dataverse
MCP Server for querying Dataverse using SQL
xperience-community
ASP.NET Core MCP server for Xperience by Kentico projects
console-to-http
Example of converting a stdio MCP server to HTTP using ModelContextProtocol.AspNetCore