kcd icon indicating copy to clipboard operation
kcd copied to clipboard

MCP server for agents: offer to port kdeconnect-mcp to Go and integrate it in-tree

Open DaBlitzStein opened this issue 2 months ago • 4 comments

Hi! I've been building on kcd (great work — docs/IPC_PROTOCOL.md was enough to implement a full client) and wanted to share it, plus propose an integration.

What I built: kdeconnect-mcp — an MCP (Model Context Protocol) server that exposes kcd to LLM agents:

  • Unified timeline of SMS, calls and notifications, with an incremental cursor (get_events / wait_for_events) and text search.
  • Pairing tools (scan / request / accept / reject) and SMS tools (conversations, call log).
  • A redaction layer that strips OTPs, card numbers, IBANs and phone numbers at ingest, before anything is persisted: SQLite only ever contains redacted text plus an HMAC for dedup.
  • Runs fully headless: kcd + a systemd user unit for the listener, no Qt/KDE stack.

It's Python today because MCP tooling iterates fastest there, but the design is not Python-specific: it consumes the documented IPC (watch NDJSON plus devices, pair, unpair, notify_reply, notify_dismiss, send_sms, sms_request_conversations).

Field notes that might be useful for kcd:

  1. SMS are not pushed: every client has to call sms_request_conversations periodically (I poll every 60s and dedup the re-sends). A proactive push (or an sms.incoming event on new messages) would remove a polling loop from every client.
  2. On headless hosts there is no notification daemon, so the SMS plugin's notify-send calls fail with ServiceUnknown for every message (log noise). A config knob to disable desktop notifications would help headless deployments.
  3. Pairing over IPC (including accepting incoming requests) works well.

The offer: if you're interested, I'm happy to port this to Go and contribute it in-tree as a first-class feature — e.g. kcd mcp over stdio, or an internal/mcp module — keeping the redaction layer and the agent tools. Alternatively it can stay an external companion project (current state); no pressure either way.

Would you be open to a PoC PR in that direction? Any preference on transport (stdio vs HTTP), redaction defaults, or in-tree vs out-of-tree?

DaBlitzStein avatar Sep 26 '26 11:09 DaBlitzStein

An internal mcp tool does open a wide range of functionality

I would absolutely prefer a stateless mcp server (stdio), keep it a first class feature with its own command (kcd mcp).

you have the go ahead to implement it and make the pr. I'll be glad to review and merge it

bethropolis avatar Sep 26 '26 14:09 bethropolis

I'll be looking to improve the sms experience. I am aiming for fully event driven implementation.

bethropolis avatar Sep 26 '26 14:09 bethropolis

hey, is it ok if i move this to a later release and link to your mcp tool from the readme.

also I'd like to implement this if you don't mind

bethropolis avatar Sep 30 '26 23:09 bethropolis

closing this for now, will re-open it in future

bethropolis avatar Oct 01 '26 20:10 bethropolis