Skip to main content
Glama

zk-mcp

zk-mcp is an MCP (Model Context Protocol) server for integrating notes managed by zk with LLMs. It enables LLMs to efficiently access and interact with knowledge bases managed under zk.

Features

  • Note Query: Search notes by content, tags, and complex filters

  • Link Analysis: Discover relationships between notes (links to, linked by, related)

  • Tag Management: List and filter by available tags

  • Note Access: Read complete note contents

  • Note Creation: Create new notes programmatically

Related MCP server: brainforge-mcp

Prerequisites

Installation

  1. Clone this repository:

git clone https://github.com/koei-kaji/zk-mcp.git
cd zk-mcp
  1. Install dependencies:

uv sync

Configuration

Add the following settings to your MCP client's servers.json:

{
  "mcpServers": {
    "zk": {
      "alwaysAllow": [
        "get_note",
        "get_note_paths",
        "get_linking_notes",
        "get_tags",
        "create_note"
      ],
      "args": [
        "--directory",
        "/path/to/zk-mcp/",
        "run",
        "server.py"
      ],
      "command": "uv",
      "env": {
        "ZK_DIR": "/path/to/your/zk-note-directory/"
      }
    }
  }
}

Important: Replace /path/to/zk-mcp/ with the actual path to this repository and /path/to/your/zk-note-directory/ with the path to your zk notes directory.

Available MCP Tools

This server provides the following MCP tools:

get_note_paths

Search for notes based on various criteria:

  • include_str: Filter notes containing specific strings in content or filename

  • include_str_operand: Logical operator (AND/OR) for multiple string filters

  • exclude_str: Exclude notes containing specific strings

  • include_tags: Filter notes by tags

  • include_tags_operand: Logical operator (AND/OR) for multiple tag filters

  • exclude_tags: Exclude notes with specific tags

get_linking_notes

Discover note relationships:

  • link_to_notes: Notes that the specified note links to

  • linked_by_notes: Notes that link to the specified note

  • related_notes: Notes that are related to the specified note

get_tags

List all available tags in the note repository.

get_note

Read the complete content of a specific note by path.

create_note

Create a new note with the specified title in an optional directory.

Development

Commands

  • make run - Run the MCP server in development mode with ZK_DIR=.

  • make format - Format code using ruff (imports + formatting)

  • make lint - Run linting with ruff and type checking with mypy

  • make test - Run all tests with pytest

  • make pre-commit - Run both format and lint (recommended before commits)

Package Management

  • uv add <package> - Add runtime dependency

  • uv add --dev <package> - Add development dependency

  • uv run <command> - Run command in virtual environment

Architecture

The server is built using:

  • FastMCP: MCP server implementation

  • Pydantic: Data validation and serialization

  • zk CLI: Backend integration with zk note system

All tools return JSON responses using Pydantic models for type safety and validation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

5 tools
create_noteA

Create a new note with the specified title.

Args: title (str): Title of the note to create directory (str): Directory to create the note in (optional)

Returns: str: JSON string containing path information for the created note

Inputs: title (required), directory.

get_linking_notesA

Get all linking information related to the specified note.

This tool searches for notes with the following three types of link relationships to a specific note path:

  • Notes that the specified note links to (link_to)

  • Notes that link to the specified note (linked_by)

  • Notes that are related to the specified note (related)

Args: path (str): Path to the note file to get linking information for

Returns: str: JSON string containing linking information. Includes note lists for three different link types (link_to_notes, linked_by_notes, related_notes).

Inputs: path (required).

get_noteA

Read and return the contents of the note at the specified path.

Args: path (str): Path to the note file to read

Returns: str: The note content

Inputs: path (required).

get_note_pathsA

Get a list of note paths that match the filter criteria using zk CLI.

Args: include_str (list[str]): Filter notes by strings contained in content or filename include_str_operand (Literal['AND', 'OR']): Logical operator applied to multiple include_str filters ('AND' or 'OR') exclude_str (list[str]): Exclude notes containing these strings in content or filename include_tags (list[str]): Filter to notes with specified tags include_tags_operand (Literal['AND', 'OR']): Logical operator applied to multiple include_tags ('AND' or 'OR') exclude_tags (list[str]): Exclude notes with specified tags

Returns: str: JSON string containing a list of note file paths and title information matching the filter criteria.

Inputs: include_str, include_str_operand, exclude_str, include_tags, +2 more.

get_tagsD

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 5 tools

    Disambiguation4/5

    Most tools have distinct purposes (create, read, search, link retrieval), but the empty description for get_tags introduces ambiguity about its exact function, slightly reducing clarity.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case (e.g., create_note, get_note_paths). The naming is predictable and uniform across the set.

    Tool Count4/5

    Five tools is a reasonable number for a focused knowledge management server, covering creation, retrieval, search, and linking. It avoids being too sparse or bloated.

    Completeness3/5

    Core operations like create and read are covered, but update and delete are missing, limiting full workflow support. The get_tags tool's missing description further undermines completeness.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server for managing Obsidian-style note vaults, providing tools for full-text search, note creation, and backlink tracking. It enables users to navigate, structure, and update their personal knowledge base through natural language.
      9
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that transforms markdown notes into an AI-powered knowledge graph. It enables LLM clients to explore, analyze, and diagnose knowledge graphs through tools for node explanation, path finding, causal chain analysis, and wiki health reporting.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides Claude and other MCP clients with persistent memory through a Zettelkasten knowledge base of interconnected markdown notes. It enables LLMs to create, search, link, and reference atomic notes across sessions without requiring manual copy-pasting.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for zk note management enabling note search, creation, and link analysis via the zk command-line tool.
      2
      MIT