Use the GLM Web Search MCP server for web searches.
Execution flow (installation is required the first time; afterward, directly call it in Step 6)
Step 1: Check and install dependencies
1.1 Check whether mcporter is available
npx -y mcporter --version
If the command returns success, it means mcporter is available; skip to Step 2.
mcporter can be used directly via npx without installation.
Step 2: Check the API Key configuration
cat ~/.openclaw/config/glm.json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('api_key', ''))"
If a non-empty API Key is returned, skip to Step 4.
Step 3: Configure the API Key (if not configured)
3.2 If no Key is found, ask the user for one
If the user does not have a Zhipu API Key, they can visit https://www.bigmodel.cn/glm-coding?ic=OOKF4KGGTW to purchase.
Ask the user to provide a Zhipu API Key.
3.3 Save the API Key
mkdir -p ~/.openclaw/config
cat > ~/.openclaw/config/glm.json << EOF
{
"api_key": "API密钥"
}
EOF
Step 4: Add the MCP server
Use mcporter to add the GLM Web Search MCP server:
mcporter config add glm-search \
--type sse \
--url "https://open.bigmodel.cn/api/mcp/web_search_prime/sse?Authorization=your-key"
Note: Replace your-key with the actual Zhipu API Key.
Step 5: Test the connection
mcporter list
Confirm that the glm-search server has been added successfully.
Step 6: Use mcporter to call the MCP for web searches
6.1 Use mcporter to call MCP tools
Use mcporter to call the MCP service:
mcporter call glm-search.webSearchPrime search_query="<搜索查询>"
Example:
# 搜索今日新闻
mcporter call glm-search.webSearchPrime search_query="今天的热点新闻"
# 搜索技术信息
mcporter call glm-search.webSearchPrime search_query="Python 异步编程最佳实践"
6.2 API parameter description
| Parameter | Description | Type |
|---|---|---|
| search_query | Search query string | string (required) |
Supported tools
Important note: If any issues arise, refer to the official documentation. Official documentation: https://docs.bigmodel.cn/cn/coding-plan/mcp/search-mcp-server
The GLM Web Search MCP server provides the following tools:
webSearchPrime- Search web information; the returned results include webpage title, webpage URL, webpage summary, website name, website icon, etc.
MCP configuration
MCP server name:glm-search
MCP server type: HTTP
MCP server URL:https://open.bigmodel.cn/api/mcp/web_search_prime/mcp
Authentication method: Bearer Token (Authorization header)