Skip to main content
Glama
Pinboard MCP Server

Pinboard MCP Server

by rossshannon

Pinboard MCP サーバー

CI Python 3.10+

Model Context Protocol (MCP) を介して、LLM に Pinboard.in のブックマークへの読み取り専用アクセスを提供します。

概要

このサーバーは、推論時に Pinboard.in からブックマークのメタデータを検索、フィルタリング、取得する機能を LLM に提供します。FastMCP 2.0 上に構築されており、Pinboard のレート制限を遵守し、インテリジェントなキャッシュを実装しながら、ブックマーク操作のための 4 つのコアツールを提供します。

Related MCP server: Raindrop.io MCP Server

特徴

  • Pinboard ブックマークへの読み取り専用アクセス

  • 5 つの MCP ツール: search_bookmarks, search_bookmarks_extended, list_recent_bookmarks, list_bookmarks_by_tags, list_tags

  • LRU キャッシュと posts/update エンドポイントを使用した自動無効化によるスマートキャッシュ

  • API 呼び出し間の 3 秒間隔という Pinboard のガイドラインを遵守するレート制限

  • 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. https://pinboard.in/settings/password から Pinboard API トークンを取得します。

  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 (必須): username:token 形式の Pinboard API トークン

レート制限

サーバーは、Pinboard のガイドラインを遵守するため、Pinboard API 呼び出し間に 3 秒の遅延を自動的に強制します。キャッシュされた応答は即座に返されます。

キャッシュ戦略

  • クエリキャッシュ: 検索結果用の 1000 エントリの LRU キャッシュ

  • ブックマークキャッシュ: 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: ツール抽象化と非同期 FastAPI サーバーを備えた MCP スキャフォールディング

  • pinboard.py: エラーハンドリングを備えた Pinboard API クライアントラッパー

  • Pydantic: JSON Schema を使用したデータ検証とシリアライズ

  • ThreadPoolExecutor: 非同期 MCP と同期 pinboard.py ライブラリをブリッジ

  • LRU Cache: インテリジェントな無効化機能を備えたメモリ内キャッシュ

主要ファイル

  • src/pinboard_mcp_server/main.py - MCP サーバーのエントリポイントとツール実装

  • src/pinboard_mcp_server/client.py - キャッシュ機能付き Pinboard API クライアント

  • src/pinboard_mcp_server/models.py - Pydantic データモデル

  • tests/ - 包括的なテストスイート

  • tests/debug_bookmarks.py - 検索機能をテストするためのデバッグユーティリティ

  • docs/TEST_HARNESS.md - テストハーネスのドキュメント

パフォーマンス

  • P50 応答時間: <250ms (キャッシュされた応答)

  • P95 応答時間: <600ms (コールドキャッシュ)

  • レート制限: API 呼び出し間に 3 秒の間隔

  • キャッシュヒット率: 一般的な使用パターンで >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 が接続できない

  • Claude Desktop 設定の MCP 構成を確認してください

  • command パスが正しいことを確認してください: pinboard-mcp-server

  • env セクションで PINBOARD_TOKEN が設定されていることを確認してください

"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. プルリクエストを送信します

ライセンス

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 recent community issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    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.
    238 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
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables language models to access and manage Raindrop.io bookmarks, collections, tags, and highlights through the Model Context Protocol.
    24 npm
    MIT