Skip to contents

Serves the package over HTTP in a separate R process and runs scenarios of the official MCP conformance suite against it, through npx, which needs Node.js. The default scenarios need no tool of the package; the others call tools, resources and prompts with the names of the suite. Not supported on Windows yet.

Usage

expect_conformance(
  scenarios = c("server-initialize", "server-session-lifecycle", "ping",
    "logging-set-level", "tools-list", "resources-list", "prompts-list",
    "dns-rebinding-protection", "server-sse-multiple-streams", "caching",
    "http-header-validation", "sep-2164-resource-not-found"),
  package = testthat::testing_package(),
  version = "0.2.0-alpha.12",
  timeout = 60
)

Arguments

scenarios

The scenarios to run, as npx @modelcontextprotocol/conformance list --server names them.

package

Package that serves the tool, by default the one being tested.

version

The version of the suite.

timeout

Seconds to wait for the server to start.

Value

The checks of the suite, invisibly.

Examples

if (FALSE) { # \dontrun{
# In the tests of a package made by create_mordew(), with Node.js:
expect_conformance()
} # }