Skip to main content
Glama
MCP CopyQ Server
by list91

MCP CopyQ Server

MCP-сервер для интеграции CopyQ (менеджер буфера обмена) с LLM-агентами.

Концепция

Структура данных в CopyQ

mcp/
├── info/        # 🔒 только элементы (без подвкладок)
├── заметки/     # 🔒 только элементы (без подвкладок)
└── workspace/   # ✅ элементы + подвкладки

Элемент (Item)

Каждый элемент содержит:

  • text — основной текст

  • tags — метки (массив строк)

  • note — заметка к тексту


Related MCP server: copyq-mcp

Инструменты (3 шт.)

1. mcp_read

Универсальное чтение данных.

Параметры

Параметр

Тип

Default

Описание

mode

"tree" / "list" / "item" / "search"

—

обязательный

tab

string

""

Путь: "info", "workspace/proj1"

index

number

—

Для mode=item

query

string

—

Для mode=search (regex)

search_in

"text" / "note" / "tags" / "all"

"all"

Где искать

max_depth

number

2

Для tree — макс. глубина

max_items

number

20

Лимит элементов

skip

number

0

Пагинация — пропустить N

include_text

bool

true

Включить текст/превью

include_tags

bool

true

Включить метки

include_note

bool

false

Включить заметку

Режимы (mode)

tree — структура вкладок с метаданными

mcp/info [5]
  0: "Инструкция по API..." [api,docs]
  1: "Конфиг сервера..." [config]
mcp/workspace [3]
  └─ mcp/workspace/проект1 [12]

list — элементы конкретной вкладки

mode:list|tab:info|total:47|showing:0-19
0|"Инструкция по API..."|[api,docs]|+note
1|"Конфиг сервера..."|[config]|

item — один элемент полностью

search — поиск по содержимому

Возможные ошибки

Код

Описание

TAB_NOT_FOUND

Вкладка не существует

INDEX_OUT_OF_BOUNDS

Индекс за пределами

INVALID_MODE

Неизвестный mode

Под капотом (CopyQ CLI)

# tree
copyq tab | grep "^mcp/"
copyq tab "mcp/..." count
copyq tab "mcp/..." read 0 | head -c 50

# list
copyq tab "mcp/${tab}" count
copyq tab "mcp/${tab}" read $i
copyq tab "mcp/${tab}" read "application/x-copyq-tags" $i

# item
copyq tab "mcp/${tab}" read ${index}
copyq tab "mcp/${tab}" read "application/x-copyq-tags" ${index}
copyq tab "mcp/${tab}" read "application/x-copyq-item-notes" ${index}

# search
copyq eval "/* JS: grep по tabs */"

2. mcp_write

Универсальная запись данных.

Параметры

Параметр

Тип

Default

Описание

mode

string

—

обязательный (см. ниже)

tab

string

—

Путь вкладки

index

number

—

Для item-операций

text

string

—

Текст (для add/update)

tags

string[]

—

Метки

note

string

—

Заметка

field

"text" / "note" / "tags"

—

Для update — что менять

edit_mode

"replace" / "append" / "prepend" / "substitute"

"replace"

Как менять

match

string

—

Для substitute — что заменить

to_tab

string

—

Для move — куда переместить

path

string

—

Для tab_create/tab_delete

intent

"execute" / "preview"

"execute"

Выполнить или показать эффект

Режимы (mode)

mode

Уровень

Описание

Обязательные параметры

add

item

Добавить элемент в начало

tab, text

update

item

Изменить элемент

tab, index, field, (text/tags/note)

delete

item

Удалить элемент

tab, index

move

item

Переместить в другую вкладку

tab, index, to_tab

tab_create

collection

Создать подвкладку

path (только workspace/*)

tab_delete

collection

Удалить подвкладку

path (только workspace/*)

edit_mode для update

field

edit_mode

Действие

text/note

replace

Полная замена

text/note

append

Дописать в конец

text/note

prepend

Дописать в начало

text/note

substitute

Заменить match → text/note

tags

replace

Заменить все метки

tags

append

Добавить метки (сохранив старые)

tags

remove

Удалить указанные метки

intent: preview

При intent="preview" — не выполняет действие, а возвращает что произойдёт:

action: delete
target: mcp/info[3]
will_remove: "Текст который удалится..." | [метки] | +note

Возможные ошибки

Код

Описание

TAB_NOT_FOUND

Вкладка не существует

INDEX_OUT_OF_BOUNDS

Индекс за пределами

PERMISSION_DENIED

tab_create/tab_delete вне workspace

INVALID_MODE

Неизвестный mode

MISSING_PARAM

Не хватает обязательного параметра

MATCH_NOT_FOUND

substitute: match не найден в тексте

Формат ответа

ok|mode:add|tab:info|index:0|text_len:156|tags:2

Под капотом (CopyQ CLI)

# add
copyq tab "mcp/${tab}" write 0 \
  "text/plain" "${text}" \
  "application/x-copyq-tags" "${tags}" \
  "application/x-copyq-item-notes" "${note}"

# update (substitute)
OLD=$(copyq tab "mcp/${tab}" read ${index})
NEW=$(echo "$OLD" | sed "s/${match}/${value}/g")
TAGS=$(copyq tab "mcp/${tab}" read "application/x-copyq-tags" ${index})
NOTE=$(copyq tab "mcp/${tab}" read "application/x-copyq-item-notes" ${index})
copyq tab "mcp/${tab}" write ${index} \
  "text/plain" "$NEW" \
  "application/x-copyq-tags" "$TAGS" \
  "application/x-copyq-item-notes" "$NOTE"

# delete
copyq tab "mcp/${tab}" remove ${index}

# move
# read all → write to to_tab → remove from tab

# tab_create
copyq tab "mcp/${path}"

# tab_delete
copyq removeTab "mcp/${path}"

3. mcp_validate

Проверить корректность вызова без выполнения.

Параметры

Параметр

Тип

Описание

tool

"read" / "write"

Какой инструмент проверить

params

object

Параметры вызова

Формат ответа

Успех:

valid: true | warnings: [] | estimated_tokens: 340

Ошибка:

valid: false | errors: ["TAB_NOT_FOUND: workspace/xxx"]

Права доступа

Операция

info

заметки

workspace

read (все режимы)

✅

✅

✅

add

✅

✅

✅

update

✅

✅

✅

delete

✅

✅

✅

move

✅

✅

✅

tab_create

❌

❌

✅

tab_delete

❌

❌

✅


Установка

# Требования
# - Python 3.11+
# - CopyQ установлен и запущен
# - Путь к CopyQ: C:\Program Files\CopyQ\copyq.exe

# Установка
cd C:\sts\projects\mcp-copyq
uv venv
uv pip install -e .

# Запуск
uv run mcp-copyq

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

{
  "mcpServers": {
    "copyq": {
      "command": "uv",
      "args": ["--directory", "C:\\sts\\projects\\mcp-copyq", "run", "mcp-copyq"]
    }
  }
}

Примеры использования

Получить структуру

mcp_read(mode="tree", max_depth=2, max_items=5)

Список элементов вкладки

mcp_read(mode="list", tab="info", max_items=10, include_note=true)

Прочитать элемент

mcp_read(mode="item", tab="info", index=0)

Поиск

mcp_read(mode="search", query="API", search_in="all", max_items=10)

Добавить элемент

mcp_write(mode="add", tab="info", text="Новая запись", tags=["important"])

Изменить текст (дописать в конец)

mcp_write(mode="update", tab="info", index=0, field="text", edit_mode="append", text="\n\nДополнение")

Заменить фрагмент

mcp_write(mode="update", tab="info", index=0, field="text", edit_mode="substitute", match="старое", text="новое")

Добавить метку (сохранив существующие)

mcp_write(mode="update", tab="info", index=0, field="tags", edit_mode="append", tags=["urgent"])

Удалить с превью

mcp_write(mode="delete", tab="info", index=0, intent="preview")
mcp_write(mode="delete", tab="info", index=0, intent="execute")

Создать подвкладку

mcp_write(mode="tab_create", path="workspace/новый_проект")

Переместить элемент

mcp_write(mode="move", tab="info", index=0, to_tab="workspace/архив")

Принципы дизайна

  1. Минимум инструментов — 3 вместо 10+

  2. Stateless — каждый вызов независим

  3. Компактные ответы — pipe-separated, без лишних полей

  4. Пагинация — skip/max_items для больших данных

  5. Явные параметры — include_text вместо fields: "minimal"

  6. Preview mode — intent="preview" для опасных операций

  7. Чёткие ошибки — коды + описания


Структура проекта

mcp-copyq/
├── README.md
├── pyproject.toml
├── src/
│   └── mcp_copyq/
│       ├── __init__.py
│       ├── server.py          # MCP server
│       ├── copyq_client.py    # CopyQ CLI wrapper
│       ├── tools/
│       │   ├── __init__.py
│       │   ├── read.py        # mcp_read
│       │   ├── write.py       # mcp_write
│       │   └── validate.py    # mcp_validate
│       ├── models.py          # Pydantic models
│       └── errors.py          # Error codes
└── tests/
    ├── __init__.py
    ├── test_read.py
    ├── test_write.py
    ├── test_validate.py
    └── test_integration.py

Лицензия

MIT

Available Tools

3 tools
mcp_readA

Read from CopyQ clipboard manager.

MCP tabs (full read/write access):

  • mcp/info - general information storage

  • mcp/заметки - notes storage

  • mcp/workspace - projects (supports subtabs like workspace/myproject)

External tabs (READ-ONLY access with scope="all" or scope="external"):

  • All other CopyQ tabs like "&clipboard", personal tabs, etc.

  • Use scope="all" to see all tabs, scope="external" for non-mcp only

Modes:

  • tree: Get tab structure with previews. Use FIRST to see available tabs.

  • list: Get items from tab with pagination

  • item: Get single item with full content (text, tags, note)

  • search: Search by regex across tabs

Parameters:

  • mode (required): "tree" | "list" | "item" | "search"

  • tab: For mcp tabs use relative path "info", "workspace/proj1". For external use full name "&clipboard"

  • scope: "mcp" (default) | "all" | "external" - controls which tabs are accessible

  • index: Item index (for mode=item)

  • query: Search regex (for mode=search)

Examples:

  • tree of mcp tabs: mode="tree"

  • tree of ALL tabs: mode="tree", scope="all"

  • read external tab: mode="list", tab="&clipboard", scope="external"

  • search everywhere: mode="search", query="pattern", scope="all"

Errors: TAB_NOT_FOUND, INDEX_OUT_OF_BOUNDS, INVALID_MODE

Inputs: mode (required), tab, scope, index, +8 more.

mcp_validateA

Validate parameters for mcp_read or mcp_write without executing.

Use to check if a call will succeed before making it.

Parameters:

  • tool (required): "read" | "write"

  • params (required): Parameters object to validate

Returns:

  • valid: true/false

  • errors: List of error codes and messages

  • warnings: List of warnings

  • estimated_tokens: Estimated response token count

Inputs: tool (required), params (required).

mcp_writeA

Write to CopyQ clipboard manager.

IMPORTANT: All data stored under "mcp/" prefix. When you use tab="info", actual CopyQ path is "mcp/info".

Available tabs:

  • info - general storage (use tab="info")

  • заметки - notes (use tab="заметки")

  • workspace - projects, supports subtabs (use tab="workspace" or "workspace/myproject")

Modes:

  • add: Add item to tab. Params: tab, text, tags (optional), note (optional)

  • update: Update item. Params: tab, index, field, text/tags/note

  • delete: Delete item. Params: tab, index

  • move: Move item. Params: tab, index, to_tab

  • tab_create: Create subtab in workspace only. Params: path (e.g. "workspace/newproject")

  • tab_delete: Delete subtab. Params: path

Response shows full_path (e.g. "mcp/info") confirming where data was written.

Errors: TAB_NOT_FOUND, INDEX_OUT_OF_BOUNDS, PERMISSION_DENIED, MISSING_PARAM

Inputs: mode (required), tab, index, text, +8 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools have clearly distinct purposes: mcp_read is for reading data from the clipboard manager, mcp_write is for writing data to it, and mcp_validate is for validating parameters before operations. There is no overlap in functionality, making it easy for an agent to select the correct tool.

    Naming Consistency5/5

    All tool names follow a consistent 'mcp_' prefix with a descriptive verb (read, write, validate), using snake_case uniformly. This predictable pattern enhances readability and reduces confusion.

    Tool Count4/5

    With three tools, the count is appropriate for the server's purpose of clipboard management, covering read, write, and validation operations. It is well-scoped, though a slightly larger set might offer more granularity, but this is reasonable.

    Completeness5/5

    The tool set provides complete CRUD and lifecycle coverage for clipboard data management: mcp_read handles retrieval (including search and listing), mcp_write supports creation, updates, deletion, and movement, and mcp_validate ensures parameter integrity. No obvious gaps exist for the domain.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides clipboard access tools (get and set) for AI assistants via the Model Context Protocol, enabling seamless clipboard operations across platforms.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provide AI agents with read and search access to CopyQ clipboard history, plus tab listing, with optional Windows dictation routing to separate tabs.
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to read and write the system clipboard in native app formats such as Slack, Mural, Figma, and Outlook without API keys. It decodes clipboard content into structured data and generates app-ready clipboard payloads.
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Open-source cross-device clipboard manager with a built-in MCP server. Search and retrieve clipboard history synced across all your devices, read OCR text extracted from copied images, and add new items to the clipboard.
      5
      2,713
      AGPL 3.0