From logseq-expert
Manages connections to Logseq graphs via HTTP API, CLI, or MCP Server. Auto-invokes when users mention connecting to Logseq, API tokens, graph paths, connection issues, or backend configuration. Handles backend detection, environment setup, and connectivity troubleshooting.
How this skill is triggered — by the user, by Claude, or both
Slash command
/logseq-expert:connecting-to-logseqThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill auto-invokes when:
This skill auto-invokes when:
Setup Scripts: See {baseDir}/scripts/ for initialization utilities.
| Backend | Requires Logseq Running | Read | Write | Best For |
|---|---|---|---|---|
| HTTP API | Yes | Full | Full | Real-time, interactive |
| CLI | No | Full | Limited | Offline, batch, CI/CD |
| MCP Server | Yes (via HTTP) | Full | Full | Claude-native tools |
In Logseq:
export LOGSEQ_API_TOKEN="your-token-here"
Run the setup wizard:
python {baseDir}/scripts/init-environment.py
Or use the command: /logseq:init
URL: http://127.0.0.1:12315/api
Request Format:
POST /api
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN
{
"method": "logseq.Editor.getPage",
"args": ["PageName"]
}
Common Methods:
logseq.App.getCurrentGraph - Get current graph infologseq.Editor.getPage - Get page by namelogseq.Editor.getBlock - Get block by UUIDlogseq.DB.datascriptQuery - Execute Datalog querylogseq.Editor.insertBlock - Create new blockInstallation:
npm install -g @logseq/cli
Usage:
# Query local graph
logseq query "[:find ?title :where [?p :block/title ?title]]" --graph ~/logseq/my-graph
# With running Logseq (in-app mode)
logseq query "..." --in-app -a YOUR_TOKEN
The plugin includes a custom MCP server that exposes Logseq operations as Claude tools.
Location: servers/logseq-mcp/
Build:
cd servers/logseq-mcp
npm install
npm run build
Location: .claude/logseq-expert/env.json
{
"backend": "auto",
"http": {
"url": "http://127.0.0.1:12315",
"token": "${LOGSEQ_API_TOKEN}"
},
"cli": {
"graphPath": "/path/to/graph",
"inApp": false
},
"mcp": {
"enabled": true
},
"preferences": {
"defaultGraph": null,
"confirmWrites": false,
"backupBeforeWrite": false
}
}
curl -X POST http://127.0.0.1:12315/api \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"method":"logseq.App.getCurrentGraph"}'
echo $LOGSEQ_API_TOKENnpm install -g @logseq/clinpx @logseq/cli --helpcd servers/logseq-mcp && npm run build| Script | Purpose |
|---|---|
init-environment.py | Interactive setup wizard |
detect-backend.py | Auto-detect available backends |
test-connection.py | Test connectivity |
preflight-checks.sh | Validate environment |
Run scripts from plugin root:
python logseq-expert/scripts/init-environment.py
${VAR} syntax for env varsnpx claudepluginhub c0ntr0lledcha0s/claude-code-plugin-automations --plugin logseq-expertTeaches AI coding agents to work with Obsidian vaults: Markdown, Bases, JSON Canvas, and the Obsidian CLI.
Manages Maenifold knowledge graphs via CLI: write/read/search/edit memories, build context, run workflows, visualize graphs, track assumptions.
Enforces schema-as-code for Obsidian vaults: discovers structure, runs schema compliance, deduplicates entities, generates MOC indexes, fixes wikilinks, and more.