Skip to main content
Glama
uraoz

Bouyomi-chan MCP Server

by uraoz

read_text

Convert text to speech using Bouyomi-chan's TTS functionality via Model Context Protocol (MCP). Ideal for AI assistants to voice-read text with customizable parameters for enhanced interaction.

Instructions

テキストを棒読みちゃんで読み上げます

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the read_text tool: sends text to BouyomiChan API via speakBouyomi helper and returns success or error response.
    async ({ text, voice = 0, volume = -1, speed = -1, tone = -1 }) => {
      const statusCode = await speakBouyomi(text, voice, volume, speed, tone);
      
      if (statusCode === 200) {
        return {
          content: [
            {
              type: "text",
              text: `読み上げました`
            }
          ]
        };
      } else {
        return {
          content: [
            {
              type: "text",
              text: `読み上げに失敗しました。ステータスコード: ${statusCode}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema defining input parameters for the read_text tool.
    {
      text: z.string().describe("読み上げるテキスト"),
      voice: z.number().default(0).describe("音声の種類(0: 女性1、1: 男性1、2: 女性2、...)"),
      volume: z.number().default(-1).describe("音量(-1: デフォルト、0-100: 音量レベル)"),
      speed: z.number().default(-1).describe("速度(-1: デフォルト、50-200: 速度レベル)"),
      tone: z.number().default(-1).describe("音程(-1: デフォルト、50-200: 音程レベル)")
    },
  • src/index.ts:42-76 (registration)
    Registration of the read_text tool on the MCP server using server.tool().
    server.tool(
      "read_text",
      "テキストを棒読みちゃんで読み上げます",
      {
        text: z.string().describe("読み上げるテキスト"),
        voice: z.number().default(0).describe("音声の種類(0: 女性1、1: 男性1、2: 女性2、...)"),
        volume: z.number().default(-1).describe("音量(-1: デフォルト、0-100: 音量レベル)"),
        speed: z.number().default(-1).describe("速度(-1: デフォルト、50-200: 速度レベル)"),
        tone: z.number().default(-1).describe("音程(-1: デフォルト、50-200: 音程レベル)")
      },
      async ({ text, voice = 0, volume = -1, speed = -1, tone = -1 }) => {
        const statusCode = await speakBouyomi(text, voice, volume, speed, tone);
        
        if (statusCode === 200) {
          return {
            content: [
              {
                type: "text",
                text: `読み上げました`
              }
            ]
          };
        } else {
          return {
            content: [
              {
                type: "text",
                text: `読み上げに失敗しました。ステータスコード: ${statusCode}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • Helper function that sends HTTP request to BouyomiChan server to speak the text.
    async function speakBouyomi(
      text: string = 'ゆっくりしていってね',
      voice: number = 0,
      volume: number = -1,
      speed: number = -1,
      tone: number = -1
    ): Promise<number> {
      try {
        const response = await axios.get('http://localhost:50080/Talk', {
          params: {
            text,
            voice,
            volume,
            speed,
            tone
          }
        });
        return response.status;
      } catch (error) {
        console.error('棒読みちゃんへのリクエストに失敗しました:', error);
        return 500;
      }
    }
Install Server

Other Tools

Related Tools

Latest Blog Posts

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/uraoz/bouyomi-mcp-nodejs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server