xiaozhi_mcp_server_golang
使用golang实现mcp server通过websocket连接到xiaozhi服务器
claude mcp add --transport stdio hackers365-xiaozhi_mcp_server_golang docker run -i xiaozhi-mcp-server-go \ --env MCP_TARGET="xiaozhi mcp target (optional)" \ --env MCP_CONFIG_PATH="path to config (optional)"
How to use
This MCP server acts as an integration bridge to the Xiaozhi MCP service. It is implemented in Go and designed to connect to Xiaozhi's MCP ecosystem, exposing the standard MCP endpoints and protocol adapters needed to relay data between Xiaozhi services and your local or cloud environment. After starting the server, it will listen for MCP connections, perform the handshake with Xiaozhi, and then forward messages between your application and Xiaozhi's MCP suite. Use the built-in configuration options to tailor how it authenticates, routes messages, and handles retries.
How to install
Prerequisites:
- Docker installed (recommended for the provided container in this guide) or a Go development environment if you prefer building from source.
- Access rights to Xiaozhi MCP endpoints (credentials or tokens as required by your deployment).
Option A: Run with Docker
- Ensure Docker is running.
- Pull and run the container (replace image name with the official image if provided): docker pull xiaozhi/mcp-server-go docker run -i --env MCP_TARGET="<target-id>" --env MCP_CONFIG_PATH="/config" xiaozhi/mcp-server-go
Option B: Build from source (Go)
- Ensure Go is installed (https://golang.org/dl/).
- Clone the repository and navigate to the project directory.
- Build the binary: go build -o xiaozhi_mcp_server_go ./...
- Run the server: ./xiaozhi_mcp_server_go
Configure your environment as needed by setting environment variables for authentication, target, and config paths as described in the next section.
Additional notes
Environment variables and config options may include:
- MCP_TARGET: The Xiaozhi MCP target or endpoint you are bridging to.
- MCP_CONFIG_PATH: Path to a configuration file describing routes, adapters, and credentials.
- You may need to adjust network settings (ports, TLS certificates) depending on your deployment environment. If you encounter connectivity issues, verify firewall rules, DNS resolution to Xiaozhi MCP endpoints, and that the correct credentials are in place. Logs typically indicate handshake or protocol negotiation problems if misconfigured. Ensure the Go binary or container has access to the necessary network resources and that the MCP protocol version matches Xiaozhi's expected version.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go