This is an MCP server that converts markdown text to HTML.
- .NET 10 SDK
- Visual Studio Code with
- C# Dev Kit extension
- Azure CLI
- Azure Developer CLI
- Docker Desktop
Markdown to HTML MCP server includes:
| Building Block | Name | Description | Usage |
|---|---|---|---|
| Tools | convert_markdown_to_html |
Converts markdown document to HTML. | #convert_markdown_to_html |
-
Get the repository root.
# bash/zsh REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
# PowerShell $REPOSITORY_ROOT = git rev-parse --show-toplevel
-
Run the MCP server app.
cd $REPOSITORY_ROOT/markdown-to-html dotnet run --project ./src/McpSamples.MarkdownToHtml.HybridApp
Make sure take note the absolute directory path of the
McpSamples.MarkdownToHtml.HybridAppproject.Parameters:
--http: The switch that indicates to run this MCP server as a streamable HTTP type. When this switch is added, the MCP server URL ishttp://localhost:5280.--tech-community/-tc: The switch that indicates to convert the markdown text to HTML specific to Microsoft Tech Community.--extra-paragraph/-p: The switch that indicates whether to put extra paragraph between the given HTML elements that is defined by the--tagsargument.--tags: The comma delimited list of HTML tags that adds extra paragraph in between. Default value isp,blockquote,h1,h2,h3,h4,h5,h6,ol,ul,dl
With these parameters, you can run the MCP server like:
dotnet run --project ./src/McpSamples.MarkdownToHtml.HybridApp -- --http -tc -p --tags "p,h1,h2,h3,ol,ul,dl"
-
Build the MCP server app as a container image.
cd $REPOSITORY_ROOT docker build -f Dockerfile.markdown-to-html -t markdown-to-html:latest .
-
Run the MCP server app in a container.
docker run -i --rm -p 8080:8080 markdown-to-html:latest
Alternatively, use the container image from the container registry.
docker run -i --rm -p 8080:8080 ghcr.io/microsoft/mcp-dotnet-samples/markdown-to-html:latest
Parameters:
--http: The switch that indicates to run this MCP server as a streamable HTTP type. When this switch is added, the MCP server URL ishttp://localhost:8080.--tech-community/-tc: The switch that indicates to convert the markdown text to HTML specific to Microsoft Tech Community.--extra-paragraph/-p: The switch that indicates whether to put extra paragraph between the given HTML elements that is defined by the--tagsargument.--tags: The comma delimited list of HTML tags that adds extra paragraph in between. Default value isp,blockquote,h1,h2,h3,h4,h5,h6,ol,ul,dl
With these parameters, you can run the MCP server like:
# use local container image docker run -i --rm -p 8080:8080 markdown-to-html:latest --http -tc -p --tags "p,h1,h2,h3,ol,ul,dl"
# use container image from the container registry docker run -i --rm -p 8080:8080 ghcr.io/microsoft/mcp-dotnet-samples/markdown-to-html:latest --http -tc -p --tags "p,h1,h2,h3,ol,ul,dl"
-
Navigate to the directory.
cd $REPOSITORY_ROOT/markdown-to-html
-
Login to Azure.
# Login with Azure Developer CLI azd auth login -
Deploy the MCP server app to Azure.
azd up
While provisioning and deploying, you'll be asked to provide subscription ID, location, environment name.
-
After the deployment is complete, get the information by running the following commands:
-
Azure Container Apps FQDN:
azd env get-value AZURE_RESOURCE_MCP_MD2HTML_FQDN
-
-
Copy
mcp.jsonto the repository root.For locally running MCP server (STDIO):
mkdir -p $REPOSITORY_ROOT/.vscode cp $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.stdio.local.json \ $REPOSITORY_ROOT/.vscode/mcp.json
New-Item -Type Directory -Path $REPOSITORY_ROOT/.vscode -Force Copy-Item -Path $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.stdio.local.json ` -Destination $REPOSITORY_ROOT/.vscode/mcp.json -Force
For locally running MCP server (HTTP):
mkdir -p $REPOSITORY_ROOT/.vscode cp $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.http.local.json \ $REPOSITORY_ROOT/.vscode/mcp.json
New-Item -Type Directory -Path $REPOSITORY_ROOT/.vscode -Force Copy-Item -Path $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.http.local.json ` -Destination $REPOSITORY_ROOT/.vscode/mcp.json -Force
For locally running MCP server in a container (STDIO):
mkdir -p $REPOSITORY_ROOT/.vscode cp $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.stdio.container.json \ $REPOSITORY_ROOT/.vscode/mcp.json
New-Item -Type Directory -Path $REPOSITORY_ROOT/.vscode -Force Copy-Item -Path $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.stdio.container.json ` -Destination $REPOSITORY_ROOT/.vscode/mcp.json -Force
For locally running MCP server in a container (HTTP):
mkdir -p $REPOSITORY_ROOT/.vscode cp $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.http.container.json \ $REPOSITORY_ROOT/.vscode/mcp.json
New-Item -Type Directory -Path $REPOSITORY_ROOT/.vscode -Force Copy-Item -Path $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.http.container.json ` -Destination $REPOSITORY_ROOT/.vscode/mcp.json -Force
For remotely running MCP server in a container (HTTP):
mkdir -p $REPOSITORY_ROOT/.vscode cp $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.http.remote.json \ $REPOSITORY_ROOT/.vscode/mcp.json
New-Item -Type Directory -Path $REPOSITORY_ROOT/.vscode -Force Copy-Item -Path $REPOSITORY_ROOT/markdown-to-html/.vscode/mcp.http.remote.json ` -Destination $REPOSITORY_ROOT/.vscode/mcp.json -Force
-
Open Command Palette by typing
F1orCtrl+Shift+Pon Windows orCmd+Shift+Pon Mac OS, and searchMCP: List Servers. -
Choose
markdown-to-htmlthen clickStart Server. -
When prompted, enter one of the following values:
- The absolute directory path of the
McpSamples.MarkdownToHtml.HybridAppproject - The FQDN of Azure Container Apps.
- The absolute directory path of the
-
Enter prompt like:
Convert the highlighted markdown text to HTML and save it to `converted.html` at the repository root. DO NOT alter the converted HTML. -
Confirm the result.