Token导航 LogoToken导航

MCP Server · 搜索检索

ZAI MCP Server

ZAI MCP Server 是一个提供网络搜索、内容抓取和基于AI摘要生成功能的服务,利用GLM-4.7-Flash模型快速处理信息。

stdio官方级别未说明来源级核验工具 3
搜索PythonClaudeClaude DesktopCursorClineVS Code

快速开始

作者 / 组织
groxaxo
提供方
groxaxo

工具数量

3

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

2 个

MCP World

选型结论

ZAI MCP Server 属于搜索检索类 MCP Server,公开资料标注 3 个工具,通过stdio 本地进程接入,适配 Claude Desktop、Claude、Cursor,有可以直接复制的安装命令;接入前要先准备 API Key。

分类

搜索检索

传输方式

stdio

认证方式

API Key

部署方式

支持远程部署

安装与配置

安装命令

pip install -r requirements.txt

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 对应的运行时,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 3 个工具,随便调一个只读工具确认能返回结果。

接入前确认

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

详细介绍

ZAI MCP服务器

一种模型上下文协议(MCP)服务器,使用ZAI的GLM-4.7-Flash模型提供网络搜索、内容获取和人工智能支持的摘要功能。

特性

  • 网络搜索:使用DuckDuckGo搜索网络
  • 内容获取:从任何网站上清理和提取文本
  • AI总结:使用GLM-4.7-Flash总结网络内容
  • 组合工作流:在一个操作中搜索、获取和汇总
  • 快速高效:使用flash模型快速响应

工具

search_web

在网上搜索信息。

参数:

  • query (字符串,必填):搜索查询
  • num_results (数字,可选):结果数量(1-10,默认值:5)

退货:

{
  "query": "search term",
  "count": 5,
  "results": [
    {
      "title": "Result Title",
      "url": "https://example.com",
      "snippet": "Brief snippet of the content..."
    }
  ]
}

fetch_and_summarize

获取网站URL并总结其内容。

参数:

  • url (字符串,必填):要获取的网站URL
  • max_content_length (数字,可选):要处理的最大内容长度(默认值:10000)

退货:

{
  "url": "https://example.com/article",
  "title": "Article Title",
  "summary": "AI-generated summary of the content...",
  "content_length": 5000
}

search_and_summarize

搜索网络,获取顶部结果,并对其进行总结。

参数:

  • query (字符串,必填):搜索查询
  • result_index (数字,可选):获取哪个搜索结果(1-10,默认值:1)

退货:

{
  "query": "search term",
  "result_index": 1,
  "url": "https://example.com/article",
  "title": "Article Title",
  "summary": "AI-generated summary...",
  "total_results": 10
}

安装

先决条件

  • Python 3.8或更高版本
  • ZAI API密钥(在https://z.ai/model-api)
  • pip包管理器

从源代码安装

# Clone the repository
git clone https://github.com/yourusername/zai-mcp-server.git
cd zai-mcp-server

# Install dependencies
pip install -r requirements.txt

# Make server executable
chmod +x src/server.py

快速开始

# Set your API key
export ZAI_API_KEY="your-zai-api-key"

# Run the server
python src/server.py

配置

环境变量

变量描述必填默认
ZAI_API_KEY您的ZAI API密钥是-

API配置

服务器使用以下ZAI API配置:

  • 基础URL: https://api.z.ai/api/paas/v4
  • 模型: glm-4.7-flash
  • 最大令牌数: 1000
  • 温度: 0.7

用法

独立测试

# Test initialization
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}' | python src/server.py

# List available tools
echo '{"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}}' | python src/server.py

# Search the web
echo '{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "search_web", "arguments": {"query": "AI news", "num_results": 3}}}' | python src/server.py

与Claude Desktop集成

添加到Claude Desktop配置文件:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "zai": {
      "command": "python3",
      "args": ["/absolute/path/to/zai-mcp-server/src/server.py"],
      "env": {
        "ZAI_API_KEY": "your-zai-api-key"
      }
    }
  }
}

与Cursor集成

添加到光标设置文件(~/.cursor/mcp_config.json):

{
  "mcpServers": {
    "zai": {
      "command": "python3",
      "args": ["/absolute/path/to/zai-mcp-server/src/server.py"],
      "env": {
        "ZAI_API_KEY": "your-zai-api-key"
      }
    }
  }
}

与Cline集成(VS代码)

在VS Code中添加到MCP设置中:

{
  "mcpServers": [
    {
      "name": "zai",
      "command": "python3",
      "args": ["/absolute/path/to/zai-mcp-server/src/server.py"],
      "env": {
        "ZAI_API_KEY": "${env:ZAI_API_KEY}"
      }
    }
  ]
}

与Continue集成

添加 ~/.continue/config.json:

{
  "mcpServers": {
    "zai": {
      "command": "python3",
      "args": ["/absolute/path/to/zai-mcp-server/src/server.py"],
      "env": {
        "ZAI_API_KEY": "your-zai-api-key"
      }
    }
  }
}

与Roo Code集成

添加到Roo Code的MCP配置中:

{
  "mcpServers": {
    "zai": {
      "command": "python3",
      "args": ["/absolute/path/to/zai-mcp-server/src/server.py"],
      "env": {
        "ZAI_API_KEY": "your-zai-api-key"
      }
    }
  }
}

OpenCode原生集成

设置

OpenCode原生支持MCP服务器。要配置:

  1. 创建/更新MCP配置文件:
   # Default location: ~/.config/opencode/mcp_servers.json
   mkdir -p ~/.config/opencode
   nano ~/.config/opencode/mcp_servers.json
  1. 添加ZAI MCP服务器配置:
   {
     "mcpServers": {
       "zai": {
         "name": "ZAI Web Search & Summarization",
         "description": "Search web and summarize content using GLM-4.7-Flash",
         "command": "python3",
         "args": ["/home/op/zai-mcp-server/src/server.py"],
         "env": {
           "ZAI_API_KEY": "your-zai-api-key"
         },
         "enabled": true
       }
     }
   }
  1. 重新启动OpenCode 加载新的MCP服务器

OpenCode中的用法

配置后,您可以在OpenCode对话中使用MCP服务器:

User: Search for recent developments in AI and summarize the top result

Assistant: I'll use the ZAI MCP server to search and summarize for you.

[Calls search_and_summarize tool]

The ZAI MCP server found an article about recent AI developments. Here's a summary:
- Main point 1
- Main point 2
- Main point 3

Full article available at: https://example.com/ai-developments

示例

示例1:网络搜索

# Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_web",
    "arguments": {
      "query": "machine learning trends 2024",
      "num_results": 5
    }
  }
}

# Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": JSON.stringify({
          "query": "machine learning trends 2024",
          "count": 5,
          "results": [...]
        })
      }
    ]
  }
}

示例2:提取和汇总

# Request
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "fetch_and_summarize",
    "arguments": {
      "url": "https://www.example.com/article"
    }
  }
}

# Response
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      {
        "type": "text",
        "text": JSON.stringify({
          "url": "https://www.example.com/article",
          "title": "Article Title",
          "summary": "Key points:\n• Point 1\n• Point 2\n• Point 3",
          "content_length": 5000
        })
      }
    ]
  }
}

示例3:搜索和总结(组合)

# Request
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "search_and_summarize",
    "arguments": {
      "query": "quantum computing breakthrough",
      "result_index": 1
    }
  }
}

# Response
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": JSON.stringify({
          "query": "quantum computing breakthrough",
          "result_index": 1,
          "url": "https://example.com/quantum-news",
          "title": "Major Quantum Computing Breakthrough",
          "summary": "Researchers have achieved a significant milestone...",
          "total_results": 10
        })
      }
    ]
  }
}

测试

运行测试套件以验证服务器是否正常工作:

python examples/test_server.py

预期产量:

============================================================
ZAI MCP Server Test Suite
============================================================

Testing initialization...
✓ Initialize: mcp-zai-server v1.0.0

Testing tools list...
✓ Available tools (3):
  - search_web: Search the web for information using DuckDuckGo
  - fetch_and_summarize: Fetch a website URL and summarize its content using GLM-4.7-Flash
  - search_and_summarize: Search the web, fetch top result, and summarize using GLM-4.7-Flash

Testing resources list...
✓ Available resources (1):
  - zai://status: Current status of ZAI MCP server

Testing resource read...
✓ Server status:
  Status: online
  Model: glm-4.7-flash
  API Endpoint: https://api.z.ai/api/paas/v4
  Tools: search_web, fetch_and_summarize, search_and_summarize

============================================================
✓ All tests passed!
============================================================

发展

项目结构

zai-mcp-server/
├── src/
│   └── server.py          # Main MCP server implementation
├── docs/
│   ├── ARCHITECTURE.md     # Architecture documentation
│   └── API_REFERENCE.md    # Detailed API reference
├── examples/
│   └── test_server.py      # Test suite and examples
├── requirements.txt           # Python dependencies
├── README.md                # This file
└── .env.example             # Environment variables template

依赖项

  • aiohttp -异步HTTP客户端
  • beautifulsoup4 -HTML解析
  • openai -适用于ZAI API的OpenAI兼容客户端

故障排除

常见问题

服务器无法启动

  • 确保已安装Python 3.8+: python --version
  • 检查是否安装了依赖项: pip install -r requirements.txt
  • 验证是否设置了API密钥: echo $ZAI_API_KEY

搜索未返回任何结果

  • DuckDuckGo API可能有费率限制
  • 尝试使用其他查询
  • 检查互联网连接

摘要失败

  • 验证API密钥在https://z.ai/model-api
  • 检查API信用/余额
  • 确保URL可访问

MCP客户端无法连接

  • 验证配置中的服务器路径是否正确
  • 确保Python3在系统PATH中
  • 检查文件权限: chmod +x src/server.py

调试模式

通过设置环境变量启用调试日志记录:

export ZAI_DEBUG=1
python src/server.py

许可证

MIT许可证-有关详细信息,请参阅许可证文件

贡献

欢迎投稿!请随时提交拉取请求。

支持

  • 问题:在GitHub Issues上报告错误和功能请求
  • ZAI API文件: https://docs.z.ai
  • MCP规范: https://modelcontextprotocol.io

致谢

  • ZAI提供GLM-4.7-Flash API
  • DuckDuckGo搜索API
  • 规范的模型上下文协议团队

工具与能力

工具数量

3

资源数量

0

提示词数量

0

能力标签

网络搜索Python本地部署内容抓取AI摘要生成DuckDuckGoGLM-4.7-Flash

支持客户端

Claude DesktopClaudeCursorClineVS Code

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

查资料带出处

把网页、论文和文档的检索结果连同链接一起带回对话。

站内知识检索

在自己的文档库里做语义搜索,比关键词更贴题。

事实核对

交叉多个来源确认一条信息,减少模型凭记忆作答。

选择建议

值得选的地方

  • 只提供 3 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 运行环境,换机器要重新装一遍。
  • 需要自备API Key,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在搜索检索场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到API Key的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
ZAI MCP Server

MCP World · 本页

3stdio有2 个2026-05-17
Baidu Netdisk

MCP World

未标注未说明未标注1 个2026-05-17
Sequentialthinking

MCP.so

1SSE有2 个2026-05-17
Brave Search 433812ff

MCP World

2未说明未标注1 个2026-05-17
mindsdb (430e18)

MCP World

0未说明有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

ZAI MCP Server 怎么安装?

公开资料给出的安装命令是 pip install -r requirements.txt,运行环境为 未标注。装完后按客户端要求写进 MCP 配置,重启客户端生效。

ZAI MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

ZAI MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

ZAI MCP Server 需要 API Key 吗?

公开资料标注的认证方式是API Key,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

ZAI MCP Server 支持哪些客户端?

公开资料标注支持 Claude Desktop、Claude、Cursor、Cline、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP