Vasallo94/obsidian-mcp-server
If you are the rightful owner of obsidian-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Obsidian MCP Server allows users to interact with their Obsidian vault using natural language commands through Claude Desktop or an IDE.
listar_notas
List vault notes
leer_nota
Read note content
buscar_en_notas
Search text in notes
buscar_notas_por_fecha
Search by date
crear_nota
Create new note
agregar_a_nota
Add content to existing note
estadisticas_vault
Complete vault statistics
๐ง Obsidian MCP Server
A modular Model Context Protocol (MCP) server for interacting with your Obsidian vault from Claude Desktop or your IDE. Navigate, search, create, and analyze your Obsidian notes using natural language commands.
โจ Features
๐ Navigation & Search
- List notes: Explore all notes organized by folders
- Read notes: Get complete content of any note
- Text search: Find specific content across your entire vault
- Date search: Locate notes by modification date range
โ๏ธ Creation & Editing
- Create notes: New notes with metadata and tags
- Add content: Modify existing notes
๐ Analysis
- Vault statistics: Complete analysis of your knowledge
- Metrics: Words, characters, tags, internal links
- Temporal activity: Track your productivity
๐ Installation
Prerequisites
- Python 3.11+
- uv (dependency manager)
- An Obsidian vault
Installation Steps
-
Clone the repository:
git clone <your-repository> cd obsidian-mcp-server
-
Install dependencies:
uv sync
-
Configure your vault:
cp .env.example .env
Edit
.env
and set your vault path:OBSIDIAN_VAULT_PATH="/path/to/your/obsidian/vault"
-
Run the server:
# Using the new modular entry point (recommended) uv run obsidian-mcp-server
-
Run tests (optional):
uv run pytest
Quick Setup Script
For automated setup, use the included setup script:
./setup.sh
This script will:
- โ Check if UV is installed
- ๐ฆ Install all dependencies
- ๐ง Create
.env
file from template - ๐งช Run verification tests
- ๐ Provide next steps
๐ง Configuration
Environment Variables
The .env
file must contain:
# Full path to your Obsidian vault
OBSIDIAN_VAULT_PATH="/Users/username/Documents/MyVault"
Claude Desktop Configuration
To use this server with Claude Desktop, add the following configuration to your Claude config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"obsidian-mcp": {
"command": [
"uv",
"run",
"--directory",
"/Users/username/path/to/obsidian-mcp-server",
"obsidian-mcp-server"
]
}
}
}
(Similar process for other MCP-compatible IDEs like VSCode, Cursor, etc.)
๐ ๏ธ Available Tools
๐ Navigation
listar_notas(carpeta?, incluir_subcarpetas?)
: List vault notesleer_nota(nombre_archivo)
: Read note contentbuscar_en_notas(texto, carpeta?, solo_titulos?)
: Search text in notesbuscar_notas_por_fecha(fecha_desde, fecha_hasta?)
: Search by date
โ๏ธ Creation & Editing
crear_nota(titulo, contenido, carpeta?, etiquetas?)
: Create new noteagregar_a_nota(nombre_archivo, contenido, al_final?)
: Add content to existing note
๐ค Prompt Engineering (NEW!)
guardar_prompt_refinado(titulo, prompt_original, prompt_refinado, contexto, tags?, carpeta?)
: Save refined prompts for reuseactualizar_prompt_biblioteca(nombre_prompt, nuevas_notas?, calificacion?, casos_uso_adicionales?, variaciones?)
: Update existing promptslistar_biblioteca_prompts()
: List all saved prompts in your library
๐ Analysis
estadisticas_vault()
: Complete vault statistics
๐ก Usage Examples
Once connected to Claude Desktop, you can use commands like:
Basic Operations
- "Show me all my notes about artificial intelligence"
- "Create a note called 'Project Ideas' in the Work folder"
- "What are my vault statistics?"
- "Find notes modified in the last 7 days"
- "Read my note about meditation"
NEW! Prompt Engineering Features
- "Save this refined prompt to my vault" - After Claude creates a great prompt
- "Show me all my saved prompts" - List your prompt library
- "Update my 'Creative Writing' prompt with new usage notes" - Improve existing prompts
Smart Prompt Management Workflow
- Work with Claude on refining a prompt until it works perfectly
- Say: "Save this refined prompt as 'Data Analysis Helper' with context about when to use it"
- Claude uses
guardar_prompt_refinado()
to save it to your Obsidian vault - Later, access your prompt library anytime for reuse and iteration
๐งช Testing
Run the test suite to verify everything works correctly:
# Run all tests
uv run pytest
# Run with verbose output
uv run pytest -v
# Run specific test class
uv run pytest tests/test_basic.py::TestConfiguration
The test suite uses anyio
for asynchronous tests and includes:
- โ Module imports and dependencies
- โ Environment configuration
- โ MCP server initialization
- โ Vault content validation
- โ Tool registration verification
- โ Project structure checks
๐๏ธ Project Structure
Modular Architecture
obsidian-mcp-server/
โโโ obsidian_mcp/ # ๐ฆ Main package (modular structure)
โ โโโ __init__.py # Package exports
โ โโโ config.py # โ๏ธ Configuration and environment
โ โโโ server.py # ๐ Main MCP server
โ โโโ tools/ # ๐ ๏ธ MCP tools organized by category
โ โ โโโ __init__.py
โ โ โโโ navigation.py # ๐ Navigation (list, read, search)
โ โ โโโ creation.py # โ๏ธ Note creation and editing
โ โ โโโ analysis.py # ๐ Analysis and statistics
โ โโโ resources/ # ๐ MCP resources
โ โ โโโ __init__.py
โ โ โโโ vault_info.py # โน๏ธ Vault information
โ โโโ prompts/ # ๐ญ Specialized prompts
โ โ โโโ __init__.py
โ โ โโโ assistant.py # ๐ค Assistant prompts
โ โโโ utils/ # ๐ง Shared utilities
โ โโโ __init__.py
โ โโโ vault.py # ๐ Vault utilities
โ โโโ logging.py # ๐ Logging configuration
โโโ main.py # ๐ฏ Main entry point
โโโ diagnose.py # ๐ Diagnostic script
โโโ pyproject.toml # Project configuration
โโโ pytest.ini # Test configuration
โโโ setup.sh # Automated setup script
โโโ .env # Environment variables (not in git)
โโโ .env.example # Configuration template
โโโ .gitignore # Git ignore rules
โโโ README.md # This documentation
โโโ LICENSE # MIT License
โโโ uv.lock # Dependency lock file
โโโ tests/ # Test suite
โโโ __init__.py
โโโ conftest.py
โโโ test_basic.py
Benefits of Modular Architecture
- Separation of concerns: Each module has a specific responsibility
- Maintainability: Organized code that's easy to locate and modify
- Scalability: Easy to add new tools and extend functionality
- Testing: Isolated tests for better coverage and reliability
- Reusability: Components can be imported and used independently
Usage Examples
# Run the server
uv run main.py
# Import modular components
python -c "from obsidian_mcp import create_server; print('โ
Modular import works')"
# Run diagnostics
uv run diagnose.py
๐ Future Features & Roadmap
Here are some exciting features planned for future releases:
๐ค AI-Powered Intelligence
- Smart Connection Suggestions: AI-powered analysis to suggest meaningful links between related notes based on content similarity and semantic relationships
- Semantic Search: Search by meaning and context, not just exact word matches - find conceptually related content even when different terminology is used
- Question Answering: Ask specific questions about your vault content and get intelligent answers based on your knowledge base
๐ Prompt Engineering Toolkit
- Refined Prompt Library: Automatically save and organize successful prompts from AI conversations for reuse and refinement
- Prompt Templates: Create template prompts for common tasks and scenarios
- Conversation Context Preservation: Save important AI conversation contexts as structured notes
๐ Advanced Analysis
- Knowledge Graph Visualization: Understand connections and patterns in your knowledge base
- Content Gap Detection: Identify areas where your knowledge could be expanded
- Learning Path Suggestions: AI-recommended reading and study paths based on your current knowledge
๐ Enhanced Connectivity
- Auto-linking Intelligence: Suggest and create links between conceptually related notes
- Broken Link Management: Detect and help fix broken internal links
- Cross-Reference Analysis: Deep analysis of how concepts relate across your vault
๐ Smart Organization
- Auto-tagging: Intelligent tag suggestions based on content analysis
- Dynamic Organization: AI-suggested folder structures and note categorization
- Duplicate Content Detection: Find and manage similar or duplicate content
These features will make your Obsidian vault not just a storage system, but an intelligent knowledge companion that grows and learns with you.
Want to contribute to any of these features? Check out our contributing guidelines below!
๐ค Contributing
Contributions are welcome! Please:
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
๐ License
This project is licensed under the MIT License. See LICENSE
for details.
๐ Useful Links
โ ๏ธ Notes
- Make sure the Obsidian vault path is correct
- The server requires read/write permissions in the vault directory
- Changes are immediately reflected in Obsidian