@aniketbiswas/obsidian-mcp-server 1.0.0

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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +232 -0
  3. package/build/index.d.ts +26 -0
  4. package/build/index.d.ts.map +1 -0
  5. package/build/index.js +148 -0
  6. package/build/index.js.map +1 -0
  7. package/build/prompts/index.d.ts +33 -0
  8. package/build/prompts/index.d.ts.map +1 -0
  9. package/build/prompts/index.js +152 -0
  10. package/build/prompts/index.js.map +1 -0
  11. package/build/prompts/obsidian.d.ts +17 -0
  12. package/build/prompts/obsidian.d.ts.map +1 -0
  13. package/build/prompts/obsidian.js +305 -0
  14. package/build/prompts/obsidian.js.map +1 -0
  15. package/build/resources/index.d.ts +31 -0
  16. package/build/resources/index.d.ts.map +1 -0
  17. package/build/resources/index.js +111 -0
  18. package/build/resources/index.js.map +1 -0
  19. package/build/resources/obsidian.d.ts +19 -0
  20. package/build/resources/obsidian.d.ts.map +1 -0
  21. package/build/resources/obsidian.js +246 -0
  22. package/build/resources/obsidian.js.map +1 -0
  23. package/build/tools/_template.d.ts +23 -0
  24. package/build/tools/_template.d.ts.map +1 -0
  25. package/build/tools/_template.js +124 -0
  26. package/build/tools/_template.js.map +1 -0
  27. package/build/tools/calculator.d.ts +32 -0
  28. package/build/tools/calculator.d.ts.map +1 -0
  29. package/build/tools/calculator.js +130 -0
  30. package/build/tools/calculator.js.map +1 -0
  31. package/build/tools/daily-notes.d.ts +19 -0
  32. package/build/tools/daily-notes.d.ts.map +1 -0
  33. package/build/tools/daily-notes.js +469 -0
  34. package/build/tools/daily-notes.js.map +1 -0
  35. package/build/tools/greeting.d.ts +23 -0
  36. package/build/tools/greeting.d.ts.map +1 -0
  37. package/build/tools/greeting.js +111 -0
  38. package/build/tools/greeting.js.map +1 -0
  39. package/build/tools/index.d.ts +28 -0
  40. package/build/tools/index.d.ts.map +1 -0
  41. package/build/tools/index.js +46 -0
  42. package/build/tools/index.js.map +1 -0
  43. package/build/tools/links.d.ts +19 -0
  44. package/build/tools/links.d.ts.map +1 -0
  45. package/build/tools/links.js +467 -0
  46. package/build/tools/links.js.map +1 -0
  47. package/build/tools/metadata.d.ts +18 -0
  48. package/build/tools/metadata.d.ts.map +1 -0
  49. package/build/tools/metadata.js +447 -0
  50. package/build/tools/metadata.js.map +1 -0
  51. package/build/tools/navigation.d.ts +19 -0
  52. package/build/tools/navigation.d.ts.map +1 -0
  53. package/build/tools/navigation.js +378 -0
  54. package/build/tools/navigation.js.map +1 -0
  55. package/build/tools/notes.d.ts +19 -0
  56. package/build/tools/notes.d.ts.map +1 -0
  57. package/build/tools/notes.js +622 -0
  58. package/build/tools/notes.js.map +1 -0
  59. package/build/tools/search.d.ts +19 -0
  60. package/build/tools/search.d.ts.map +1 -0
  61. package/build/tools/search.js +418 -0
  62. package/build/tools/search.js.map +1 -0
  63. package/build/tools/templates.d.ts +18 -0
  64. package/build/tools/templates.d.ts.map +1 -0
  65. package/build/tools/templates.js +581 -0
  66. package/build/tools/templates.js.map +1 -0
  67. package/build/tools/vault.d.ts +19 -0
  68. package/build/tools/vault.d.ts.map +1 -0
  69. package/build/tools/vault.js +403 -0
  70. package/build/tools/vault.js.map +1 -0
  71. package/build/types/index.d.ts +11 -0
  72. package/build/types/index.d.ts.map +1 -0
  73. package/build/types/index.js +11 -0
  74. package/build/types/index.js.map +1 -0
  75. package/build/types/obsidian.d.ts +329 -0
  76. package/build/types/obsidian.d.ts.map +1 -0
  77. package/build/types/obsidian.js +38 -0
  78. package/build/types/obsidian.js.map +1 -0
  79. package/build/utils/client.d.ts +201 -0
  80. package/build/utils/client.d.ts.map +1 -0
  81. package/build/utils/client.js +656 -0
  82. package/build/utils/client.js.map +1 -0
  83. package/build/utils/config.d.ts +43 -0
  84. package/build/utils/config.d.ts.map +1 -0
  85. package/build/utils/config.js +117 -0
  86. package/build/utils/config.js.map +1 -0
  87. package/build/utils/frontmatter.d.ts +90 -0
  88. package/build/utils/frontmatter.d.ts.map +1 -0
  89. package/build/utils/frontmatter.js +306 -0
  90. package/build/utils/frontmatter.js.map +1 -0
  91. package/build/utils/index.d.ts +13 -0
  92. package/build/utils/index.d.ts.map +1 -0
  93. package/build/utils/index.js +13 -0
  94. package/build/utils/index.js.map +1 -0
  95. package/build/utils/markdown.d.ts +134 -0
  96. package/build/utils/markdown.d.ts.map +1 -0
  97. package/build/utils/markdown.js +330 -0
  98. package/build/utils/markdown.js.map +1 -0
  99. package/package.json +60 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aniket Biswas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,232 @@
1
+ # 🗃️ Obsidian MCP Server
2
+
3
+ [![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
4
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
5
+ [![MCP](https://img.shields.io/badge/MCP-1.0.0-blue)](https://modelcontextprotocol.io)
6
+
7
+ Connect AI assistants like **Claude** to your [Obsidian](https://obsidian.md) vault via [Model Context Protocol](https://modelcontextprotocol.io). **40+ tools** for searching, creating, and managing your notes—all 100% local.
8
+
9
+ ---
10
+
11
+ ## What Can You Do?
12
+
13
+ | You Say | What Happens |
14
+ |---------|--------------|
15
+ | "Search my notes for machine learning" | Searches your entire vault |
16
+ | "Create a meeting note for tomorrow" | Creates a formatted meeting note |
17
+ | "What links to my Projects note?" | Shows all backlinks |
18
+ | "Add to my daily note: finished the API" | Appends to today's daily note |
19
+ | "Find orphan notes" | Lists unconnected notes |
20
+
21
+ ---
22
+
23
+ ## Quick Start
24
+
25
+ ### 1. Install the Obsidian Plugin
26
+
27
+ 1. **Obsidian** → **Settings** → **Community plugins** → **Browse**
28
+ 2. Search "**Local REST API**" → **Install** → **Enable**
29
+ 3. **Settings** → **Local REST API** → Copy your **API Key**
30
+
31
+ ### 2. Install the MCP Server
32
+
33
+ **Option A: Install from npm (recommended)**
34
+
35
+ ```bash
36
+ npm install -g @aniketbiswas/obsidian-mcp-server
37
+ ```
38
+
39
+ **Option B: Install from source**
40
+
41
+ ```bash
42
+ git clone https://github.com/aniketbiswas/obsidian-mcp-server.git
43
+ cd obsidian-mcp-server
44
+ npm install && npm run build
45
+ npm link # Makes it available globally
46
+ ```
47
+
48
+ ### 3. Configure Claude Desktop
49
+
50
+ Edit the config file:
51
+
52
+ | OS | Config Path |
53
+ |----|-------------|
54
+ | **macOS** | `~/Library/Application Support/Claude/claude_desktop_config.json` |
55
+ | **Windows** | `%APPDATA%\Claude\claude_desktop_config.json` |
56
+ | **Linux** | `~/.config/claude/claude_desktop_config.json` |
57
+
58
+ **If installed via npm:**
59
+
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "obsidian": {
64
+ "command": "obsidian-mcp-server",
65
+ "env": {
66
+ "OBSIDIAN_API_KEY": "your-api-key-here"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ **If installed from source:**
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "obsidian": {
79
+ "command": "node",
80
+ "args": ["/FULL/PATH/TO/obsidian-mcp-server/build/index.js"],
81
+ "env": {
82
+ "OBSIDIAN_API_KEY": "your-api-key-here"
83
+ }
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ > **Windows paths:** Use `C:\\Users\\Name\\...` or `C:/Users/Name/...`
90
+
91
+ ### 4. Restart Claude Desktop
92
+
93
+ Make sure Obsidian is running, then try: *"Show me my vault status"*
94
+
95
+ ---
96
+
97
+ ## Available Tools
98
+
99
+ <details>
100
+ <summary><strong>📁 Vault (6)</strong> — Status, list files, structure</summary>
101
+
102
+ `vault_status` · `list_files` · `list_all_files` · `get_vault_structure` · `get_file_stats` · `delete_file`
103
+ </details>
104
+
105
+ <details>
106
+ <summary><strong>📝 Notes (9)</strong> — CRUD operations</summary>
107
+
108
+ `read_note` · `create_note` · `update_note` · `append_to_note` · `prepend_to_note` · `insert_under_heading` · `replace_in_note` · `delete_note` · `copy_note`
109
+ </details>
110
+
111
+ <details>
112
+ <summary><strong>🔍 Search (7)</strong> — Full-text, tags, folders</summary>
113
+
114
+ `search_notes` · `simple_search` · `search_by_tag` · `search_in_folder` · `find_notes_by_name` · `get_recent_notes` · `search_with_context`
115
+ </details>
116
+
117
+ <details>
118
+ <summary><strong>📊 Metadata (8)</strong> — Frontmatter & tags</summary>
119
+
120
+ `get_frontmatter` · `update_frontmatter` · `set_frontmatter_property` · `get_tags` · `add_tags` · `remove_tags` · `add_aliases` · `get_all_tags_in_vault`
121
+ </details>
122
+
123
+ <details>
124
+ <summary><strong>🧭 Navigation (6)</strong> — Open notes, run commands</summary>
125
+
126
+ `open_note` · `get_active_note` · `append_to_active_note` · `get_commands` · `execute_command` · `quick_capture`
127
+ </details>
128
+
129
+ <details>
130
+ <summary><strong>📅 Daily Notes (6)</strong> — Journals & standups</summary>
131
+
132
+ `get_daily_note` · `append_to_daily_note` · `get_periodic_note` · `append_to_periodic_note` · `daily_journal_entry` · `daily_standup`
133
+ </details>
134
+
135
+ <details>
136
+ <summary><strong>🔗 Links (6)</strong> — Backlinks, orphans, graph</summary>
137
+
138
+ `get_outgoing_links` · `get_backlinks` · `find_broken_links` · `find_orphan_notes` · `add_link_to_note` · `get_link_graph_data`
139
+ </details>
140
+
141
+ <details>
142
+ <summary><strong>📋 Templates (4)</strong> — Meeting, project, etc.</summary>
143
+
144
+ `create_note_from_template` · `create_meeting_note` · `create_project_note` · `list_templates`
145
+
146
+ Built-in: `meeting` · `project` · `book` · `article` · `person` · `recipe` · `decision`
147
+ </details>
148
+
149
+ ---
150
+
151
+ ## Configuration
152
+
153
+ | Variable | Required | Default | Description |
154
+ |----------|:--------:|---------|-------------|
155
+ | `OBSIDIAN_API_KEY` | ✅ | — | From Local REST API plugin |
156
+ | `OBSIDIAN_HOST` | | `127.0.0.1` | API host |
157
+ | `OBSIDIAN_PORT` | | `27124` | API port |
158
+ | `OBSIDIAN_SECURE` | | `true` | Use HTTPS |
159
+ | `OBSIDIAN_VERIFY_SSL` | | `false` | Verify SSL certificate |
160
+
161
+ ---
162
+
163
+ ## Troubleshooting
164
+
165
+ <details>
166
+ <summary><strong>Claude doesn't see the server</strong></summary>
167
+
168
+ - Validate JSON: `cat config.json | python3 -m json.tool`
169
+ - Path must be **absolute** (starts with `/` or `C:\`)
170
+ - Restart Claude Desktop completely (Cmd+Q / right-click quit)
171
+ - Windows: ensure file is `.json` not `.json.txt`
172
+ </details>
173
+
174
+ <details>
175
+ <summary><strong>Connection errors</strong></summary>
176
+
177
+ - Obsidian must be running with Local REST API enabled
178
+ - Test API: `curl -k https://127.0.0.1:27124/ -H "Authorization: Bearer YOUR_KEY"`
179
+ - Regenerate API key if needed
180
+ </details>
181
+
182
+ <details>
183
+ <summary><strong>Windows: "node not recognized"</strong></summary>
184
+
185
+ Use full path: `"command": "C:\\Program Files\\nodejs\\node.exe"`
186
+ </details>
187
+
188
+ ---
189
+
190
+ ## Development
191
+
192
+ ```bash
193
+ npm run build # Compile TypeScript
194
+ npm run dev # Watch mode
195
+ npm run inspector # Test tools in browser UI
196
+ ```
197
+
198
+ ### Adding Tools
199
+
200
+ Create/edit files in `src/tools/`, then rebuild:
201
+
202
+ ```typescript
203
+ server.tool("my_tool", "Description", { param: z.string() }, async ({ param }) => {
204
+ return { content: [{ type: "text", text: "Result" }] };
205
+ });
206
+ ```
207
+
208
+ ---
209
+
210
+ ## FAQ
211
+
212
+ **Is it free?** Yes, the Local REST API plugin is free.
213
+
214
+ **Are my notes sent to the cloud?** No. Everything stays local. Only your conversation with Claude goes to Anthropic (like any Claude chat).
215
+
216
+ **Works with Obsidian Sync?** Yes, it accesses your local vault files.
217
+
218
+ ---
219
+
220
+ ## Contributing
221
+
222
+ PRs welcome! Fork → create branch → commit → open PR.
223
+
224
+ ---
225
+
226
+ ## License
227
+
228
+ MIT — see [LICENSE](LICENSE)
229
+
230
+ ---
231
+
232
+ Built with [MCP SDK](https://modelcontextprotocol.io) · Powered by [Local REST API](https://github.com/coddingtonbear/obsidian-local-rest-api)
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ============================================================================
4
+ * OBSIDIAN MCP SERVER - Main Entry Point
5
+ * ============================================================================
6
+ *
7
+ * An MCP (Model Context Protocol) server for integrating AI assistants with
8
+ * Obsidian via the Local REST API plugin.
9
+ *
10
+ * PREREQUISITES:
11
+ * 1. Install "Local REST API" plugin in Obsidian
12
+ * 2. Enable the plugin and note your API key
13
+ * 3. Set OBSIDIAN_API_KEY environment variable
14
+ *
15
+ * FEATURES:
16
+ * - 40+ tools for vault management, note CRUD, search, and more
17
+ * - Daily notes and periodic notes support
18
+ * - Frontmatter/metadata management
19
+ * - Link analysis and graph operations
20
+ * - Note templates and quick capture
21
+ *
22
+ * For more information: https://modelcontextprotocol.io
23
+ * ============================================================================
24
+ */
25
+ export {};
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
package/build/index.js ADDED
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ============================================================================
4
+ * OBSIDIAN MCP SERVER - Main Entry Point
5
+ * ============================================================================
6
+ *
7
+ * An MCP (Model Context Protocol) server for integrating AI assistants with
8
+ * Obsidian via the Local REST API plugin.
9
+ *
10
+ * PREREQUISITES:
11
+ * 1. Install "Local REST API" plugin in Obsidian
12
+ * 2. Enable the plugin and note your API key
13
+ * 3. Set OBSIDIAN_API_KEY environment variable
14
+ *
15
+ * FEATURES:
16
+ * - 40+ tools for vault management, note CRUD, search, and more
17
+ * - Daily notes and periodic notes support
18
+ * - Frontmatter/metadata management
19
+ * - Link analysis and graph operations
20
+ * - Note templates and quick capture
21
+ *
22
+ * For more information: https://modelcontextprotocol.io
23
+ * ============================================================================
24
+ */
25
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
26
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
27
+ import { readFileSync } from "fs";
28
+ import { fileURLToPath } from "url";
29
+ import { dirname, join } from "path";
30
+ // Get package version for CLI
31
+ const __filename = fileURLToPath(import.meta.url);
32
+ const __dirname = dirname(__filename);
33
+ const packageJsonPath = join(__dirname, "..", "package.json");
34
+ // Handle CLI arguments
35
+ const args = process.argv.slice(2);
36
+ if (args.includes("--help") || args.includes("-h")) {
37
+ console.log(`
38
+ Obsidian MCP Server - Connect AI assistants to your Obsidian vault
39
+
40
+ USAGE:
41
+ obsidian-mcp-server [options]
42
+
43
+ OPTIONS:
44
+ -h, --help Show this help message
45
+ -v, --version Show version number
46
+
47
+ ENVIRONMENT VARIABLES:
48
+ OBSIDIAN_API_KEY (Required) Your Local REST API key
49
+ OBSIDIAN_HOST API host (default: 127.0.0.1)
50
+ OBSIDIAN_PORT API port (default: 27124)
51
+ OBSIDIAN_SECURE Use HTTPS (default: true)
52
+ OBSIDIAN_VERIFY_SSL Verify SSL certificate (default: false)
53
+
54
+ SETUP:
55
+ 1. Install "Local REST API" plugin in Obsidian
56
+ 2. Copy your API key from plugin settings
57
+ 3. Set OBSIDIAN_API_KEY environment variable
58
+ 4. Add to your Claude Desktop config:
59
+
60
+ {
61
+ "mcpServers": {
62
+ "obsidian": {
63
+ "command": "obsidian-mcp-server",
64
+ "env": { "OBSIDIAN_API_KEY": "your-key-here" }
65
+ }
66
+ }
67
+ }
68
+
69
+ For more info: https://github.com/aniketbiswas/obsidian-mcp-server
70
+ `);
71
+ process.exit(0);
72
+ }
73
+ if (args.includes("--version") || args.includes("-v")) {
74
+ try {
75
+ const pkg = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
76
+ console.log(`obsidian-mcp-server v${pkg.version}`);
77
+ }
78
+ catch {
79
+ console.log("obsidian-mcp-server v1.0.0");
80
+ }
81
+ process.exit(0);
82
+ }
83
+ // Obsidian MCP components
84
+ import { registerAllTools } from "./tools/index.js";
85
+ import { registerObsidianResources } from "./resources/obsidian.js";
86
+ import { registerObsidianPrompts } from "./prompts/obsidian.js";
87
+ // Configuration and client
88
+ import { getConfig } from "./utils/config.js";
89
+ import { ObsidianClient } from "./utils/client.js";
90
+ /**
91
+ * Create the MCP server instance.
92
+ */
93
+ const server = new McpServer({
94
+ name: "obsidian-mcp-server",
95
+ version: "1.0.0",
96
+ });
97
+ /**
98
+ * Main function - initializes and starts the MCP server.
99
+ */
100
+ async function main() {
101
+ // Validate configuration on startup
102
+ let client = null;
103
+ try {
104
+ const config = getConfig();
105
+ client = new ObsidianClient(config);
106
+ console.error(`📂 Obsidian MCP Server starting...`);
107
+ console.error(` Host: ${config.host}:${config.port}`);
108
+ console.error(` Secure: ${config.secure}`);
109
+ }
110
+ catch (error) {
111
+ console.error("⚠️ Configuration warning:", error.message);
112
+ console.error("");
113
+ console.error("Running in demo mode - tools will be visible but won't connect to Obsidian.");
114
+ console.error("To enable full functionality, set:");
115
+ console.error(" OBSIDIAN_API_KEY - Your Local REST API key (required)");
116
+ console.error("");
117
+ // Create a dummy client for demo mode
118
+ const dummyConfig = {
119
+ apiKey: "demo-mode",
120
+ host: "127.0.0.1",
121
+ port: 27124,
122
+ secure: true,
123
+ timeout: 30000,
124
+ verifySsl: false,
125
+ };
126
+ client = new ObsidianClient(dummyConfig);
127
+ }
128
+ // Register all Obsidian tools
129
+ registerAllTools(server, client);
130
+ // Register resources
131
+ registerObsidianResources(server, client);
132
+ // Register prompts
133
+ registerObsidianPrompts(server);
134
+ // Start the server
135
+ const transport = new StdioServerTransport();
136
+ await server.connect(transport);
137
+ console.error("✅ Obsidian MCP Server is running!");
138
+ console.error(" Tools: 40+ available");
139
+ console.error(" Resources: 3 available");
140
+ console.error(" Prompts: 8 available");
141
+ console.error("");
142
+ console.error(" Use 'npm run inspector' to test your tools.");
143
+ }
144
+ main().catch((error) => {
145
+ console.error("❌ Fatal error:", error);
146
+ process.exit(1);
147
+ });
148
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,8BAA8B;AAC9B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,U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MAAM,CAAC,CAAC;IAE1C,mBAAmB;IACnB,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEhC,mBAAmB;IACnB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACnD,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACzC,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC3C,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACzC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;AAClE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * ============================================================================
3
+ * MCP PROMPTS - Pre-built Templates for AI Interactions
4
+ * ============================================================================
5
+ *
6
+ * Prompts are pre-written templates that help structure interactions.
7
+ * They're like "shortcuts" - instead of typing a long prompt, users can
8
+ * select a prompt and fill in a few parameters.
9
+ *
10
+ * WHEN TO USE PROMPTS:
11
+ * - Common tasks users do repeatedly
12
+ * - Complex prompts that are hard to type from scratch
13
+ * - Standardized workflows (code review, documentation, etc.)
14
+ *
15
+ * ANATOMY OF A PROMPT:
16
+ *
17
+ * server.prompt(
18
+ * "prompt-name", // Unique identifier
19
+ * "Description", // What this prompt does
20
+ * { parameters }, // User inputs (using Zod)
21
+ * async (inputs) => {} // Returns the formatted message(s)
22
+ * );
23
+ *
24
+ * NOTE: Prompts are optional! Many MCP servers only have tools.
25
+ * ============================================================================
26
+ */
27
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
28
+ /**
29
+ * Registers example prompts.
30
+ * Delete or modify these - they're just examples!
31
+ */
32
+ export declare function registerPrompts(server: McpServer): void;
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmJvD"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * ============================================================================
3
+ * MCP PROMPTS - Pre-built Templates for AI Interactions
4
+ * ============================================================================
5
+ *
6
+ * Prompts are pre-written templates that help structure interactions.
7
+ * They're like "shortcuts" - instead of typing a long prompt, users can
8
+ * select a prompt and fill in a few parameters.
9
+ *
10
+ * WHEN TO USE PROMPTS:
11
+ * - Common tasks users do repeatedly
12
+ * - Complex prompts that are hard to type from scratch
13
+ * - Standardized workflows (code review, documentation, etc.)
14
+ *
15
+ * ANATOMY OF A PROMPT:
16
+ *
17
+ * server.prompt(
18
+ * "prompt-name", // Unique identifier
19
+ * "Description", // What this prompt does
20
+ * { parameters }, // User inputs (using Zod)
21
+ * async (inputs) => {} // Returns the formatted message(s)
22
+ * );
23
+ *
24
+ * NOTE: Prompts are optional! Many MCP servers only have tools.
25
+ * ============================================================================
26
+ */
27
+ import { z } from "zod";
28
+ /**
29
+ * Registers example prompts.
30
+ * Delete or modify these - they're just examples!
31
+ */
32
+ export function registerPrompts(server) {
33
+ // ---------------------------------------------------------------------------
34
+ // PROMPT: code-review
35
+ // ---------------------------------------------------------------------------
36
+ // Takes code and returns a structured code review request.
37
+ // Demonstrates basic prompt with string and optional parameters.
38
+ // ---------------------------------------------------------------------------
39
+ server.prompt("code-review", "Generate a code review for the provided code", {
40
+ code: z.string().describe("The code to review"),
41
+ language: z.string().optional().describe("Programming language (e.g., 'typescript', 'python')"),
42
+ }, async ({ code, language }) => ({
43
+ // Return an array of messages that form the prompt
44
+ messages: [
45
+ {
46
+ role: "user",
47
+ content: {
48
+ type: "text",
49
+ text: `Please review the following ${language || "code"} and provide feedback on:
50
+ 1. Code quality and best practices
51
+ 2. Potential bugs or issues
52
+ 3. Performance considerations
53
+ 4. Suggestions for improvement
54
+
55
+ Code to review:
56
+ \`\`\`${language || ""}
57
+ ${code}
58
+ \`\`\``,
59
+ },
60
+ },
61
+ ],
62
+ }));
63
+ // ---------------------------------------------------------------------------
64
+ // PROMPT: explain-code
65
+ // ---------------------------------------------------------------------------
66
+ // Simple prompt with just one required parameter.
67
+ // ---------------------------------------------------------------------------
68
+ server.prompt("explain-code", "Explain what the provided code does", {
69
+ code: z.string().describe("The code to explain"),
70
+ }, async ({ code }) => ({
71
+ messages: [
72
+ {
73
+ role: "user",
74
+ content: {
75
+ type: "text",
76
+ text: `Please explain what the following code does in simple terms. Break it down step by step:
77
+
78
+ \`\`\`
79
+ ${code}
80
+ \`\`\``,
81
+ },
82
+ },
83
+ ],
84
+ }));
85
+ // ---------------------------------------------------------------------------
86
+ // PROMPT: generate-docs
87
+ // ---------------------------------------------------------------------------
88
+ // Demonstrates using z.enum() for a fixed set of choices.
89
+ // ---------------------------------------------------------------------------
90
+ server.prompt("generate-docs", "Generate documentation for the provided code", {
91
+ code: z.string().describe("The code to document"),
92
+ style: z
93
+ .enum(["jsdoc", "markdown", "readme"])
94
+ .optional()
95
+ .default("jsdoc")
96
+ .describe("Documentation style"),
97
+ }, async ({ code, style }) => ({
98
+ messages: [
99
+ {
100
+ role: "user",
101
+ content: {
102
+ type: "text",
103
+ text: `Please generate ${style || "jsdoc"} documentation for the following code:
104
+
105
+ \`\`\`
106
+ ${code}
107
+ \`\`\`
108
+
109
+ Make sure to include:
110
+ - Description of what the code does
111
+ - Parameter descriptions (if applicable)
112
+ - Return value description (if applicable)
113
+ - Usage examples`,
114
+ },
115
+ },
116
+ ],
117
+ }));
118
+ // ---------------------------------------------------------------------------
119
+ // PROMPT: debug-help
120
+ // ---------------------------------------------------------------------------
121
+ // Multiple required parameters for a debugging assistant.
122
+ // ---------------------------------------------------------------------------
123
+ server.prompt("debug-help", "Help debug an issue with the provided code and error", {
124
+ code: z.string().describe("The code with the bug"),
125
+ error: z.string().describe("The error message or unexpected behavior"),
126
+ }, async ({ code, error }) => ({
127
+ messages: [
128
+ {
129
+ role: "user",
130
+ content: {
131
+ type: "text",
132
+ text: `I'm encountering an issue with my code. Please help me debug it.
133
+
134
+ **Error/Issue:**
135
+ ${error}
136
+
137
+ **Code:**
138
+ \`\`\`
139
+ ${code}
140
+ \`\`\`
141
+
142
+ Please:
143
+ 1. Identify the likely cause of the issue
144
+ 2. Explain why it's happening
145
+ 3. Provide a fix or solution
146
+ 4. Suggest how to prevent similar issues in the future`,
147
+ },
148
+ },
149
+ ],
150
+ }));
151
+ }
152
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAiB;IAE/C,8EAA8E;IAC9E,sBAAsB;IACtB,8EAA8E;IAC9E,2DAA2D;IAC3D,iEAAiE;IACjE,8EAA8E;IAE9E,MAAM,CAAC,MAAM,CACX,aAAa,EACb,8CAA8C,EAC9C;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC/C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;KAChG,EACD,KAAK,EAAE,EAA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AAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,mBAAmB,KAAK,IAAI,OAAO;;;EAGnD,IAAI;;;;;;;iBAOW;iBACN;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,8EAA8E;IAC9E,qBAAqB;IACrB,8EAA8E;IAC9E,0DAA0D;IAC1D,8EAA8E;IAE9E,MAAM,CAAC,MAAM,CACX,YAAY,EACZ,sDAAsD,EACtD;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAClD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KACvE,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1B,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;EAGhB,KAAK;;;;EAIL,IAAI;;;;;;;uDAOiD;iBAC5C;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * ============================================================================
3
+ * OBSIDIAN MCP - Prompts
4
+ * ============================================================================
5
+ *
6
+ * Pre-built prompt templates for common Obsidian workflows.
7
+ * These help users quickly perform complex operations with their vault.
8
+ * ============================================================================
9
+ */
10
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
+ /**
12
+ * Register Obsidian prompts with the MCP server.
13
+ *
14
+ * @param server - The MCP server instance
15
+ */
16
+ export declare function registerObsidianPrompts(server: McpServer): void;
17
+ //# sourceMappingURL=obsidian.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"obsidian.d.ts","sourceRoot":"","sources":["../../src/prompts/obsidian.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+V/D"}