13 查看 · 2026-07-07 更新
AivisSpeech MCP Server
This is the implementation of the Model Context Protocol (MCP) server for AivisSpeech. This server works in conjunction with the AivisSpeech Engine to provide an interface for speech synthesis. Through the MCP protocol, applications such as AI assistants can easily utilize AivisSpeech's speech synthesis capabilities.
Overview
The AivisSpeech MCP Server provides the following features:
- API endpoints compliant with the MCP protocol
- High-quality speech synthesis through integration with the AivisSpeech Engine
- Type-safe design using TypeScript
- Simple setup and a highly scalable architecture
Prerequisites
- Node.js 18.x or higher
- npm 9.x or higher
- AivisSpeech Engine (needs to be installed separately)
Installation
bash
Clone the repository
git clone https://github.com/kentaro/aivis-speech-mcp.git cd aivis-speech-mcp
Install dependencies
npm install
Build
npm run build
Set up environment variables
cp .env.sample .env
Edit the .env file to configure the necessary settings
Cursor MCP configuration
cp .cursor/mcp.json.sample .cursor/mcp.json
Replace "/path/to/aivis-speech-mcp/dist/index.js" in the mcp.json file
with the actual path to your project
Example: "C:/Users/username/path/to/aivis-speech-mcp/dist/index.js"
Environment Configuration
Configure the following settings in the .env file:
AivisSpeech API Configuration
AIVIS_SPEECH_API_URL=http://localhost:10101 # AivisSpeech Engine API endpoint
Speaker Configuration
AIVIS_SPEECH_SPEAKER_ID=888753760 # Default speaker ID
Cursor MCP Configuration
Configure the following settings in the .cursor/mcp.json file:
json { "mcpServers": { "AivisSpeech-MCP": { "command": "node", "args": ["/path/to/aivis-speech-mcp/dist/index.js"] } } }
Replace /path/to/aivis-speech-mcp/dist/index.js with the actual path to your project.
For Windows, escape backslashes or use forward slashes.
Example: "C:/Users/username/path/to/aivis-speech-mcp/dist/index.js"
Usage
Development Mode
During development, you can start the server with hot-reload functionality using the following command:
bash npm run dev
Build
To build for production, run the following command:
bash npm run build
Production Mode
After building, start the server in production mode using the following command:
bash npm start
Testing
To run tests, use the following command:
bash npm test
Architecture
The AivisSpeech MCP Server consists of the following components:
- MCP Service: Provides a server compliant with the Model Context Protocol and handles requests from clients.
- AivisSpeech Service: Communicates with the AivisSpeech Engine API to perform speech synthesis.
API Specification
The server provides API endpoints that comply with the MCP protocol. The main functionalities include:
- Speech synthesis (generating speech from text)
- Retrieving speaker information
- Setting voice styles
For detailed API specifications, refer to the AivisSpeech Engine API Specifications.
Integration with MCP Protocol
This server implements the Model Context Protocol (MCP), allowing seamless integration with applications such as AI assistants. For more details on the MCP protocol, refer to the MCP Official Documentation.## Troubleshooting
Common issues and solutions:
- Cannot connect to AivisSpeech Engine: Please check if
AIVIS_SPEECH_API_URLin the.envfile is correctly set. - Audio does not play: Check your system's audio settings and ensure that the appropriate audio device is selected.
- Speaker ID not found: Verify that the AivisSpeech Engine is running properly and check for available speaker IDs.
Contributions
Please use the GitHub Issue tracker for bug reports or feature requests. Pull requests are also welcome.
License
Acknowledgments
- AivisSpeech Engine team
- Developers of the Model Context Protocol
服务配置
[{'mcpServers': {'AivisSpeech-MCP': {'args': ['/path/to/aivis-speech-mcp/dist/index.js'], 'command': 'node'}}}]
来源
- 来源:github
- 链接:https://github.com/kentaro/aivis-speech-mcp