Skip to main content
Glama
rossshannon

Pinboard MCP Server

by rossshannon

Pinboard MCP Server

CI Python 3.10+

Доступ только для чтения к закладкам Pinboard.in для LLM через протокол Model Context Protocol (MCP).

Обзор

Этот сервер предоставляет LLM возможность искать, фильтровать и извлекать метаданные закладок из Pinboard.in во время вывода. Построенный на FastMCP 2.0, он предлагает четыре основных инструмента для взаимодействия с закладками, соблюдая ограничения скорости Pinboard и реализуя интеллектуальное кэширование.

Related MCP server: Pinboard MCP Server

Функции

  • Доступ только для чтения к закладкам Pinboard

  • Пять инструментов MCP: search_bookmarks, search_bookmarks_extended, list_recent_bookmarks, list_bookmarks_by_tags, list_tags

  • Умное кэширование с использованием LRU-кэша и автоматической инвалидацией через эндпоинт posts/update

  • Ограничение скорости (Rate limiting): соблюдает рекомендацию Pinboard о 3-секундной задержке между вызовами API

  • Сопоставление полей: преобразует устаревшие имена полей Pinboard в интуитивно понятные (description→title, extended→notes)

  • Комплексное тестирование с использованием интеграционных тестовых наборов и проверки CI

Установка

Через pip (рекомендуется)

pip install pinboard-bookmarks-mcp-server

Из исходного кода

git clone https://github.com/rossshannon/pinboard-bookmarks-mcp-server.git
cd pinboard-bookmarks-mcp-server
pip install -e .

Быстрый старт

  1. Получите ваш API-токен Pinboard на странице https://pinboard.in/settings/password

  2. Установите переменную окружения:

    export PINBOARD_TOKEN="username:1234567890ABCDEF"
  3. Запустите сервер:

    pinboard-mcp-server
  4. Проверьте работоспособность:

    # Test help command (works without token)
    pinboard-mcp-server --help
    
    # Server should show "Starting MCP server" when run with token

Использование с Claude Desktop

Добавьте эту конфигурацию в настройки Claude Desktop:

{
  "mcpServers": {
    "pinboard": {
      "command": "pinboard-mcp-server",
      "env": {
        "PINBOARD_TOKEN": "your-username:your-token-here"
      }
    }
  }
}

Доступные инструменты

1. search_bookmarks

Поиск закладок по строке запроса в заголовках, заметках и тегах. Ориентирован на недавние записи с автоматическим расширением.

Параметры:

  • query (string): Поисковый запрос

  • limit (int, optional): Максимальное количество результатов (по умолчанию: 20, макс: 100)

Пример:

Search for "python testing" bookmarks

2. search_bookmarks_extended

Расширенный поиск для получения полных исторических результатов по заголовкам, заметкам и тегам.

Параметры:

  • query (string): Поисковый запрос

  • days_back (int, optional): За сколько дней искать (по умолчанию: 365, макс: 730)

  • limit (int, optional): Максимальное количество результатов (по умолчанию: 100, макс: 200)

Пример:

Search the last 2 years for "kubernetes" bookmarks

3. list_recent_bookmarks

Список закладок, сохраненных за последние N дней.

Параметры:

  • days (int, optional): Количество дней для поиска (по умолчанию: 7, макс: 30)

  • limit (int, optional): Максимальное количество результатов (по умолчанию: 20, макс: 100)

Пример:

Show me bookmarks from the last 3 days

4. list_bookmarks_by_tags

Список ВСЕХ закладок, отфильтрованных по тегам, с опциональным диапазоном дат. Наиболее эффективно для исторического доступа.

Параметры:

  • tags (array): Список тегов для фильтрации (1-3 тега)

  • from_date (string, optional): Дата начала в формате ISO (YYYY-MM-DD)

  • to_date (string, optional): Дата окончания в формате ISO (YYYY-MM-DD)

  • limit (int, optional): Максимальное количество результатов (по умолчанию: 100, макс: 200)

Пример:

Find bookmarks tagged with "python" and "api" from January 2024

5. list_tags

Список всех тегов с количеством их использования.

Пример:

What are my most used tags?

Конфигурация

Переменные окружения

  • PINBOARD_TOKEN (обязательно): Ваш API-токен Pinboard в формате username:token

Ограничение скорости

Сервер автоматически обеспечивает 3-секундную задержку между вызовами API Pinboard, чтобы соблюдать их рекомендации. Кэшированные ответы возвращаются немедленно.

Стратегия кэширования

  • Кэш запросов: LRU-кэш на 1000 записей для результатов поиска

  • Кэш закладок: Полный список закладок кэшируется на 1 час

  • Инвалидация кэша: Использует эндпоинт posts/update для обнаружения изменений

  • Кэш тегов: Список тегов кэшируется до ручного обновления

Тестирование

Проект включает комплексное покрытие тестами с использованием нескольких стратегий тестирования:

Запуск всех тестов

# Activate virtual environment first
source ~/.venvs/pinboard-bookmarks-mcp-server/bin/activate

# Run all tests with coverage
pytest --cov=src --cov-report=term-missing

Тестирование с реальным API

# 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

Тестирование с мок-API

# Run comprehensive test suite (development only)
python -m pytest tests/ -v

Разработка

Настройка

# 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

Качество кода

# 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

Архитектура

  • FastMCP 2.0: Каркас MCP с абстракцией инструментов и асинхронным сервером FastAPI

  • pinboard.py: Обертка клиента API Pinboard с обработкой ошибок

  • Pydantic: Валидация данных и сериализация с использованием JSON Schema

  • ThreadPoolExecutor: Связывает асинхронный MCP с синхронной библиотекой pinboard.py

  • LRU Cache: Кэширование в памяти с интеллектуальной инвалидацией

Ключевые файлы

  • src/pinboard_mcp_server/main.py - Точка входа сервера MCP и реализация инструментов

  • src/pinboard_mcp_server/client.py - Клиент API Pinboard с кэшированием

  • src/pinboard_mcp_server/models.py - Модели данных Pydantic

  • tests/ - Комплексный набор тестов

  • tests/debug_bookmarks.py - Утилита отладки для тестирования функциональности поиска

  • docs/TEST_HARNESS.md - Документация для тестовых наборов

Производительность

  • Время отклика P50: <250 мс (кэшированные ответы)

  • Время отклика P95: <600 мс (холодный кэш)

  • Ограничение скорости: 3-секундные интервалы между вызовами API

  • Коэффициент попадания в кэш: >90% для типичных шаблонов использования

Безопасность

  • API-токены никогда не логируются и не отображаются в сообщениях об ошибках

  • Доступ к данным Pinboard только для чтения

  • Валидация входных данных для всех параметров инструментов

  • Безопасная обработка переменных окружения

Устранение неполадок

Распространенные проблемы

"PINBOARD_TOKEN environment variable is required"

  • Убедитесь, что вы установили токен: export PINBOARD_TOKEN="username:token"

  • Получите токен на странице https://pinboard.in/settings/password

  • Формат токена должен быть: username:1234567890ABCDEF

"Command not found: pinboard-mcp-server"

  • Убедитесь, что вы установили пакет: pip install pinboard-bookmarks-mcp-server

  • Проверьте, активировано ли ваше окружение Python

  • Попробуйте переустановить: pip uninstall pinboard-bookmarks-mcp-server && pip install pinboard-bookmarks-mcp-server

Сервер запускается, но Claude Desktop не может подключиться

  • Проверьте конфигурацию MCP в настройках Claude Desktop

  • Убедитесь, что путь command правильный: pinboard-mcp-server

  • Убедитесь, что PINBOARD_TOKEN установлен в разделе env

Ошибки "Permission denied" или "Access denied"

  • Проверьте, действителен ли ваш токен Pinboard

  • Проверьте наличие интернет-соединения для доступа к pinboard.in

  • Протестируйте токен вручную по адресу https://pinboard.in/api/v1/posts/recent

Участие в разработке

  1. Сделайте форк репозитория

  2. Создайте ветку для функции (git checkout -b feature/amazing-feature)

  3. Внесите изменения с тестами

  4. Убедитесь, что все тесты проходят и код отформатирован

  5. Отправьте pull request

Лицензия

Лицензия MIT - подробности см. в файле LICENSE.

Available Tools

5 tools
list_bookmarks_by_tagsA

List ALL bookmarks filtered by tags and optional date range.

Args:
    tags: List of tags to filter by (1-3 tags)
    from_date: Start date in ISO format (YYYY-MM-DD), optional
    to_date: End date in ISO format (YYYY-MM-DD), optional
    limit: Maximum number of results to return (1-200, default 100)

Note: Gets ALL bookmarks with specified tags, regardless of age.
Very efficient for tag-based searches. Provides generous data for analysis.
NameRequiredDescriptionDefault
tagsYes
from_dateNo
to_dateNo
limitNo

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions efficiency and generous data but lacks details on ordering, pagination behavior, rate limits, or potential side effects. As a read operation, the safety profile is implicitly clear, but more behavioral context would be beneficial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, with a clear purpose line followed by a structured Args section. Every sentence adds value, and it is front-loaded with the main action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description does not describe return format or structure, only vaguely stating 'generous data for analysis.' For a tool with 4 parameters, more detail on output (e.g., list of bookmark objects) would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, yet the description fully explains each parameter: tags (1-3 tags), from_date/to_date (ISO format, optional), limit (1-200, default 100). This adds essential meaning beyond the schema titles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List ALL bookmarks filtered by tags and optional date range,' specifying the verb (list) and resource (bookmarks) with filtering context. This distinguishes it from siblings like list_recent_bookmarks and search_bookmarks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description notes that it gets all bookmarks regardless of age and is efficient for tag-based searches, implying when to use. However, it does not explicitly state when not to use or compare to alternatives like search_bookmarks for full-text searches.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_recent_bookmarksA

List bookmarks saved in the last N days.

Args:
    days: Number of days to look back (1-30, default 7)
    limit: Maximum number of results to return (1-100, default 20)
NameRequiredDescriptionDefault
daysNo
limitNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes input parameters and default behavior. Without annotations, it adequately indicates a read-only operation listing bookmarks, though no mention of authorization or side effects is needed for this simple list.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise two-line summary followed by clear parameter descriptions in Args format. No extraneous content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple list tool with two parameters. Missing output schema description, but the format is standard and expectable. Could mention ordering (e.g., by date).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds meaning beyond the schema: 'days' is explained as lookback period, 'limit' as max results. Schema has no descriptions, so the description compensates effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states action (list), resource (bookmarks), and time constraint (last N days). Distinguishes from sibling tools like list_bookmarks_by_tags and search_bookmarks by its specific scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implicitly tells when to use (when needing recent bookmarks). Does not explicitly mention when not to use or alternatives like search_bookmarks for more complex queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tagsA

List all tags with their usage counts.

NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, placing the burden on the description. The description states that the tool lists tags with counts but does not disclose whether it is read-only, potential ordering, or pagination behavior. However, for a simple 0-parameter list, the description is minimally adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that is front-loaded with the verb and resource. Every word is necessary and there is no superfluous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no output schema, and a straightforward purpose, the description is largely complete. It specifies what is returned (tags with usage counts). A minor improvement would be to mention ordering or that the list includes all tags, but overall sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters, and schema description coverage is 100%. The description does not need to add parameter semantics since there are none. The baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: listing all tags along with their usage counts. It uses a specific verb ('list') and resource ('tags'), differentiating it from sibling tools which deal with bookmarks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly indicates when to use this tool (when you need a list of all tags and their usage counts). No explicit when-not or alternatives are provided, but the sibling tools have distinctly different purposes, so confusion is unlikely.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_bookmarksA

Search bookmarks by query string across titles, notes, and tags (recent focus).

Args:
    query: Search query to match against bookmark titles, notes, and tags
    limit: Maximum number of results to return (1-100, default 20)

Note: Searches recent bookmarks first, expands automatically if needed.
For comprehensive historical search, use search_bookmarks_extended.
NameRequiredDescriptionDefault
queryYes
limitNo

TDQS

A4.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description discloses behavioral traits: prioritizes recent bookmarks and automatically expands search if needed. This adds value beyond a simple search description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Compact two-sentence description plus a note. First sentence states purpose, then args, then behavioral note. Every sentence is essential, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With only 2 simple params, no output schema, and no annotations, the description fully covers purpose, input semantics, behavioral nuance (recent focus, expansion), and usage alternatives. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has only titles/types with 0% description coverage. The description adds full meaning: query matches against titles, notes, tags; limit is max results (1-100, default 20), fully compensating for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it searches bookmarks by query across titles, notes, and tags, and explicitly differentiates from sibling search_bookmarks_extended via 'recent focus' and 'comprehensive historical search'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Searches recent bookmarks first' and provides alternative 'For comprehensive historical search, use search_bookmarks_extended', giving clear when-to-use and when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_bookmarks_extendedA

Extended search for comprehensive historical results across titles, notes, and tags.

Args:
    query: Search query to match against bookmark titles, notes, and tags
    days_back: How many days back to search (1-730, default 365 = 1 year)
    limit: Maximum number of results to return (1-200, default 100)

Note: Provides comprehensive results while being mindful of server load.
Use tag-based searches for most efficient access to historical bookmarks.
NameRequiredDescriptionDefault
queryYes
days_backNo
limitNo

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the search scope and parameter ranges but lacks details on ordering, pagination, side effects, or read-only behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a clear purpose statement, an Args block, and a practical note. No extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 3 parameters and no output schema, the description covers purpose, parameter details, and a usage tip. It lacks output format or error handling, but is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description adds meaning by clarifying that 'query' matches against titles, notes, and tags, and specifies valid ranges for 'days_back' and 'limit'. This goes beyond the schema's default and type information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Extended search for comprehensive historical results across titles, notes, and tags.' This clearly identifies the tool as a comprehensive search variant, distinguishing it from simpler siblings like 'search_bookmarks'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides guidance to use tag-based searches for efficiency and mentions being mindful of server load. However, it does not explicitly compare with 'search_bookmarks' or state when not to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updates
    • First observedlist_bookmarks_by_tags
    • First observedlist_recent_bookmarks
    • First observedlist_tags
    • First observedsearch_bookmarks
    • First observedsearch_bookmarks_extended

TDQS

A4.1/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a distinct purpose: listing by tags, recent bookmarks, tag counts, and two search variants differentiated by scope (recent vs. historical). Minimal overlap.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern: 'list_' for listing and 'search_' for searching, with descriptive suffixes. No style mixing.

Tool Count4/5

5 tools for a bookmark server is a reasonable count, though the set lacks write operations like add/delete. Still well-scoped for a query-focused service.

Completeness2/5

The tool set covers only read and search operations. Missing essential CRUD actions (create, update, delete bookmarks), which are typical for bookmark management.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables users to access and manage their Pinboard bookmarks directly through Claude Desktop. Supports retrieving, adding, and updating bookmarks with date filtering, tagging, and bookmark analysis capabilities.
    10
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to access and manage Raindrop.io bookmarks, collections, tags, and highlights through the Model Context Protocol. Supports CRUD operations, advanced search, file uploads, and bulk editing of bookmarks.
    85 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to save and search bookmarks using OpenAI's RAG capabilities for intelligent bookmark management and retrieval.
    MIT