@linkedmash/mcp
v1.2.0
Published
MCP server for LinkedIn saved posts: search and label your saved library, then draft, schedule and publish from it.
Maintainers
Readme
Linkedmash MCP Service
A Model Context Protocol (MCP) service that provides AI assistants with access to Linkedmash bookmark management capabilities.
Overview
This MCP service allows AI assistants to:
- List user's LinkedIn bookmarks with filtering and pagination
- Search through bookmarks using text queries
- Get bookmark counts with various filters
- Filter by read status, media type, author, tags, and date ranges
Setup
Prerequisites
- Node.js 18+
- A valid Linkedmash API token
Environment Variables
Create a .env file in the mcp-service directory:
LINKEDMASH_TOKEN=your_linkedmash_api_token_here
LINKEDMASH_WEBAPP_URL=https://www.linkedmash.com # URL to the webapp for setup endpoints
NODE_ENV=developmentInstallation
# Install dependencies
npm install
# Run the service
npm start
# For development with auto-restart
npm run devDocker Setup
# Build and run with docker-compose
docker-compose up mcp-service
# For development mode
docker-compose --profile dev up mcp-service-devAvailable Tools
1. list_bookmarks
Lists user's LinkedIn bookmarks with optional filtering and pagination.
Parameters:
limit(number, 1-100): Number of bookmarks to retrievecursor(string): Pagination cursor for next pageis_unread_only(boolean): Filter to only unread bookmarkshide_archived(boolean): Hide archived bookmarksmedia_type(enum): Filter by media type (thread, media, replies, notes, links)author(string): Filter by author usernametag(string): Filter by tagposted_from/posted_to(string): Filter by post posting date rangebookmarked_from/bookmarked_to(string): Filter by bookmark date rangesort_by(enum): Sort order for results
2. search_bookmarks
Searches through bookmarks using a text query.
Parameters:
q(string, required): Search query- All the same filtering parameters as
list_bookmarks
3. get_bookmark_count
Gets the total count of bookmarks with optional filtering.
Parameters:
- All filtering parameters except
limit,cursor, andsort_by
4. setup_vector_store
Initializes the vector store for semantic search. Call this when vector/semantic search fails with "Vector Store Not Setup" error.
Parameters: None
Note: This is an async operation that may take a few minutes to complete for large bookmark collections.
API Integration
The service integrates with the Linkedmash API at https://api.linkedmash.com/v1/bookmarks using Bearer token authentication.
Error Handling
The service includes comprehensive error handling and validation:
- Invalid API tokens return authentication errors
- Malformed requests are validated using Zod schemas
- API errors are properly formatted and returned to the client
Development
The service is built using:
- @modelcontextprotocol/sdk for MCP protocol implementation
- Zod for request/response validation
- Standard Node.js fetch for API calls
Usage with AI Assistants
This MCP service can be integrated with AI assistants that support the Model Context Protocol, allowing them to access and manage Linkedmash bookmarks on behalf of users.
