Skip to content

raghupalash/archivist.mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Research Assistant MCP Server

A Model Context Protocol (MCP) server that integrates Wikipedia as a knowledge source with Obsidian for personal knowledge management. Run locally with Claude Desktop for seamless research and note-taking workflows.

Features

  • πŸ” Wikipedia Integration: Search and fetch full articles from Wikipedia
  • πŸ“ Obsidian Notes: Create and search notes with wikilinks and backlinks
  • 🎯 Research Modes: Configure research rigor (strict/balanced/exploratory)
  • πŸ”— Smart Linking: Automatic wikilink generation and backlink tracking
  • πŸ’Ύ Local-First: Everything runs locally, no external dependencies beyond Wikipedia API

Quick Start

Prerequisites

  • Python 3.10 or higher
  • An Obsidian vault
  • Claude Desktop

Installation

  1. Clone or navigate to the project directory:

    cd research-mcp-server
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install the package:

    pip install -e .
  4. Set up environment variables:

    cp .env.example .env
    # Edit .env and set your Obsidian vault path

Configuration

Environment Variables

Create a .env file or set these in your Claude Desktop configuration:

OBSIDIAN_VAULT_PATH=/path/to/your/ObsidianVault
CACHE_ENABLED=true
DEFAULT_RESEARCH_MODE=balanced

Claude Desktop Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "research-assistant": {
      "command": "python",
      "args": ["-m", "research_mcp_server"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/Users/yourusername/Documents/ObsidianVault"
      }
    }
  }
}

After editing:

  1. Save the file
  2. Restart Claude Desktop
  3. The server will auto-start when Claude launches

Available Tools

1. search_wikipedia

Search Wikipedia for articles matching a query.

Parameters:

  • query (string, required): Search query
  • limit (integer, optional): Maximum results (default: 5)

Example:

Search Wikipedia for "consistent hashing"

2. fetch_wikipedia_article

Fetch full Wikipedia article content.

Parameters:

  • title (string, required): Article title

Example:

Fetch the Wikipedia article on "Distributed Hash Table"

3. create_obsidian_note

Save a note to your Obsidian vault with wikilinks and backlinks.

Parameters:

  • title (string, required): Note title
  • content (string, required): Note content in markdown
  • tags (array, optional): Tags for the note
  • links (array, optional): Related notes to link

Example:

Create a note titled "Consistent Hashing" with content about the algorithm

4. search_obsidian_notes

Search notes in your Obsidian vault.

Parameters:

  • query (string, required): Search query

Example:

Search my notes for "distributed systems"

5. set_research_mode

Configure research rigor and citation style.

Parameters:

  • mode (string, required): Research mode - strict, balanced, or exploratory
  • citation_style (string, optional): Citation style - inline, footnoted, or minimal

Research Modes:

  • Strict: Only use information from fetched sources, cite everything
  • Balanced: Prioritize sources but add context from general knowledge
  • Exploratory: Use sources as starting points, make broader connections

Example:

Set research mode to strict with inline citations

Usage Examples

Research Workflow

  1. Search for a topic:

    Search Wikipedia for "CAP theorem"
    
  2. Fetch detailed article:

    Fetch the Wikipedia article on "CAP theorem"
    
  3. Create a note:

    Create a note about CAP theorem with tags "distributed-systems" and "theory"
    
  4. Link related concepts:

    Create a note linking to "Consistency Models" and "Distributed Consensus"
    
  5. Search your notes:

    Search my notes for "consistency"
    

Project Structure

research-mcp-server/
β”œβ”€β”€ pyproject.toml              # Project configuration
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ .env.example                # Environment template
β”œβ”€β”€ src/
β”‚   └── research_mcp_server/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ __main__.py         # Entry point
β”‚       β”œβ”€β”€ server.py           # MCP server implementation
β”‚       β”œβ”€β”€ config.py           # Configuration loader
β”‚       β”œβ”€β”€ models.py           # Data models
β”‚       β”œβ”€β”€ research_mode.py    # Research mode manager
β”‚       β”œβ”€β”€ adapters/
β”‚       β”‚   β”œβ”€β”€ __init__.py
β”‚       β”‚   β”œβ”€β”€ base.py         # Abstract adapter
β”‚       β”‚   └── wikipedia.py    # Wikipedia implementation
β”‚       └── obsidian/
β”‚           β”œβ”€β”€ __init__.py
β”‚           └── vault.py        # Obsidian operations
└── tests/
    β”œβ”€β”€ test_wikipedia.py
    β”œβ”€β”€ test_obsidian.py
    └── test_server.py

Development

Running Tests

pip install -e ".[dev]"
pytest

Code Formatting

black src/
ruff check src/

Known Limitations

  • Platform Support: Tested on macOS and Linux only (not Windows)
  • Concurrency: Handles requests serially (MCP SDK manages this)
  • Cache: In-memory only, not persisted between sessions
  • Language: English Wikipedia only
  • Authentication: None (local-only operation)

Troubleshooting

Server doesn't start

  1. Check that OBSIDIAN_VAULT_PATH is set correctly
  2. Verify the vault path exists
  3. Check Claude Desktop logs for errors

Wikipedia requests fail

  • Check your internet connection
  • Wikipedia API may be rate-limiting (server retries automatically)

Notes not appearing in Obsidian

  • Ensure the vault path is correct
  • Check file permissions
  • Refresh Obsidian vault

Philosophy

This project follows these principles:

  • Simplicity First: Use abstractions only where they enable future extensibility
  • Working Software: Prioritize functional, reliable code over architectural perfection
  • Pragmatic Modularity: Clean boundaries between components, no premature generalization
  • Fail Loudly: Clear error messages, obvious failure modes
  • Local-First: Everything runs locally, no external dependencies beyond Wikipedia API

Future Enhancements

Potential additions (not in MVP):

  • Additional knowledge sources (arXiv, PubMed, etc.)
  • Persistent caching
  • Advanced search with filters
  • Note templates
  • Automatic backlink updates

License

MIT License - feel free to use and modify as needed.

Contributing

This is a personal project, but suggestions and improvements are welcome!

About

A small MCP server that lets Claude query Wikipedia and write to an Obsidian vault, with configurable knowledge modes for grounded vs exploratory research.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages