Skip to main content
Glama
oksure

Bible Korean MCP Server

by oksure

get-chapter

Retrieve all verses from a specific chapter of the Korean Bible by specifying book name and chapter number, with support for multiple translation versions.

Instructions

Get all verses from a specific chapter of the Korean Bible

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bookYesBook name (English or Korean) or code (e.g., 'Genesis', '창세기', 'gen')
chapterYesChapter number
versionNoBible translation version (default: GAE)GAE

Implementation Reference

  • Handler implementation for the 'get-chapter' tool. Resolves the book name to a code, fetches the chapter content from the Bible website using fetchChapter helper, formats it as Markdown with verse numbers, and returns it as tool response content.
    case "get-chapter": { const { book, chapter, version = "GAE" } = args as { book: string; chapter: number; version?: string; }; const bookCode = findBookCode(book); if (!bookCode) { return { content: [ { type: "text", text: `Error: Book '${book}' not found. Use list-books to see available books.`, }, ], }; } const chapterData = await fetchChapter(bookCode, chapter, version); let result = `# ${chapterData.book} (${chapterData.bookKorean}) ${chapterData.chapter}\n`; result += `**Translation:** ${chapterData.versionName}\n\n`; for (const verse of chapterData.verses) { result += `**${verse.number}.** ${verse.text}\n\n`; } return { content: [{ type: "text", text: result }], };
  • src/index.ts:256-279 (registration)
    Registration of the 'get-chapter' tool in the tools list returned by ListToolsRequestSchema handler, including name, description, and input schema.
    { name: "get-chapter", description: "Get all verses from a specific chapter of the Korean Bible", inputSchema: { type: "object", properties: { book: { type: "string", description: "Book name (English or Korean) or code (e.g., 'Genesis', '창세기', 'gen')", }, chapter: { type: "number", description: "Chapter number", }, version: { type: "string", description: "Bible translation version (default: GAE)", enum: ["GAE", "GAE1", "NIR", "KOR", "CEV"], default: "GAE", }, }, required: ["book", "chapter"], }, },
  • Key helper function that performs HTTP fetch to the Korean Bible website, parses the HTML using cheerio to extract verse numbers and text, cleans the text, and returns structured Chapter data used by the handler.
    bookCode: string, chapter: number, version: string = "GAE" ): Promise<Chapter> { const url = `https://www.bskorea.or.kr/bible/korbibReadpage.php?version=${version}&book=${bookCode}&chap=${chapter}`; const response = await fetch(url); const html = await response.text(); const $ = cheerio.load(html); const verses: Verse[] = []; // Parse verses from span elements // The website uses span elements where verse text starts with verse number $("span").each((i, elem) => { const text = $(elem).text().trim(); // Look for pattern: number followed by spaces and text const match = text.match(/^(\d+)\s+(.+)$/s); if (match) { const verseNum = parseInt(match[1]); let verseText = match[2]; // Remove footnote markers (like 1), 2), etc.) verseText = verseText.replace(/\d+\)/g, "").trim(); // Remove explanatory text that comes after line breaks (like "또는 ...") const lines = verseText.split("\n"); verseText = lines[0].trim(); // Avoid duplicate verses (website has multiple spans per verse) if (!verses.find((v) => v.number === verseNum)) { verses.push({ number: verseNum, text: verseText, }); } } }); const bookInfo = getBookInfo(bookCode); return { book: bookInfo?.name || bookCode, bookKorean: bookInfo?.korean || "", chapter, version, versionName: TRANSLATIONS[version] || version, verses, }; }
  • Helper function to resolve a book name (English, Korean, or code) to the standardized book code used in the Bible website URLs.
    // Try direct match for (const [name, info] of Object.entries(BIBLE_BOOKS)) { if (name.toLowerCase() === normalized || info.korean === bookName || info.code === normalized) { return info.code; } } // Try partial match for (const [name, info] of Object.entries(BIBLE_BOOKS)) { if (name.toLowerCase().includes(normalized) || info.korean.includes(bookName)) { return info.code; } } return null; }

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/oksure/bible-ko-mcp'

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