Blok.Server.Mcp 2.1.0

dotnet add package Blok.Server.Mcp --version 2.1.0
                    
NuGet\Install-Package Blok.Server.Mcp -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blok.Server.Mcp" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blok.Server.Mcp" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Blok.Server.Mcp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Blok.Server.Mcp --version 2.1.0
                    
#r "nuget: Blok.Server.Mcp, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Blok.Server.Mcp@2.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Blok.Server.Mcp&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Blok.Server.Mcp&version=2.1.0
                    
Install as a Cake Tool

Blok.Server.Mcp

Blok's MCP server inside your ASP.NET Core app. An MCP client can then read and edit Blok documents through your app.

It serves the same six tools as the Node server, @bloklabs/mcp, over stateless streamable HTTP.

Install

It needs .NET 10.

dotnet add package Blok.Server.Mcp

Use

using Blok.Server.Mcp;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddBlokMcp(options =>
{
  options.FilesDirectory = "./docs";
  // Your own check: may this principal open this document?
  options.Authorize = (request, cancellationToken) =>
    ValueTask.FromResult(MayOpen(request.Principal, request.DocumentId, request.Write));
});

var app = builder.Build();

app.MapBlokMcp("/mcp");
app.Run();
  • BlokMcpOptions holds the same choices as the command line flags: the document source, the principal, the schema, handle limits, comments and OAuth.
  • Read documents from a folder with FilesDirectory, or from your own route with DocumentEndpoint.
  • Without Authorize, a registered IBlokAuthorization decides. With neither, every caller reaches every document.
  • MapBlokMcp takes a path, /mcp by default.

To run the server on its own instead, use the Blok.Mcp tool.

Docs

https://blokeditor.com/docs and the server page.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 99 11/8/2026