Skip to content

groupdocs-viewer/GroupDocs.Viewer.Mcp.Tests

Repository files navigation

GroupDocs.Viewer.Mcp.Tests

Integration tests for the GroupDocs.Viewer.Mcp NuGet package — an MCP server that exposes GroupDocs.Viewer as AI-callable tools.

This repository validates the published NuGet artifact end-to-end: it launches the server via dnx, connects as an MCP client, and exercises every advertised tool. It also doubles as a copy-pasteable set of example configs and user-facing how-to guides for every deployment channel.

Documentation

What gets tested

Area Covered by
Package installs and starts via dnx McpServerFixture
MCP handshake, server info, version ToolDiscoveryTests
RenderPage — synthetic PDF + real-sample theory; verifies both TextContentBlock and ImageContentBlock in the response RenderPageTests
GetViewInfo — file type, page count, per-page dimensions for synthetic + real samples GetViewInfoTests
Unknown / corrupted files, password parameter ErrorHandlingTests

Running locally

Requires .NET 10 SDK.

dotnet test

Test a specific published version:

dotnet test -p:McpPackageVersion=26.5.0
# or
MCP_PACKAGE_VERSION=26.5.0 dotnet test

The first run downloads the NuGet package — subsequent runs are cached.

CI

.github/workflows/integration.yml runs on:

  • Every push / PR.
  • Nightly cron — catches regressions in nuget.org, the dnx shim, or the .NET runtime.
  • workflow_dispatch with a package_version input — manual smoke of any version.
  • repository_dispatch (nuget-published) — fires from the main repo's publish pipeline so every release is smoke-tested against live nuget.org.

Matrix: ubuntu-latest, windows-latest, macos-latest.

Evaluation vs licensed mode

GroupDocs.Viewer runs in evaluation mode by default — it produces output files but they are watermarked. The integration tests assert the tool returns a non-error response and the rendered PNG is created; they do not assert watermark-free output unless a license is present.

For CI, store a base64-encoded .lic file as repo secret GROUPDOCS_LICENSE — the workflow decodes it into $RUNNER_TEMP and exports GROUPDOCS_LICENSE_PATH automatically.

Fixture documents

A small synthetic PDF (with Author/Title metadata + a /Contents stream drawing visible text) is built from byte-arrays in SampleDocuments.cs at test startup — no binary files are checked into this repo for those.

Real-format samples live under sample-docs/ and are auto-copied to the test output. The RenderPage_RealSample_… and GetViewInfo_RealSample_… theories exercise both tools against each real sample.

Using this repo as a starter

Copy configs from examples/:

License

MIT — see LICENSE.

About

GroupDocs.Viewer for .NET MCP server integration tests — verify NuGet, Docker Hub, GHCR, and MCP Registry deployments end-to-end.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors