Pinboard MCP Server - Read-only access to Pinboard bookmarks for LLMs
Project description
Pinboard MCP Server
Read-only access to Pinboard.in bookmarks for LLMs via Model Context Protocol (MCP).
Overview
This server provides LLMs with the ability to search, filter, and retrieve bookmark metadata from Pinboard.in at inference time. Built on FastMCP 2.0, it offers four core tools for bookmark interaction while respecting Pinboard's rate limits and implementing intelligent caching.
Features
- Read-only access to Pinboard bookmarks
- Five MCP tools:
search_bookmarks,search_bookmarks_extended,list_recent_bookmarks,list_bookmarks_by_tags,list_tags - Smart caching with LRU cache and automatic invalidation using
posts/updateendpoint - Rate limiting respects Pinboard's 3-second guideline between API calls
- Field mapping converts Pinboard's legacy field names to intuitive ones (description→title, extended→notes)
- Comprehensive testing with integration test harnesses and CI validation
Installation
Via pip (recommended)
pip install pinboard-bookmarks-mcp-server
From source
git clone https://github.com/rossshannon/pinboard-bookmarks-mcp-server.git
cd pinboard-bookmarks-mcp-server
pip install -e .
Quick Start
- Get your Pinboard API token from https://pinboard.in/settings/password
- Set environment variable:
export PINBOARD_TOKEN="username:1234567890ABCDEF"
- Start the server:
pinboard-mcp-server
- Verify it's working:
# Test help command (works without token) pinboard-mcp-server --help # Server should show "Starting MCP server" when run with token
Usage with Claude Desktop
Add this configuration to your Claude Desktop settings:
{
"mcpServers": {
"pinboard": {
"command": "pinboard-mcp-server",
"env": {
"PINBOARD_TOKEN": "your-username:your-token-here"
}
}
}
}
Available Tools
1. search_bookmarks
Search bookmarks by query string across titles, notes, and tags. Recent-focused with automatic expansion.
Parameters:
query(string): Search querylimit(int, optional): Maximum results (default: 20, max: 100)
Example:
Search for "python testing" bookmarks
2. search_bookmarks_extended
Extended search for comprehensive historical results across titles, notes, and tags.
Parameters:
query(string): Search querydays_back(int, optional): How many days back to search (default: 365, max: 730)limit(int, optional): Maximum results (default: 100, max: 200)
Example:
Search the last 2 years for "kubernetes" bookmarks
3. list_recent_bookmarks
List bookmarks saved in the last N days.
Parameters:
days(int, optional): Days to look back (default: 7, max: 30)limit(int, optional): Maximum results (default: 20, max: 100)
Example:
Show me bookmarks from the last 3 days
4. list_bookmarks_by_tags
List ALL bookmarks filtered by tags with optional date range. Most efficient for historical access.
Parameters:
tags(array): List of tags to filter by (1-3 tags)from_date(string, optional): Start date in ISO format (YYYY-MM-DD)to_date(string, optional): End date in ISO format (YYYY-MM-DD)limit(int, optional): Maximum results (default: 100, max: 200)
Example:
Find bookmarks tagged with "python" and "api" from January 2024
5. list_tags
List all tags with their usage counts.
Example:
What are my most used tags?
Configuration
Environment Variables
PINBOARD_TOKEN(required): Your Pinboard API token in formatusername:token
Rate Limiting
The server automatically enforces a 3-second delay between Pinboard API calls to respect their guidelines. Cached responses are returned immediately.
Caching Strategy
- Query cache: LRU cache with 1000 entries for search results
- Bookmark cache: Full bookmark list cached for 1 hour
- Cache invalidation: Uses
posts/updateendpoint to detect changes - Tag cache: Tag list cached until manually refreshed
Testing
The project includes comprehensive test coverage with multiple test strategies:
Run all tests
# Activate virtual environment first
source ~/.venvs/pinboard-bookmarks-mcp-server/bin/activate
# Run all tests with coverage
pytest --cov=src --cov-report=term-missing
Real API testing
# Set your Pinboard token
export PINBOARD_TOKEN="username:token"
# Run debug utility to test search functionality (development only)
PINBOARD_TOKEN="username:token" python tests/debug_bookmarks.py
Mock API testing
# Run comprehensive test suite (development only)
python -m pytest tests/ -v
Development
Setup
# Clone and setup
git clone https://github.com/rossshannon/pinboard-bookmarks-mcp-server.git
cd pinboard-bookmarks-mcp-server
# Quick development setup
./scripts/dev-setup.sh
Code Quality
# Activate environment
source ~/.venvs/pinboard-bookmarks-mcp-server/bin/activate
# Linting and formatting
ruff check src/ tests/
ruff format src/ tests/
# Type checking
mypy src/
# Run tests
pytest -v
# Build package
./scripts/build.sh
Architecture
- FastMCP 2.0: MCP scaffolding with Tool abstraction and async FastAPI server
- pinboard.py: Pinboard API client wrapper with error handling
- Pydantic: Data validation and serialization with JSON Schema
- ThreadPoolExecutor: Bridges async MCP with sync pinboard.py library
- LRU Cache: In-memory caching with intelligent invalidation
Key Files
src/pinboard_mcp_server/main.py- MCP server entry point and tool implementationssrc/pinboard_mcp_server/client.py- Pinboard API client with cachingsrc/pinboard_mcp_server/models.py- Pydantic data modelstests/- Comprehensive test suitetests/debug_bookmarks.py- Debug utility for testing search functionalitydocs/TEST_HARNESS.md- Documentation for test harnesses
Performance
- P50 response time: <250ms (cached responses)
- P95 response time: <600ms (cold cache)
- Rate limiting: 3-second intervals between API calls
- Cache hit ratio: >90% for typical usage patterns
Security
- API tokens are never logged or exposed in error messages
- Read-only access to Pinboard data
- Input validation on all tool parameters
- Secure environment variable handling
Troubleshooting
Common Issues
"PINBOARD_TOKEN environment variable is required"
- Make sure you've set your token:
export PINBOARD_TOKEN="username:token" - Get your token from https://pinboard.in/settings/password
- Token format should be:
username:1234567890ABCDEF
"Command not found: pinboard-mcp-server"
- Ensure you've installed the package:
pip install pinboard-bookmarks-mcp-server - Check your Python environment is activated
- Try reinstalling:
pip uninstall pinboard-bookmarks-mcp-server && pip install pinboard-bookmarks-mcp-server
Server starts but Claude Desktop can't connect
- Verify the MCP configuration in Claude Desktop settings
- Check that the
commandpath is correct:pinboard-mcp-server - Ensure the
PINBOARD_TOKENis set in theenvsection
"Permission denied" or "Access denied" errors
- Verify your Pinboard token is valid and active
- Check you have internet connectivity to reach pinboard.in
- Test your token manually at https://pinboard.in/api/v1/posts/recent
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Ensure all tests pass and code is formatted
- Submit a pull request
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pinboard_bookmarks_mcp_server-1.0.1.tar.gz.
File metadata
- Download URL: pinboard_bookmarks_mcp_server-1.0.1.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ec488ce87cd1810cec1a004dc329ff4f2ae17267937a7053261a721537455cb
|
|
| MD5 |
e19a1f8b4431fd53f9205ccda3ad9c25
|
|
| BLAKE2b-256 |
0016904846560117fb3ebebe998510e40b914fe8703980fb088cd9ef44750ef0
|
Provenance
The following attestation bundles were made for pinboard_bookmarks_mcp_server-1.0.1.tar.gz:
Publisher:
publish-trusted.yml on rossshannon/pinboard-bookmarks-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pinboard_bookmarks_mcp_server-1.0.1.tar.gz -
Subject digest:
4ec488ce87cd1810cec1a004dc329ff4f2ae17267937a7053261a721537455cb - Sigstore transparency entry: 1428801797
- Sigstore integration time:
-
Permalink:
rossshannon/pinboard-bookmarks-mcp-server@5b786689980e0fdd99493764595ad416d0a04171 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/rossshannon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-trusted.yml@5b786689980e0fdd99493764595ad416d0a04171 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pinboard_bookmarks_mcp_server-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pinboard_bookmarks_mcp_server-1.0.1-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aafbe50e5f0b79a04efbf4a90026996e35ed90732a7f7242398a584f86688695
|
|
| MD5 |
986873cc4b56e4035a1cf32d79764e86
|
|
| BLAKE2b-256 |
e8c5109e91d1b191290588f5c38ba8628cb72540a6fb164418e4aafc2cda1195
|
Provenance
The following attestation bundles were made for pinboard_bookmarks_mcp_server-1.0.1-py3-none-any.whl:
Publisher:
publish-trusted.yml on rossshannon/pinboard-bookmarks-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pinboard_bookmarks_mcp_server-1.0.1-py3-none-any.whl -
Subject digest:
aafbe50e5f0b79a04efbf4a90026996e35ed90732a7f7242398a584f86688695 - Sigstore transparency entry: 1428801800
- Sigstore integration time:
-
Permalink:
rossshannon/pinboard-bookmarks-mcp-server@5b786689980e0fdd99493764595ad416d0a04171 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/rossshannon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-trusted.yml@5b786689980e0fdd99493764595ad416d0a04171 -
Trigger Event:
release
-
Statement type: