Librarian MCP Server logo

Librarian MCP Server

by SegaraRai

Librarian is a Model Context Protocol (MCP) server that provides an API for listing, searching, and retrieving markdown files stored in a structured manner. It serves as a knowledge base for Large Language Models (LLMs), providing them with the information they need on demand.

View on GitHub

Last updated: N/A

What is Librarian MCP Server?

Librarian is a read-only Model Context Protocol (MCP) server designed to efficiently deliver structured document content to Large Language Models (LLMs). It provides an API for listing, searching, and retrieving markdown files, acting as a knowledge base.

How to use Librarian MCP Server?

To use Librarian, you need to install it using Node.js and npm or pnpm. Configure the document folder path using command-line arguments or environment variables. Then, you can use the provided API endpoints (getDocuments, getDocument, listDocuments, searchDocuments, listTags) to interact with the server and retrieve information. The server is designed to integrate with LLMs through the MCP framework.

Key features of Librarian MCP Server

  • Structured Document Organization

  • Tag-Based Filtering

  • Hierarchical Tag Inheritance

  • Flexible Search Capabilities (string and regex)

  • Efficient Document Retrieval

  • Tag Discovery

  • MCP Integration

Use cases of Librarian MCP Server

  • Providing context to LLMs for generating responses

  • Building a knowledge base for LLMs

  • Searching for specific information within a collection of documents

  • Retrieving documentation on demand

FAQ from Librarian MCP Server

How do I configure the document folder?

You can configure the document folder path using command-line arguments (e.g., node dist/bin.js --docs-root /path/to/your/docs) or environment variables (e.g., LIBRARIAN_DOCS_ROOT=/path/to/your/docs node dist/bin.js).

How does tag inheritance work?

A document inherits all tags from index.md files in its parent directories. Tags are merged from the most general (root) to the most specific (document).

What search modes are available?

Librarian supports both simple string searches (case insensitive) and regular expression searches with customizable flags.

What error responses does Librarian provide?

Librarian uses standard MCP error responses with appropriate error codes and messages, including INVALID_ARGUMENT, NOT_FOUND, and INTERNAL.

How can I contribute to the project?

Contributions are welcome! Please feel free to submit a Pull Request.