Skip to content

feat: extract @libscope/mcp — MCP server for Claude/Claude Desktop #495

@RobertLD

Description

@RobertLD

Summary

Part of #488. Extract src/mcp/ into a standalone @libscope/mcp package, isolating the @modelcontextprotocol/sdk dependency from library consumers who don't use MCP.

Problem / Motivation

@modelcontextprotocol/sdk is a heavy dependency that's irrelevant to any consumer not integrating with Claude Desktop or the MCP protocol. Today it's bundled into the main package install. Extracting it means library consumers who just want semantic search no longer pay for it.

Proposed Solution

Move src/mcp/ into packages/mcp/ with its own package.json. The package depends on @libscope/core for all data access and exposes a single entry point: the MCP server.

Acceptance Criteria

  • @libscope/mcp builds independently and @modelcontextprotocol/sdk is a dependency of this package only (not @libscope/core)
  • All MCP tools (document management, search, Q&A, webhooks, ratings, tags, links, saved searches) function correctly when the server is started via @libscope/mcp
  • The existing libscope/mcp entry point (dist/mcp/server.js) continues to resolve for backwards compatibility
  • MCP server starts cleanly and passes existing integration tests

Out of Scope

  • Adding new MCP tools
  • Changes to the MCP tool API surface

Technical Notes

  • src/mcp/ contains: server.ts (entry point) and tools/ directory
  • Key dep: @modelcontextprotocol/sdk v1.0 — should move here from root package.json
  • MCP tool handlers must continue to use withErrorHandling() from src/mcp/errors.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrefactorCode refactoring

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions