Skip to main content
Glama

Obsidian MCP Server

Apache 2.0
338
222
  • Apple
  • Linux
openMethods.ts991 B
/** * @module OpenMethods * @description * Methods for opening files in Obsidian via the REST API. */ import { RequestContext } from "../../../utils/index.js"; import { RequestFunction } from "../types.js"; /** * Opens a specific file in Obsidian. Creates the file if it doesn't exist. * @param _request - The internal request function from the service instance. * @param filePath - Vault-relative path to the file. * @param newLeaf - Whether to open the file in a new editor tab (leaf). * @param context - Request context. * @returns {Promise<void>} Resolves on success (200 OK, but no body expected). */ export async function openFile( _request: RequestFunction, filePath: string, newLeaf: boolean = false, context: RequestContext, ): Promise<void> { // This endpoint returns 200 OK, not 204 await _request<void>( { method: "POST", url: `/open/${encodeURIComponent(filePath)}`, params: { newLeaf }, }, context, "openFile", ); }

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/cyanheads/obsidian-mcp-server'

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