PERPLEXITY_SETUP.md•9.13 kB
# Setting Up Obsidian MCP with Perplexity
Complete guide to configure your Obsidian MCP server with Perplexity.
## Prerequisites
Before starting:
- [ ] Obsidian running with Local REST API plugin installed and enabled
- [ ] API key copied from Obsidian plugin settings
- [ ] MCP server installed (run `uv sync` or `pip install -e .` in the project directory)
- [ ] Perplexity Desktop app or web access with MCP support
## Step 1: Install the MCP Server
If you haven't already:
```bash
cd custom-obsidian-mcp
# Using uv (recommended)
uv sync
# OR using pip
pip install -e .
```
## Step 2: Test Installation
Verify everything works:
```bash
# Set environment variables temporarily for testing
export OBSIDIAN_API_KEY="your-api-key-here"
export OBSIDIAN_HOST="127.0.0.1"
export OBSIDIAN_PORT="27124"
# Run verification
python verify_installation.py
```
You should see ✅ for all checks.
## Step 3: Find Your uvx or Python Path
You'll need the full path to either `uvx` (if using uv) or `python` (if using pip).
### Find uvx path:
```bash
which uvx
# Example output: /Users/pierregallet/.local/bin/uvx
```
### Find python path:
```bash
which python
# Example output: /usr/local/bin/python3
```
## Step 4: Configure Perplexity
Perplexity uses a configuration file for MCP servers. The exact location depends on your Perplexity setup.
### Configuration Format
Create or edit your Perplexity MCP configuration file with:
**If using uvx (recommended):**
```json
{
"mcpServers": {
"obsidian": {
"command": "/Users/pierregallet/.local/bin/uvx",
"args": ["custom-obsidian-mcp"],
"env": {
"OBSIDIAN_API_KEY": "d64200754fffb4ef4b8f1761c139da765d3255e69079b771fb0695699f210f75",
"OBSIDIAN_HOST": "127.0.0.1",
"OBSIDIAN_PORT": "27124"
}
}
}
}
```
**If using pip/python:**
```json
{
"mcpServers": {
"obsidian": {
"command": "/usr/local/bin/python3",
"args": ["-m", "custom_obsidian_mcp.server"],
"env": {
"OBSIDIAN_API_KEY": "d64200754fffb4ef4b8f1761c139da765d3255e69079b771fb0695699f210f75",
"OBSIDIAN_HOST": "127.0.0.1",
"OBSIDIAN_PORT": "27124"
}
}
}
}
```
### Important Notes:
1. **Replace the API key** with your actual Obsidian API key (I used your example key from the brief)
2. **Use full absolute paths** for the command (no ~, must start with /)
3. **Check the port** matches your Obsidian plugin settings (default: 27124)
## Step 5: Perplexity Configuration Locations
The configuration file location varies by Perplexity version and platform:
### Desktop App (if available):
- **macOS**: `~/Library/Application Support/Perplexity/config.json` (or similar)
- **Windows**: `%APPDATA%\Perplexity\config.json` (or similar)
- **Linux**: `~/.config/perplexity/config.json` (or similar)
### Web Interface:
If Perplexity has MCP configuration in the web interface:
1. Go to Settings → Integrations or Tools
2. Look for "MCP Servers" or "Model Context Protocol"
3. Add a new server with the configuration above
### Alternative: Environment Variables
If Perplexity supports environment-based configuration, you can also export variables:
```bash
# Add to ~/.zshrc or ~/.bashrc
export OBSIDIAN_API_KEY="your-api-key-here"
export OBSIDIAN_HOST="127.0.0.1"
export OBSIDIAN_PORT="27124"
```
Then your Perplexity config becomes simpler:
```json
{
"mcpServers": {
"obsidian": {
"command": "/Users/pierregallet/.local/bin/uvx",
"args": ["custom-obsidian-mcp"]
}
}
}
```
## Step 6: Restart Perplexity
After configuring:
1. **Completely quit** Perplexity (not just close the window)
2. **Restart** the application
3. Wait for it to fully load
## Step 7: Verify Connection
Test that Perplexity can see your MCP server:
**Test Query 1: List Files**
```
List the files in my Obsidian vault
```
Expected: You should see your vault's directory structure.
**Test Query 2: Search**
```
Search my Obsidian vault for notes about [any topic you have notes on]
```
Expected: Search results showing matching notes.
**Test Query 3: Create Note (Safe)**
```
Create a test note called "MCP Test" in my vault with the content "Testing MCP integration"
```
Expected: New note created in your vault.
## Troubleshooting
### Issue: Tools Don't Appear in Perplexity
**Check:**
1. Is the config file in the right location?
2. Is the JSON syntax valid? (Use a JSON validator)
3. Are the paths absolute (starting with /)?
4. Did you restart Perplexity completely?
**Solution:**
```bash
# Validate your JSON
cat your-config-file.json | python -m json.tool
# Check command path exists
ls -la /Users/pierregallet/.local/bin/uvx
# Test MCP server directly
uvx custom-obsidian-mcp
# Should hang (that's good - it's waiting for input)
# Press Ctrl+C to exit
```
### Issue: Connection Error
**Error Message:** "Connection error for GET /vault/"
**Solutions:**
1. Verify Obsidian is running
2. Check Local REST API plugin is enabled in Obsidian
3. Test the API directly:
```bash
curl -k -H "Authorization: Bearer YOUR_API_KEY" https://127.0.0.1:27124/vault/
```
### Issue: Authentication Failed
**Error Message:** "Authentication failed"
**Solutions:**
1. Copy API key again from Obsidian (Settings → Local REST API)
2. Remove any extra spaces from the API key
3. Update BOTH the config file AND any .env files
4. Restart Obsidian and regenerate the key if needed
### Issue: Module Not Found
**Error Message:** "ModuleNotFoundError: No module named 'custom_obsidian_mcp'"
**Solution:**
```bash
# Reinstall
cd custom-obsidian-mcp
uv sync # or: pip install -e .
# Verify
python -c "from custom_obsidian_mcp.server import mcp; print('✅ Server loads')"
```
### Issue: Wrong Python Version
**Error Message:** Python version errors
**Solution:**
```bash
# Check Python version
python --version
# Must be 3.10 or higher
# If too old, install Python 3.11+ and use that path in config
which python3.11
# Use this path in your Perplexity config
```
## Perplexity-Specific Configuration Notes
### If Perplexity uses a different format:
Some MCP clients use slightly different configuration structures. Here are alternatives:
**Alternative Format 1 (Stdio transport explicit):**
```json
{
"mcpServers": {
"obsidian": {
"transport": "stdio",
"command": "/Users/pierregallet/.local/bin/uvx",
"args": ["custom-obsidian-mcp"],
"env": {
"OBSIDIAN_API_KEY": "your-key"
}
}
}
}
```
**Alternative Format 2 (Shell command):**
```json
{
"mcpServers": {
"obsidian": {
"command": "uvx custom-obsidian-mcp",
"env": {
"OBSIDIAN_API_KEY": "your-key"
}
}
}
}
```
## Example Usage in Perplexity
Once configured, you can use natural language:
**Workflow 1: Create Zettelkasten Note**
```
Search my vault for notes about systems thinking,
then create a new atomic note about feedback loops with tags
```
**Workflow 2: Add Connections**
```
Find my note about systems thinking and add a link
to my mental models note in the Related Concepts section
```
**Workflow 3: Organize Notes**
```
Add the tags "zettelkasten" and "permanent-note"
to all my notes about complexity theory
```
## Getting Help
If you're stuck:
1. **Run diagnostics:**
```bash
python verify_installation.py
```
2. **Test API directly:**
```bash
curl -k -H "Authorization: Bearer YOUR_KEY" https://127.0.0.1:27124/vault/
```
3. **Check Perplexity logs** (if available in Settings → Advanced)
4. **Test with Claude Desktop first** (to isolate if it's a Perplexity issue or MCP server issue)
## Platform-Specific Notes
### macOS
- Use full path: `/Users/pierregallet/.local/bin/uvx`
- Config likely in `~/Library/Application Support/Perplexity/`
### Windows
- Use full path like: `C:\Users\Pierre\AppData\Local\Programs\Python\Python311\python.exe`
- Config likely in `%APPDATA%\Perplexity\`
### Linux
- Use full path: `/home/pierre/.local/bin/uvx`
- Config likely in `~/.config/perplexity/`
## Quick Reference
**Your API Key:** `d64200754fffb4ef4b8f1761c139da765d3255e69079b771fb0695699f210f75`
**Default Port:** `27124`
**Server Command:** `uvx custom-obsidian-mcp`
**Minimal Working Config:**
```json
{
"mcpServers": {
"obsidian": {
"command": "/Users/pierregallet/.local/bin/uvx",
"args": ["custom-obsidian-mcp"],
"env": {
"OBSIDIAN_API_KEY": "d64200754fffb4ef4b8f1761c139da765d3255e69079b771fb0695699f210f75",
"OBSIDIAN_HOST": "127.0.0.1",
"OBSIDIAN_PORT": "27124"
}
}
}
}
```
---
## Success Checklist
- [ ] Obsidian running with REST API plugin enabled
- [ ] MCP server installed (`uv sync`)
- [ ] Verification passes (`python verify_installation.py`)
- [ ] Configuration file created with correct paths
- [ ] API key in config matches Obsidian
- [ ] Perplexity restarted completely
- [ ] Test query returns vault files
- [ ] Can create and search notes
Once all boxes are checked, you're ready to use AI-powered Zettelkasten! 🚀
---
**Need the config for Claude Desktop instead?** See QUICKSTART.md in this directory.