Librarian MCP Server

Librarian MCP Server

An intelligent document management MCP server that leverages mental models and orchestration patterns for context-aware document storage, retrieval, and analysis.

Category
Visit Server

README

Librarian MCP Server

An intelligent document management MCP server that leverages mental models and orchestration patterns to provide context-aware document storage, retrieval, and analysis.

Overview

The Librarian MCP Server is part of the cos mcp ecosystem and implements sophisticated document management capabilities using the Model Context Protocol. It features:

  • Intelligent Classification: Multi-dimensional document analysis
  • Mental Model Integration: Leverages frameworks from the MCP Orchestrator
  • Proactive Assistance: Pattern detection and organization suggestions
  • Flexible Storage: Adapter pattern for multiple storage backends
  • Semantic Search: Natural language document retrieval

Architecture

Built using patterns from the MCP Orchestrator:

  • Classification Engine for multi-dimensional analysis
  • Intent Router for operation routing
  • Storage Adapters for backend flexibility
  • Proactive patterns for intelligent suggestions

See ARCHITECTURE.md for detailed design documentation.

Installation

npm install
npm run build

Usage

Run the Server

npm start

Configure with Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "librarian": {
      "command": "node",
      "args": ["/path/to/librarian/dist/index.js"]
    }
  }
}

Available Tools

Document Management

  • store_document: Store documents with automatic classification
  • search_documents: Search using natural language or filters
  • get_document: Retrieve specific documents
  • update_document: Update document content or metadata
  • delete_document: Remove documents from library

Analysis & Organization

  • analyze_document: Apply mental models for document analysis
  • organize_library: AI-driven document organization

Examples

Store a Document

{
  "tool": "store_document",
  "arguments": {
    "content": "# Project Plan\n\nThis document outlines...",
    "metadata": {
      "title": "Q1 2024 Project Plan",
      "author": "John Doe",
      "tags": ["planning", "quarterly"]
    },
    "options": {
      "autoClassify": true,
      "detectDuplicates": true
    }
  }
}

Search Documents

{
  "tool": "search_documents",
  "arguments": {
    "query": "project plans from last quarter",
    "filters": {
      "domain": ["business"],
      "dateRange": {
        "start": "2024-01-01"
      }
    },
    "options": {
      "semantic": true,
      "limit": 5
    }
  }
}

Analyze Document

{
  "tool": "analyze_document",
  "arguments": {
    "documentId": "doc-123",
    "analysisType": "summary",
    "framework": "swot"
  }
}

Integration with MCP Orchestrator

The Librarian can be integrated with the MCP Orchestrator for advanced workflows:

  1. Use orchestrator to analyze complex queries
  2. Route document operations through mental models
  3. Chain multiple operations for sophisticated workflows

Example orchestrated workflow:

1. Gather intent about document needs
2. Search relevant documents
3. Analyze using appropriate mental models
4. Organize based on patterns
5. Generate insights

Development

Project Structure

librarian/
├── src/
│   ├── adapters/      # Storage backend adapters
│   ├── engines/       # Classification and analysis engines
│   ├── tools/         # MCP tool definitions
│   ├── types.ts       # TypeScript type definitions
│   ├── LibrarianServer.ts  # Main server implementation
│   └── index.ts       # Entry point
├── ARCHITECTURE.md    # Detailed architecture documentation
├── package.json
└── README.md

Adding New Features

  1. New Storage Backend: Implement the StorageAdapter interface
  2. New Analysis Type: Add to AnalysisType enum and implement handler
  3. New Organization Method: Add to OrganizeMethod and implement logic

Testing

# Run in development mode
npm run dev

# Test with MCP Inspector
npx @modelcontextprotocol/inspector dist/index.js

Future Enhancements

  • [ ] PostgreSQL adapter with vector embeddings
  • [ ] Integration with filesystem MCP for local files
  • [ ] Browser MCP integration for web content
  • [ ] Real-time collaboration features
  • [ ] Advanced duplicate detection
  • [ ] Custom mental model definitions
  • [ ] Batch import/export capabilities

License

MIT

Contributing

Contributions welcome! Please follow the existing patterns and ensure TypeScript compilation succeeds before submitting PRs.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured