I’ve been working on integrating LogSeq with Claude. I’ve made a plugin that will turn a set of child blocks/queries/block references into a conversation with Anthropic’s API, and I’ve developed a Model Context Protocol (MCP) server that let’s Claude Desktop interact with LogSeq through its http server based on joelhooks/logseq-mcp-tools: mcp server for logseq graph’s server.
Both of these options still require additional coding for further integrations. I started wondering if there was a way to convert LogSeq into an MCP client. This would allow it to integrate with any MCP server that comes out making it much easier to integrate with other apps and have all your conversations stored (and editable) within LogSeq.
This isn’t possible to do as a plugin because plugin code is sandboxed for security reasons - meaning they can’t access exterior files or servers on the local machine - though this could potentially be possible with remote servers.
I tried looking into placing all the code required into the custom.js
file. This became unruly, and I already have a significant amount of code in it for Edit and run javascript code inside Logseq itself - Customization / Look what I built - Logseq.
I imagine there has to be a way to utilize the kits/modules running JS within LogSeq pages allows to set up MCP client capabilities, but I’m having a hard time wrapping my mind around it - I’m not a software developer.
I’d like to utilize Anthropic’s MCP SDK as well as several other dependencies to make the code simpler to work with. Is it possible to import/compile other libraries utilizing LogSeq’s native api? I don’t imagine this would be able to perform any compile/build functions.