Skip to main content
Glama
linklibrary-mcp
by msmygit

@msmygit/linklibrary-mcp

NPM Downloads GitHub contributors Static Badge NPM Last Update NPM License NPM Version

A high-performance, production-ready Model Context Protocol (MCP) server that provides AI assistants with programmatic access to LinkLibrary.ai bookmark management capabilities.

๐Ÿš€ Features

โœจ Core Features

  • ๐Ÿ” Secure Authentication - JWT-based authentication with automatic token refresh

  • ๐Ÿ“š Bookmark Management - Create, retrieve, and organize bookmarks with rich metadata

  • ๐Ÿ“ Collections & Tags - Manage bookmark organization with collections and tags

  • ๐Ÿ” Advanced Search - Powerful search with multiple filters and operators

  • ๐Ÿ“Š Analytics - Get insights about your bookmark usage and patterns

  • ๐Ÿค– AI Integration - Works seamlessly with Claude Desktop, VSCode, and other MCP clients

๐Ÿ—๏ธ Architecture Features

  • โšก High Performance - In-memory caching with LRU eviction and TTL

  • ๐Ÿ›ก๏ธ Rate Limiting - Configurable rate limiting with sliding window

  • ๐Ÿ“ˆ Metrics Driven - Comprehensive performance monitoring and logging

  • ๐Ÿ”„ Retry Logic - Automatic retry with exponential backoff

  • ๐Ÿ”’ Error Handling - Robust error handling with proper error types

  • ๐Ÿงช Test Coverage - Comprehensive test suite with mocking

Related MCP server: bookmark-mcp

๐Ÿ› ๏ธ Installation

For End Users

The package is published on npm and can be used directly with MCP clients:

{
  "mcpServers": {
    "linklibrary-mcp": {
      "command": "npx",
      "args": ["-y", "@msmygit/linklibrary-mcp@latest"],
      "env": {
        "LL_USERNAME": "your_email@example.com",
        "LL_PASSWORD": "your_password"
      }
    }
  }
}

For Developers

npm install @msmygit/linklibrary-mcp

๐Ÿ”ง Configuration

Environment Variables

Variable

Description

Default

Required

LL_USERNAME

LinkLibrary.ai email address

-

Yes*

LL_PASSWORD

LinkLibrary.ai password

-

Yes*

LL_TOKEN

LinkLibrary.ai API token

-

Yes*

LINKLIBRARY_API_URL

API base URL

https://api.linklibrary.ai/api/v1

No

API_TIMEOUT_MS

API request timeout

30000

No

API_MAX_RETRIES

Maximum retry attempts

3

No

CACHE_TTL_SECONDS

Cache TTL in seconds

300

No

CACHE_MAX_SIZE

Maximum cache entries

1000

No

RATE_LIMIT_REQUESTS

Rate limit requests per window

100

No

RATE_LIMIT_WINDOW_MS

Rate limit window in ms

60000

No

LOG_LEVEL

Logging level

info

No

ENABLE_METRICS

Enable performance metrics

false

No

*Either LL_USERNAME/LL_PASSWORD or LL_TOKEN is required.

MCP Client Configuration

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "linklibrary-mcp": {
      "command": "npx",
      "args": ["-y", "@msmygit/linklibrary-mcp@latest"],
      "env": {
        "LL_USERNAME": "your_email@example.com",
        "LL_PASSWORD": "your_password",
        "ENABLE_METRICS": "true"
      }
    }
  }
}

VSCode

Add to your VSCode settings:

{
  "mcp.servers": {
    "linklibrary-mcp": {
      "command": "npx",
      "args": ["-y", "@msmygit/linklibrary-mcp@latest"],
      "env": {
        "LL_USERNAME": "your_email@example.com",
        "LL_PASSWORD": "your_password"
      }
    }
  }
}

๐Ÿ› ๏ธ Available Tools

Authentication

  • authenticate - Authenticate with LinkLibrary credentials

Bookmark Management

  • get_links - Retrieve bookmarks with filtering and pagination

  • create_link - Create new bookmarks with metadata

Organization

  • get_collections - Retrieve user collections

  • get_tags - Retrieve user tags

Search & Analytics

  • search_advanced - Advanced search with multiple filters

  • get_user_stats - Get user statistics and insights

๐Ÿ’ก Usage Examples

Once connected to your MCP client, you can ask:

  • "Show me my recent bookmarks"

  • "Create a bookmark for this article about AI"

  • "Search for machine learning resources in my Development collection"

  • "Show me my bookmark statistics for this month"

  • "What are my most used tags?"

๐Ÿ—๏ธ Architecture

Core Components

linklibrary-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ types.ts              # TypeScript type definitions
โ”‚   โ”œโ”€โ”€ config.ts             # Configuration management
โ”‚   โ”œโ”€โ”€ server.ts             # Main MCP server implementation
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ api-client.ts     # HTTP client with retry logic
โ”‚   โ”‚   โ””โ”€โ”€ auth-service.ts   # Authentication management
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ logger.ts         # Structured logging with metrics
โ”‚       โ”œโ”€โ”€ cache.ts          # In-memory LRU cache
โ”‚       โ””โ”€โ”€ rate-limiter.ts   # Rate limiting implementation
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ build.js              # Build script
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ server.test.ts        # Comprehensive test suite
โ””โ”€โ”€ package.json              # npm package configuration

Performance Features

๐Ÿš€ Caching

  • In-memory LRU cache with configurable TTL

  • Automatic cache invalidation on data changes

  • Cache hit rate monitoring and statistics

โšก Rate Limiting

  • Sliding window rate limiting for API protection

  • Configurable limits per operation type

  • Rate limit monitoring and reporting

๐Ÿ“Š Metrics & Monitoring

  • Performance metrics collection and reporting

  • Request/response timing with percentiles

  • Error rate tracking and alerting

  • Cache performance monitoring

๐Ÿ”„ Retry Logic

  • Exponential backoff for transient failures

  • Configurable retry attempts and delays

  • Smart retry conditions (5xx errors, timeouts)

๐Ÿงช Development

Prerequisites

  • Node.js 18+

  • npm or yarn

Setup

git clone <repository-url>
cd linklibrary-mcp
npm install

Development Commands

# Build the package
npm run build

# Run in development mode
npm run dev

# Run tests
npm test

# Run tests with coverage
npm test -- --coverage

# Lint code
npm run lint

# Format code
npm run format

Testing

The project includes comprehensive tests:

  • Unit tests for all services and utilities

  • Integration tests for API interactions

  • Mock testing for external dependencies

  • Performance tests for caching and rate limiting

# Run all tests
npm test

# Run specific test suites
npm test -- --testNamePattern="Authentication"
npm test -- --testNamePattern="Cache"

Building for Production

# Build the package
npm run build

# Test the built package
npm start

# Publish to npm
npm publish

๐Ÿ“Š Performance

Benchmarks

  • Response Time: < 100ms for cached requests

  • Throughput: 1000+ requests per minute

  • Memory Usage: < 50MB for typical usage

  • Cache Hit Rate: > 80% for read operations

Monitoring

Enable metrics collection by setting ENABLE_METRICS=true:

export ENABLE_METRICS=true
npx @msmygit/linklibrary-mcp

Metrics include:

  • Request count and response times

  • Cache hit/miss rates

  • Rate limit usage

  • Error rates and types

๐Ÿ”’ Security

Security Features

  • No local storage - credentials not stored locally

  • Environment variables - secure credential management

  • API authentication - uses LinkLibrary.ai's secure API

  • Rate limiting - protection against abuse

  • Input validation - comprehensive parameter validation

  • Error sanitization - no sensitive data in error messages

Best Practices

  • Use environment variables for credentials

  • Enable metrics only in development

  • Monitor rate limit usage

  • Regularly update dependencies

  • Use HTTPS for all API communications

๐Ÿ› Troubleshooting

Common Issues

Authentication Errors

# Check environment variables
echo $LL_USERNAME
echo $LL_PASSWORD

# Verify API connectivity
curl -I https://linklibrary.ai/api/health

Performance Issues

# Check cache statistics
# Enable debug logging
export LOG_LEVEL=debug

# Monitor rate limits
# Check rate limit configuration

Connection Issues

# Test API connectivity
curl https://linklibrary.ai/api/health

# Check network configuration
ping linklibrary.ai

Debug Mode

Enable debug logging for troubleshooting:

export LOG_LEVEL=debug
export ENABLE_METRICS=true
npx @msmygit/linklibrary-mcp

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Guidelines

  • Follow TypeScript best practices

  • Add tests for new features

  • Update documentation as needed

  • Follow the existing code style

  • Ensure all tests pass before submitting

๐Ÿ“ž Support


Built with โค๏ธ for the AI community

Available Tools

7 tools
authenticateC

Authenticate with LinkLibrary credentials

Inputs: password (required), username (required).

get_collectionsC

Retrieve user collections

Inputs: include_default.

get_tagsC

Retrieve user tags

Inputs: include_counts.

get_user_statsC

Get user statistics and insights (currently not available)

Inputs: period.

search_advancedC

Perform advanced search with multiple filters

Inputs: query (required), limit, tag_ids, operator, +1 more.

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    TDQS

    C2.9/5.0

    Scored across 7 tools

    Disambiguation3/5

    Most tools target a distinct resource (collections, tags, auth), but get_links and search_advanced overlap substantially โ€” both retrieve links with filters, and the descriptions don't clearly delineate when to use one over the other. get_user_stats is also explicitly non-functional, which adds noise to selection.

    Naming Consistency4/5

    The dominant pattern is verb_noun (get_links, create_link, get_collections, get_tags, get_user_stats), which is predictable. Minor deviations are 'authenticate' (bare verb) and 'search_advanced' (verb_adjective rather than verb_noun), but overall still readable and consistent.

    Tool Count4/5

    Seven tools is a well-scoped size for a bookmark manager covering auth, links, collections, tags, and search. However, one of the seven (get_user_stats) is marked unavailable, effectively leaving six useful tools and one dead entry.

    Completeness2/5

    The surface is read-plus-create only: create_link exists but there is no update_link or delete_link, and collections/tags can only be listed, not created or modified. Combined with a non-functional get_user_stats, agents cannot complete standard bookmark lifecycle workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • 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
      A
      quality
      F
      maintenance
      A bookmark management MCP server that enables saving, searching, and managing bookmarks with tags and read/unread status, providing tools, resources, and prompts for integration.
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to manage bookmarks (webpages, articles, videos) on behalf of users, including registration, categorization, tagging, and sharing.
      20
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides authenticated bookmark management tools via MCP, including adding, deleting, listing, and searching bookmarks.
      -