xiaozhi-mcp
Provides web search capabilities via Google Search through SerpApi, allowing the AI to retrieve search results, answer boxes, and knowledge graphs.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xiaozhi-mcpsearch for the latest AI news"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
xiaozhi-mcp
本地 MCP(Model Context Protocol)框架,用來把自建的工具透過小智AI(xiaozhi.me)的 MCP 接入點,提供給語音智能體使用。
架構
小智AI 雲端 (wss://) ↔ mcp_pipe.py(橋接器)↔ server.py(本地 FastMCP Server,stdio)
Related MCP server: LangChain Agent RAG MCP
安裝
uv sync設定
登入 xiaozhi.me 控制台,進入智能體的配置角色頁面,取得該智能體專屬的 MCP 接入點網址(
wss://...)。複製
.env.example為.env,填入取得的網址:
MCP_ENDPOINT=wss://your-actual-endpoint3.(若要使用 web_search 工具)到 SerpApi 註冊取得 API Key,填入 .env:
SERPAPI_KEY=your-actual-serpapi-key執行
uv run mcp_pipe.py server.py看到 log 出現 Successfully connected to WebSocket server 代表已連上小智AI 的 MCP 接入點。
驗證
橋接器顯示連線成功,不代表工具真的能被呼叫到。請開啟與小智AI 的對話,直接要求它算一個算式,例如「幫我算 8 的平方根」,確認小智AI 回覆的結果是正確的計算結果(8 的平方根約為 2.828),就代表 calculator 工具已經透過橋接器被成功呼叫、算完並回傳。
新增工具
在 server.py 中用 @mcp.tool() 裝飾一個函式即可新增工具,同一個 server 可以有多個工具,mcp_pipe.py 不需要修改。工具名稱與參數命名要清楚(避免縮寫),並用 docstring 說明用途與使用時機,讓大模型知道何時該呼叫它。回傳值建議控制在 1024 bytes 以內。
目前內建的 web_search 工具會呼叫 SerpApi 做 Google 搜尋:優先回傳 Google 的直接解答框內容(answer_box,例如天氣、單位換算、簡單問答)或 knowledge_graph 摘要,都沒有的話才退回最相關那一筆搜尋結果的摘要(避免回傳內容過長);需要在 .env 設定 SERPAPI_KEY 才能使用,沒設定時會回傳 {"success": false, "error": "SERPAPI_KEY not configured"}。
安全性
server.py 內建的 calculator 工具,是用 eval() 直接執行傳入的 Python 運算式,且沒有做任何沙箱或白名單限制,等同於可以執行任意 Python 程式碼(包含存取檔案系統、匯入任意模組等)。這個工具只是官方範例,目的是快速驗證「小智AI ↔ mcp_pipe.py ↔ server.py」這條連線鏈路是否打通,並不適合留在正式使用的環境中。建議在確認連線成功、換上真正需要的工具後,就把 calculator 移除;在那之前,也不要讓橋接器在無人看管的情況下長時間掛著執行。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseCqualityCmaintenanceA multi-tool MCP server that enhances local LLMs with web search, document reading, scholarly research, Wikipedia access, and calculator functions. Provides comprehensive tools for information retrieval and computation without requiring API keys by default.Last updated221
- Flicense-qualityCmaintenanceAn MCP server integrating LangChain, RAG, and Agent to provide knowledge retrieval and tool invocation through natural language.Last updated
- Flicense-qualityCmaintenanceA custom MCP server providing tools for date/time, calculations, mock weather, and note management, enabling AI agents to perform these tasks via natural language.Last updated
- Flicense-qualityCmaintenanceA custom MCP server with 6 utility tools (file search, file reading, math calculation, JSON formatting, time query, system info) that demonstrates MCP protocol workflow and integrates with LangChain agents.Last updated
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
MCP server for Hailuo (MiniMax) AI video generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/david0932/xiaozhi-mcp-websearch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server