This project provides a server compatible with the Model-View-Controller (MVC) architecture, extending Xiaozhi with powerful mathematical and computational tools. It includes a calculator with fraction support and a Wolfram Alpha query tool.
- Time Tool: Get the current time in ISO format.
- Calculator Tool: Evaluate mathematical expressions with support for precise fractions, falling back to decimals when necessary.
- Wolfram Alpha Tool: Query the Wolfram Alpha LLM API for complex questions and computations.
-
Prerequisites:
- Node.js (version 18.0.0 or higher)
mcp_exe(MCP Connector executable) in your system's PATH.
-
Installation:
- Clone this repository.
- Install the dependencies:
npm install
-
Configuration:
- Run the setup script to create a
.envfile with your credentials:node setup.js
- You will be prompted for the following:
- Xiaozhi WebSocket Endpoint: Your
wss://endpoint. - Wolfram App ID: Your app ID for the Wolfram Alpha API.
- Xiaozhi WebSocket Endpoint: Your
- Run the setup script to create a
There are two ways to run the server:
This method uses pm2, a process manager for Node.js, to run the server in the background.
pm2 start ecosystem.config.jsTo monitor the server:
pm2 logs xiaozhi-mcpThis method runs the bridge script directly.
node bridge.jsThe project includes a Dockerfile for easy containerization.
-
Build the Docker image:
docker build -t xiaozhi-super-server . -
Run the Docker container:
- Make sure to pass the
MCP_ENDPOINTandWOLFRAM_APP_IDenvironment variables.
docker run -d -p 8080:8080 \ -e MCP_ENDPOINT="<your_wss_endpoint>" \ -e WOLFRAM_APP_ID="<your_wolfram_app_id>" \ --name xiaozhi-server \ xiaozhi-super-server
- Make sure to pass the
The server will be running on port 8080 inside the container.