MC

modelcontextprotocol/conformance

Developer toolsОфициальный

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

140 stars 119 forks Качество 64 Тренд 36NOASSERTION

modelcontextprotocol/conformance — это кандидат на MCP-сервер, импортированный из https://github.com/modelcontextprotocol/conformance.

Обзор

modelcontextprotocol/conformance — это кандидат на MCP-сервер, импортированный из https://github.com/modelcontextprotocol/conformance.

Обзор (машинный перевод)

Фреймворк для тестирования клиентских и серверных реализаций MCP (Model Context Protocol) по спецификации.

Для тех, кто поддерживает SDK: Смотрите руководство по интеграции SDK Integration Guide для упрощённого руководства по интеграции тестов соответствия в ваш репозиторий SDK.

Быстрый старт

Тестируемые клиенты

Тестовые серверы

Список доступных сценариев

Обзор

Фреймворк тестирования соответствия проверяет реализации MCP посредством:

Для клиентов:

  1. Запуск тестового сервера для указанного сценария
  2. Запуск клиентской реализации с URL тестового сервера
  3. Фиксация взаимодействий протокола MCP
  4. Проведение проверок соответствия спецификации
  5. Получение подробных результатов тестов

Для серверов:

  1. Подключение к работающему серверу в качестве MCP-клиента
  2. Отправка тестовых запросов и сбор ответов
  3. Проверка соответствия поведению сервера
  4. Получение подробных результатов тестов

Использование

Тестирование клиентов

Варианты:

  • --command - Команда запуска вашего MCP-клиента (может включать флаги)
  • --scenario - Тестовый сценарий для запуска (например, «инициализация»)

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP Conformance Test Framework

A framework for testing MCP (Model Context Protocol) client and server implementations against the specification.

For SDK maintainers: See SDK Integration Guide for a streamlined guide on integrating conformance tests into your SDK repository.

Quick Start

Testing Clients

# Using the everything-client (recommended)
npx @modelcontextprotocol/conformance client --command "tsx examples/clients/typescript/everything-client.ts" --scenario initialize

# Run an entire suite of tests
npx @modelcontextprotocol/conformance client --command "tsx examples/clients/typescript/everything-client.ts" --suite auth

Testing Servers

# Run all server scenarios (default)
npx @modelcontextprotocol/conformance server --url http://localhost:3000/mcp

# Run a single scenario
npx @modelcontextprotocol/conformance server --url http://localhost:3000/mcp --scenario server-initialize

List Available Scenarios

npx @modelcontextprotocol/conformance list

Overview

The conformance test framework validates MCP implementations by:

For Clients:

  1. Starting a test server for the specified scenario
  2. Running the client implementation with the test server URL
  3. Capturing MCP protocol interactions
  4. Running conformance checks against the specification
  5. Generating detailed test results

For Servers:

  1. Connecting to the running server as an MCP client
  2. Sending test requests and capturing responses
  3. Running conformance checks against server behavior
  4. Generating detailed test results

Usage

Client Testing

npx @modelcontextprotocol/conformance client --command "" --scenario  [options]

Options:

  • --command - The command to run your MCP client (can include flags)
  • --scenario - The test scenario to run (e.g., “initialize”)
  • --suite - Run a suite of tests in parallel: all, core, extensions, backcompat, auth, metadata, draft (scenarios targeting the in-progress draft spec), or sep-835
  • --spec-version - Filter scenarios by spec version (e.g., 2025-11-25, 2026-07-28; draft is accepted as an alias for the current draft identifier). The draft version selects the latest dated release plus any draft-only scenarios. When omitted, the version is inferred from the scenario’s spec applicability (draft-only scenarios run at the draft version, everything else at the latest dated release); an explicitly requested version outside a scenario’s applicability window skips the scenario (exit 0) unless --force is passed
  • --force - Run a scenario even if it is not applicable at the requested --spec-version
  • --requirements - Run exactly what a spec revision requires, frozen at its release (see Conformance Requirements)
Открыть полный README на GitHub

Установка

npx @modelcontextprotocol/conformance client --command "tsx examples/clients/typescript/everything-client.ts" --scenario initialize
Новичок в MCP? Начните с руководства на mcpskill.org →