Token导航 LogoToken导航TokenDH.com
MCP Testing Library logo
开发工具未说明官方级别未说明来源级核验

MCP Testing Library

MCP Server

Test environment for MCP servers

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
命令行工具测试框架TypeScript开发工具本地部署

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

moekiorg

提供方

moekiorg

最后核验

2026/5/18 04:39

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

MCP测试库

用于运行模型上下文协议(MCP)测试的CLI工具。

特性

  • 用于运行MCP测试的CLI工具
  • 支持运行单个测试文件或测试模式
  • 可配置的测试超时和排除模式
  • 详细输出的详细模式
  • 用TypeScript编写,完全支持类型
  • 与模型上下文协议SDK兼容
  • 彩色测试输出,可读性更好
  • 全面的测试覆盖率

安装

要在项目中作为开发依赖项安装,请执行以下操作:

npm install --save-dev mcp-testing-library

用法

命令行选项

Usage: mcpt [options] [test-files...]

Options:
  -v, --version             output version number
  -e, --exclude 
  Exclude files matching the pattern (comma-separated)
                           (default: "**/node_modules/**,**/dist/**")
  -t, --timeout         Set test timeout in milliseconds (default: "30000")
  --pattern           Test file pattern to match (default: "**/*.test.{js,ts}")
  --no-color                Disable colored output
  -h, --help                display help for command

例子

运行项目中的所有测试:

mcpt

运行特定的测试文件:

mcpt sample/index.test.ts

运行超时时间较长的测试:

mcpt --timeout 10000

运行没有颜色输出的测试:

mcpt --no-color

排除特定目录:

mcpt --exclude "**/node_modules/**,**/dist/**,**/build/**"

在代码中使用

您还可以直接在代码中使用MCP测试实用程序:

import { mcpt, expect } from 'mcp-testing-library';

// Test a filesystem MCP server
mcpt(
  {
    command: 'npx',
    args: ['-y', '@modelcontextprotocol/server-filesystem', '/path/to/directory'],
  },
  async ({ tools, prompts, resources, isMethodExist }) => {
    expect(tools.length).to.be.greaterThan(0);
    expect(await isMethodExist('list-tools')).to.eq(true);

    // More assertions...
  }
);

许可证

麻省理工学院

目录标签

目录标签

命令行工具测试框架TypeScript开发工具本地部署developer-toolsCLI工具模型上下文协议

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP