mdbase banner
callumalpass callumalpass

mdbase

Documentation community intermediate

Description

Language Server Protocol (LSP) server for the mdbase specification. It uses `mdbase-rs` for all spec logic (types, matching, validation, links).

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

mdbase-lsp

Language Server Protocol (LSP) server for the mdbase specification. It uses `mdbase-rs` for all spec logic (types, matching, validation, links).

Features

  • Diagnostics: frontmatter parse errors, validation issues, unknown fields
  • Completions: field names, enum values, booleans, link targets, tags
  • Hover: field/type info and link target preview
  • Go to definition: link targets and type definitions in _types/
  • Commands: mdbase.createFile, mdbase.validateCollection

Requirements

  • Rust toolchain (stable)
  • A valid mdbase collection (folder with mdbase.yaml)

Build

cargo build

Run (stdio)

cargo run

Your editor should launch the server via stdio. Use the resulting binary in your editor's LSP config.

Commands

`mdbase.createFile`

Creates a new file using mdbase create semantics.

Example arguments:

{
  "type": "note",
  "frontmatter": { "title": "Example" },
  "body": "Hello",
  "path": "notes/example.md"
}

`mdbase.validateCollection`

Validates the entire collection and returns the JSON report from `mdbase-rs`.

Editor Setup

VS Code

Install the extension from `editors/vscode/`. It registers the `mdbase.createFile` and `mdbase.validateCollection` commands automatically.

Neovim (0.11+)

lazy.nvim (auto-download latest release)

local function mdbase_lsp_paths()
  local data = vim.fn.stdpath("data")
  local dir = data .. "/mdbase-lsp"
  local bin = dir .. "/mdbase-lsp"
  if vim.fn.has("win32") == 1 then
    bin = bin .. ".exe"
  end
  return dir, bin
end

local function detect_target()
  if vim.fn.has("win32") == 1 then
    return "win32-x64"
  end
  if vim.fn.has("mac") == 1 then
    local arch = vim.fn.system({ "uname", "-m" }):gsub("%s+", "")
    if arch == "arm64" or arch == "aarch64" then
      return "darwin-arm64"
    end
    return "darwin-x64"
  end
  return "linux-x64"
end

local function latest_release_asset()
  local json = vim.fn.system({

...