obsidian-mcp-server 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +36 -77
  3. package/package.json +12 -14
package/LICENSE CHANGED
@@ -1,7 +1,8 @@
1
1
 
2
2
  Apache License
3
3
  Version 2.0, January 2004
4
- http://www.apache.org/licenses/
4
+ Copyright 2025 Casey Hand @cyanheads
5
+ http://www.apache.org/licenses/
5
6
 
6
7
  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
8
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Obsidian MCP Server
2
2
 
3
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)
4
- [![Model Context Protocol](https://img.shields.io/badge/MCP-1.4.0-green.svg)](https://modelcontextprotocol.io/)
5
- [![Version](https://img.shields.io/badge/Version-1.2.3-blue.svg)]()
3
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://www.typescriptlang.org/)
4
+ [![Model Context Protocol](https://img.shields.io/badge/MCP-1.6.1-green.svg)](https://modelcontextprotocol.io/)
5
+ [![Version](https://img.shields.io/badge/Version-1.4.1-blue.svg)]()
6
6
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
7
  [![Status](https://img.shields.io/badge/Status-Stable-blue.svg)]()
8
8
  [![GitHub](https://img.shields.io/github/stars/cyanheads/obsidian-mcp-server?style=social)](https://github.com/cyanheads/obsidian-mcp-server)
@@ -18,6 +18,7 @@ Requires the Local REST API plugin in Obsidian.
18
18
  ### File Operations
19
19
  - Atomic file/directory operations with validation
20
20
  - Resource monitoring and cleanup
21
+ - Error handling and graceful failure
21
22
 
22
23
  ### Search System
23
24
  - Full-text search with configurable context
@@ -32,12 +33,14 @@ Requires the Local REST API plugin in Obsidian.
32
33
  ### Security & Performance
33
34
  - API key auth with rate limiting and SSL options
34
35
  - Resource monitoring and health checks
36
+ - Graceful shutdown handling
35
37
 
36
38
  ## Installation
37
39
 
38
- 1. Install Node.js (LTS recommended)
39
- 2. Enable Local REST API plugin in Obsidian
40
- 3. Clone and build:
40
+ Note: Requires Node.js
41
+
42
+ 1. Enable Local REST API plugin in Obsidian
43
+ 2. Clone and build:
41
44
  ```bash
42
45
  git clone git@github.com:cyanheads/obsidian-mcp-server.git
43
46
  cd obsidian-mcp-server
@@ -84,7 +87,7 @@ Required:
84
87
  - `OBSIDIAN_API_KEY`: Your API key from Obsidian's Local REST API plugin settings
85
88
 
86
89
  Connection Settings:
87
- - `VERIFY_SSL`: Enable SSL certificate verification (default: false in development)
90
+ - `VERIFY_SSL`: Enable SSL certificate verification (default: false) # This must be set to false for self-signed certificates. If you are running locally or don't understand what this means, this should be set to false.
88
91
  - `OBSIDIAN_PROTOCOL`: Protocol to use (default: "https")
89
92
  - `OBSIDIAN_HOST`: Host address (default: "127.0.0.1")
90
93
  - `OBSIDIAN_PORT`: Port number (default: 27124)
@@ -101,46 +104,22 @@ Rate Limiting:
101
104
  Tool Execution:
102
105
  - `TOOL_TIMEOUT_MS`: Tool execution timeout in milliseconds (default: 60000 [1 minute])
103
106
 
104
- SSL Certificate Setup:
105
-
106
- For Windows Users:
107
- 1. Development Setup (Not Recommended for Production):
108
- - Set `VERIFY_SSL` to "false"
109
- - Set `OBSIDIAN_PROTOCOL` to "http"
110
- - Enable "Non-encrypted (HTTP) Server" in Obsidian's Local REST API settings
111
-
112
- 2. Production Setup (Recommended):
113
- - Set `VERIFY_SSL` to "true"
114
- - Get the certificate from Obsidian Settings > Local REST API > 'How to Access'
115
- - Open Windows Certificate Manager (certmgr.msc)
116
- - Navigate to "Trusted Root Certification Authorities" > "Certificates"
117
- - Right-click > "All Tasks" > "Import" and select the certificate file
107
+ ## Project Structure
118
108
 
119
- For Other Systems:
120
- - macOS: Add certificate to Keychain Access
121
- - Linux: Add to ca-certificates
109
+ The project follows a modular architecture with clear separation of concerns:
122
110
 
123
- Additional configuration options:
124
- ```typescript
125
- interface ObsidianConfig {
126
- apiKey: string; // Required: API key for authentication
127
- verifySSL?: boolean; // Optional: Enable SSL verification
128
- timeout?: number; // Optional: Request timeout in ms
129
- maxContentLength?: number;// Optional: Max response content length
130
- maxBodyLength?: number; // Optional: Max request body length
131
- }
132
-
133
- interface RateLimitConfig {
134
- windowMs: number; // Time window for rate limiting
135
- maxRequests: number; // Max requests per window
136
- }
137
111
  ```
138
-
139
- Error Handling:
140
- - All errors include a 5-digit error code
141
- - HTTP status codes are automatically converted (e.g., 404 -> 40400)
142
- - Default server error code: 50000
143
- - Detailed error messages include original error stack traces in development
112
+ src/
113
+ ├── index.ts # Main entry point
114
+ ├── mcp/ # MCP server implementation
115
+ ├── obsidian/ # Obsidian API client and types
116
+ ├── resources/ # MCP resource implementations
117
+ ├── tools/ # MCP tool implementations
118
+ │ ├── files/ # File operations tools
119
+ │ ├── search/ # Search tools
120
+ │ └── properties/ # Property management tools
121
+ └── utils/ # Shared utilities
122
+ ```
144
123
 
145
124
  ## Tools
146
125
 
@@ -184,6 +163,11 @@ obsidian_complex_search: {
184
163
  // {"in": ["#mytag", {"var": "frontmatter.tags"}]}
185
164
  // ]}
186
165
  }
166
+
167
+ // Get all tags in vault or directory
168
+ obsidian_get_tags: {
169
+ path?: string // Optional: limit to specific directory
170
+ }
187
171
  ```
188
172
 
189
173
  ### Content Modification
@@ -201,41 +185,8 @@ obsidian_patch_content: {
201
185
  }
202
186
  ```
203
187
 
204
- ### Command Management
205
- ```typescript
206
- // List available commands
207
- obsidian_list_commands: {}
208
-
209
- // Execute a command
210
- obsidian_execute_command: {
211
- commandId: string // Command ID to execute
212
- }
213
- ```
214
-
215
- ### File Navigation
216
- ```typescript
217
- // Open a file in Obsidian
218
- obsidian_open_file: {
219
- filepath: string, // Path relative to vault root
220
- newLeaf?: boolean // Open in new leaf (default: false)
221
- }
222
-
223
- // Get active file content
224
- obsidian_get_active_file: {}
225
-
226
- // Get periodic note content
227
- obsidian_get_periodic_note: {
228
- period: "daily" | "weekly" | "monthly" | "quarterly" | "yearly"
229
- }
230
- ```
231
-
232
188
  ### Property Management
233
189
  ```typescript
234
- // Get all tags in vault or directory
235
- obsidian_get_tags: {
236
- path?: string // Optional: limit to specific directory
237
- }
238
-
239
190
  // Get note properties
240
191
  obsidian_get_properties: {
241
192
  filepath: string // Path relative to vault root
@@ -286,6 +237,14 @@ obsidian_update_properties: {
286
237
  - Validate inputs and handle errors gracefully
287
238
  - Monitor patterns and respect rate limits
288
239
 
240
+ ## Resources
241
+
242
+ The MCP server exposes the following resources:
243
+
244
+ ```
245
+ obsidian://tags # List of all tags used across the vault
246
+ ```
247
+
289
248
  ## Contributing
290
249
 
291
250
  1. Fork the repository
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "obsidian-mcp-server",
3
- "version": "1.4.0",
4
- "description": "Model Context Protocol server for Obsidian integration with token-aware response handling",
3
+ "version": "1.4.1",
4
+ "description": "Model Context Protocol (MCP) server designed for LLMs to interact with Obsidian vaults. Provides secure, token-aware tools for seamless knowledge base management through a standardized interface.",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
7
7
  "engines": {
@@ -19,21 +19,19 @@
19
19
  "format": "prettier --write \"src/**/*.ts\""
20
20
  },
21
21
  "dependencies": {
22
- "@modelcontextprotocol/sdk": "^1.4.1",
23
- "axios": "^1.7.9",
22
+ "@modelcontextprotocol/sdk": "^1.6.1",
23
+ "axios": "^1.8.1",
24
24
  "dotenv": "^16.4.7",
25
- "tiktoken": "^1.0.18",
25
+ "tiktoken": "^1.0.20",
26
26
  "yaml": "^2.7.0",
27
- "zod": "^3.24.1"
28
- },
29
- "devDependencies": {
30
- "@types/node": "^22.10.10",
31
- "@typescript-eslint/eslint-plugin": "^8.21.0",
32
- "@typescript-eslint/parser": "^8.21.0",
33
- "eslint": "^9.19.0",
34
- "eslint-config-prettier": "^10.0.1",
27
+ "zod": "^3.24.2",
28
+ "@types/node": "^22.13.8",
29
+ "@typescript-eslint/eslint-plugin": "^8.25.0",
30
+ "@typescript-eslint/parser": "^8.25.0",
31
+ "eslint": "^9.21.0",
32
+ "eslint-config-prettier": "^10.0.2",
35
33
  "eslint-plugin-prettier": "^5.2.3",
36
- "prettier": "^3.4.2",
34
+ "prettier": "^3.5.3",
37
35
  "typescript": "^5.7.3"
38
36
  },
39
37
  "keywords": [