Skip to main content
Glama
rncz

Nextcloud Notes MCP Server

by rncz

read_note

Retrieve content from Markdown notes stored in Nextcloud Notes by specifying filename and optional category, enabling access to stored information for processing.

Instructions

Read a Markdown (.md) file.

Args:
    filename: Name of the note file, e.g., "note1.md"
    category: Optional category folder. If None, read from /Notes root.

Returns:
    Content of the note as a string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
categoryNo

Implementation Reference

  • The handler function for the 'read_note' tool. It constructs the full path to the note file in Nextcloud, downloads it to a temporary local file using WebDAV client, reads the content, cleans up the temp file, and returns the note's content as a string.
    @mcp.tool()
    def read_note(filename: str, category: str | None = None) -> str:
        """
        Read a Markdown (.md) file.
    
        Args:
            filename: Name of the note file, e.g., "note1.md"
            category: Optional category folder. If None, read from /Notes root.
    
        Returns:
            Content of the note as a string.
        """
        full_path = f"/Notes/{category}/{filename}" if category else f"/Notes/{filename}"
        tmp_path = os.path.join(tempfile.gettempdir(), next(tempfile._get_candidate_names()) + ".tmp")
    
        client.download_sync(remote_path=full_path, local_path=tmp_path)
        with open(tmp_path, "r", encoding="utf-8") as f:
            content = f.read()
        os.remove(tmp_path)
        return content

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rncz/nextcloud-notes-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server