AivisSpeech MCP サーバーは AIvis Speech Engine と連携して音声合成のインターフェースを提供します。MCP プロトコルを通じて、AI アシスタントなどのアプリケーションから高品質な音声合成機能を簡単に利用できます。
以下の手順でサーバーをインストールします:
# リポジトリをクローン
git clone https://github.com/kentaro/aivis-speech-mcp.git
cd aivis-speech-mcp
# 依存関係のインストール
npm install
# ビルド
npm run build
環境変数の設定ファイルをサンプルからコピーして編集します:
cp .env.sample .env
.env
ファイルで以下の設定を行います:
# AivisSpeech API Configuration
AIVIS_SPEECH_API_URL=http://localhost:10101 # AivisSpeech EngineのAPIエンドポイント
# Speaker Configuration
AIVIS_SPEECH_SPEAKER_ID=888753760 # デフォルトのスピーカーID
Cursor エディタで使用する場合の設定ファイルをコピーして編集します:
cp .cursor/mcp.json.sample .cursor/mcp.json
.cursor/mcp.json
ファイルを以下のように編集します:
{
"mcpServers": {
"AivisSpeech-MCP": {
"command": "node",
"args": ["/path/to/aivis-speech-mcp/dist/index.js"]
}
}
}
/path/to/aivis-speech-mcp/dist/index.js
を実際のプロジェクトのパスに書き換えてください。Windows の場合は、バックスラッシュをエスケープするか、フォワードスラッシュを使用してください(例: "C:/Users/username/path/to/aivis-speech-mcp/dist/index.js"
)。
開発中はホットリロード機能付きでサーバーを起動できます:
npm run dev
ビルド後、本番モードでサーバーを起動します:
npm start
AivisSpeech MCP サーバーは MCP プロトコルに準拠した API エンドポイントを提供します。主な機能は以下の通りです:
詳細な API 仕様については AivisSpeech Engine API 仕様 を参照してください。
よくある問題と解決策:
.env
ファイルの AIVIS_SPEECH_API_URL
が正しく設定されているか確認してくださいThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.