Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.
This repository was archived by the owner on May 13, 2026. It is now read-only.

patch_vault_file fails with non-ASCII heading names (Cyrillic, CJK, etc.) #78

Description

@sergeyklochko

Description

patch_vault_file returns an error when the target heading contains non-ASCII characters (Cyrillic, Chinese, Japanese, Arabic, etc.).

Error

MCP error -32603: Header 'Target' has invalid value: 'Детали'

Steps to reproduce

  1. Create a note with a Cyrillic (or any non-ASCII) heading, e.g. ## Детали
  2. Call patch_vault_file with target: "Детали", targetType: "heading"
  3. The tool returns the error above immediately — the request never reaches the REST API

Root cause

The mcp-server binary sets the heading name directly as an HTTP header value:

Target: Детали

Go's net/http package rejects non-ASCII bytes in header values at the client side, so the request is never sent.

Notably, obsidian-local-rest-api already calls decodeURIComponent() on the Target header value on the server side — so it is ready to accept a percent-encoded value.

Fix

One line in the Go HTTP client, before setting the header:

req.Header.Set("Target", url.QueryEscape(target))

This makes encoding consistent with what the server already expects.

Impact

Any vault with non-English headings cannot use patch_vault_file at all. The only current workaround is to rename all headings intended for AI editing to ASCII — which is impractical for non-English users.

Environment

  • MCP Tools: v0.2.27
  • obsidian-local-rest-api: v3.6.1
  • Obsidian: v1.12.7
  • OS: macOS (arm64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions