Overview
This is a memo on building an MCP server for searching the Koui Genji Monogatari Text DB.
As an example, it can be used from Claude Desktop as follows:

https://youtu.be/8s2R9V2hEvc?si=p9SW-IvhdNSzwTLN
Background
In the following article, I introduced the construction of an API server for searching the Koui Genji Monogatari Text DB.
As an application of this, I built an MCP server to try interacting with AI agents.
Although it is simple, the GitHub repository is available here:
https://github.com/nakamura196/genji-mcp-server
For development, I passed the OpenAPI specification provided by the aforementioned API server to Claude Code, which efficiently developed it from a template.
The swagger.json can be accessed at:
https://genji-api.aws.ldas.jp/swagger.json
Usage
The npm package is published at:
https://www.npmjs.com/package/@nakamura196/genji-mcp-server
Create a configuration file like the following and restart Claude Desktop.
Usage Example
When you enter something like “Which volumes contain Yugao?”, you will be asked for permission to use external integration as shown below. Once permitted, the AI creates an answer based on the query results.

Below is an example response.
Let me search for the volumes in the Tale of Genji that feature Yugao.
Based on the search results, the volumes containing Yugao are:
Volumes featuring “Yugao”:
- Volume 4 “Yugao” - Most frequent appearances (7 occurrences)
- Volume 6 “Suetsumuhana” - 1 occurrence
- Volume 22 “Tamakazura” - 3 occurrences
The woman protagonist Yugao is naturally depicted centrally in Volume 4 “Yugao.” This volume tells in detail the story from Hikaru Genji’s encounter with Yugao to its tragic conclusion.
Afterwards, she is mentioned in reminiscence in Volume 6 “Suetsumuhana,” and in Volume 22 “Tamakazura,” there are multiple references to Yugao as the mother within the story of her daughter Tamakazura.
In other words, Yugao appears as a protagonist in Volume 4 and continues to be referenced as an important character in subsequent volumes.

Summary
The main focus was on confirming how to create and use an MCP server, and there is room for various improvements in practice. We hope some parts of this serve as a useful reference. I would like to try more useful applications going forward.