Back to MCP directory
publicPublicdnsLocal runtime

MCPBench

MCPBench是一个用于评估MCP服务器性能的框架,支持Web搜索和数据库查询两种任务的评估,兼容本地和远程服务器,主要评估准确性、延迟和令牌消耗。

article

README

🚀 🦊 MCPBench:用于评估MCP服务器的基准测试

MCPBench是一个用于评估MCP服务器的框架。它支持网络搜索和数据库查询这两种类型的服务器,并且兼容本地和远程MCP服务器。该框架主要在相同的大语言模型(LLM)和代理配置下,从任务完成准确率、延迟和代币消耗等方面对不同的MCP服务器(如Brave Search、DuckDuckGo等)进行评估。这里是 评估报告。其实现基于 LangProBe:语言程序基准测试

文档 包许可证 paperwithcode

English | 中文

🚀 快速开始

📋 新闻

我们发布了MCPBench框架,并附带详细的文档和实验报告。如需了解更多信息,请访问 GitHub 仓库

📦 安装指南

要安装MCPBench,请按照以下步骤操作:

  1. 克隆此仓库:
git clone https://github.com/modelscope/MCPBench.git
  1. 进入项目目录:
cd MCPBench
  1. 安装依赖项:
pip install -r requirements.txt

💻 使用示例

以下是使用MCPBench的基本步骤:

  1. 下载预训练的LLM模型。
  2. 配置MCP服务器。
  3. 运行评估脚本。

基础用法

from mcpbench import *

# 初始化 MCP 服务器
mcp_server = init_mcp_server()

# 加载 LLM 模型
llm_model = load_llm_model()

# 执行评估
results = evaluate(mcp_server, llm_model)

# 输出结果
print(results)

📚 详细文档

📋 数据格式

我们支持以下数据格式:

  1. JSON 格式
{
  "unique_id": "",
  "Prompt": "",
  "Answer": ""
}
  1. CSV 格式
unique_id,Prompt,Answer
,...(更多行)

📜 引用

如果你发现我们的工作对你有帮助,请考虑引用我们的项目:

@misc{mcpbench,
  title={MCPBench: A Benchmark for Evaluating MCP Servers},
  author={Zhiling Luo, Xiaorong Shi, Xuanrui Lin, Jinyang Gao},
  howpublished = {\url{https://github.com/modelscope/MCPBench}},
  year={2025}
}

或者参考我们的报告:

@article{mcpbench_report,
      title={Evaluation Report on MCP Servers}, 
      author={Zhiling Luo, Xiaorong Shi, Xuanrui Lin, Jinyang Gao},
      year={2025},
      journal={arXiv preprint arXiv:2504.11094},
      url={https://arxiv.org/abs/2504.11094},
      primaryClass={cs.AI}
}
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client