Skip to main content
Glama
Amruth22

Literature Manager MCP

by Amruth22
README.md
# šŸ“š Literature Manager MCP

A beginner-friendly system for managing research papers, books, and other sources using AI assistants through the Model Context Protocol (MCP).

## šŸŽÆ What is this?

This tool helps you:
- **Organize** research papers, books, websites, and videos
- **Take notes** on your sources with structured titles
- **Track reading progress** (unread, reading, completed, archived)
- **Connect sources** to concepts in your knowledge base
- **Work with AI assistants** like Claude to manage your literature

## šŸš€ Quick Start

### 1. Prerequisites

- Python 3.8 or higher
## šŸš€ Quick Start

### 1. Prerequisites

- Python 3.8 or higher
- Basic familiarity with command line

### 2. Installation

```bash
# Clone this repository
git clone https://github.com/Amruth22/literature-manager-mcp.git
cd literature-manager-mcp

# Install dependencies
pip install -r requirements.txt

# Create your database
python setup_database.py
```

### 3. Choose Your Usage Method

#### Option A: Direct Python Usage (Recommended)

```bash
# Set your database path
## šŸ“š How to Use

### Command Line Interface

```bash
# Add a research paper
python cli.py add-source "Attention Is All You Need" paper arxiv 1706.03762

# Add a book
python cli.py add-source "Deep Learning" book isbn 978-0262035613

# Add a note
python cli.py add-note "Attention Is All You Need" paper arxiv 1706.03762 \
  "Key Insight" "Transformers eliminate recurrence"

# Update status
python cli.py update-status "Attention Is All You Need" paper arxiv 1706.03762 completed

# Link to entity
python cli.py link-entity "Attention Is All You Need" paper arxiv 1706.03762 \
  "transformer architecture" introduces

# List sources
python cli.py list --type paper --status unread

# Search sources
python cli.py search "transformer"

# Show statistics
python cli.py stats

# Get help
python cli.py help
```

### Direct Python Usage

```python
from src.database import LiteratureDatabase

# Initialize database
db = LiteratureDatabase("literature.db")

# Add a source
source_id = db.add_source(
    title="Attention Is All You Need",
    source_type="paper",
    identifier_type="arxiv",
    identifier_value="1706.03762"
# Add a note
db.add_note(source_id, "Key Insight", "Transformers eliminate recurrence...")

# Update status
db.update_status(source_id, "completed")

# Link to entity
db.link_to_entity(source_id, "transformer architecture", "introduces")

# Get source details
source = db.get_source_by_id(source_id)
print(source)
```

### Running Examples

```bash
# Run basic examples
python examples/basic_usage.py

# Run advanced examples  
python examples/advanced_usage.py

# Run direct usage examples
python direct_usage.py
```
- **completed**: Finished reading
- **archived**: Saved for later reference

## šŸ”— Relationship Types

When linking sources to concepts:

- **discusses**: Source talks about the concept
- **introduces**: Source first presents the concept
- **extends**: Source builds upon the concept
- **evaluates**: Source analyzes/critiques the concept
- **applies**: Source uses the concept practically
- **critiques**: Source criticizes the concept

## šŸ› ļø Available Commands

### Basic Operations
- `add_source()` - Add a new source
- `add_note()` - Add notes to sources
- `update_status()` - Change reading status
- `search_sources()` - Find sources

### Advanced Operations
- `link_to_entity()` - Connect sources to concepts
- `get_entity_sources()` - Find sources by concept
- `add_identifier()` - Add more IDs to existing sources

### Database Operations
- `list_sources()` - Show all sources
- `get_source_details()` - Get complete source info
- `database_stats()` - Show database statistics

## šŸ“ Project Structure

```
literature-manager-mcp/
ā”œā”€ā”€ README.md              # This file
ā”œā”€ā”€ requirements.txt       # Python dependencies
ā”œā”€ā”€ setup_database.py      # Database setup script
ā”œā”€ā”€ server.py             # Main MCP server
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ __init__.py
│   ā”œā”€ā”€ database.py       # Database operations
│   ā”œā”€ā”€ models.py         # Data models
│   ā”œā”€ā”€ tools.py          # MCP tools
│   └── utils.py          # Helper functions
ā”œā”€ā”€ examples/
│   ā”œā”€ā”€ basic_usage.py    # Simple examples
│   └── advanced_usage.py # Complex workflows
ā”œā”€ā”€ tests/
│   └── test_basic.py     # Unit tests
└── docs/
    ā”œā”€ā”€ installation.md   # Detailed setup
    ā”œā”€ā”€ examples.md       # More examples
    └── troubleshooting.md # Common issues
```

## šŸ¤ Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## šŸ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## šŸ†˜ Need Help?

- Check the [troubleshooting guide](docs/troubleshooting.md)
- Look at [examples](examples/)
- Open an [issue](https://github.com/Amruth22/literature-manager-mcp/issues)

## šŸ™ Acknowledgments

- Based on the original work by [zongmin-yu](https://github.com/zongmin-yu/sqlite-literature-management-fastmcp-mcp-server)
- Built with [FastMCP](https://github.com/jlowin/fastmcp)
- Uses [Model Context Protocol](https://modelcontextprotocol.io/)