-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from jacksteamdev/feat--update-descriptions
MCP Tools Plugin Documentation Update
- Loading branch information
Showing
6 changed files
with
171 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,142 @@ | ||
# obsidian-mcp-server MCP Server | ||
# MCP Tools Server | ||
|
||
A Model Context Protocol server that proxies the Obsidian Local REST API endpoints. | ||
A secure Model Context Protocol (MCP) server that provides authenticated access to Obsidian vaults. This server implements MCP endpoints for accessing notes, executing templates, and performing semantic search through Claude Desktop and other MCP clients. | ||
|
||
This is a TypeScript-based MCP server that implements a simple notes system. It demonstrates core MCP concepts by providing: | ||
## Features | ||
|
||
- Resources representing text notes with URIs and metadata | ||
- Tools for creating new notes | ||
- Prompts for generating summaries of notes | ||
### Resource Access | ||
|
||
## Features | ||
- Read and write vault files via `note://` URIs | ||
- Access file metadata and frontmatter | ||
- Semantic search through Smart Connections | ||
- Template execution via Templater | ||
|
||
### Resources | ||
- List and access notes via `note://` URIs | ||
- Each note has a title, content and metadata | ||
- Plain text mime type for simple content access | ||
### Security | ||
|
||
- Binary attestation with SLSA provenance | ||
- Encrypted communication via Local REST API | ||
- Platform-specific credential storage | ||
- Minimal required permissions | ||
|
||
### Tools | ||
- `create_note` - Create new text notes | ||
- Takes title and content as required parameters | ||
- Stores note in server state | ||
|
||
### Prompts | ||
- `summarize_notes` - Generate a summary of all stored notes | ||
- Includes all note contents as embedded resources | ||
- Returns structured prompt for LLM summarization | ||
- File operations (create, read, update, delete) | ||
- Semantic search with filters | ||
- Template execution with parameters | ||
- Vault directory listing | ||
|
||
## Development | ||
## Installation | ||
|
||
Install dependencies: | ||
```bash | ||
npm install | ||
``` | ||
The server is typically installed automatically through the Obsidian plugin. For manual installation: | ||
|
||
Build the server: | ||
```bash | ||
npm run build | ||
``` | ||
# Install dependencies | ||
bun install | ||
|
||
For development with auto-rebuild: | ||
```bash | ||
npm run watch | ||
# Build the server | ||
bun run build | ||
``` | ||
|
||
## Installation | ||
```` | ||
### Configuration | ||
To use with Claude Desktop, add the server config: | ||
Server configuration is managed through Claude Desktop's config file: | ||
On MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json` | ||
On Windows: `%APPDATA%/Claude/claude_desktop_config.json` | ||
On macOS: | ||
```json | ||
// ~/Library/Application Support/Claude/claude_desktop_config.json | ||
{ | ||
"mcpServers": { | ||
"obsidian-mcp-server": { | ||
"command": "/path/to/obsidian-mcp-server/build/index.js" | ||
"obsidian-mcp-tools": { | ||
"command": "/path/to/mcp-server", | ||
"env": { | ||
"OBSIDIAN_API_KEY": "your-api-key" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
### Debugging | ||
## Development | ||
```bash | ||
# Start development server with auto-reload | ||
bun run dev | ||
# Run tests | ||
bun test | ||
# Build for all platforms | ||
bun run build:all | ||
# Use MCP Inspector for debugging | ||
bun run inspector | ||
``` | ||
### Project Structure | ||
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), which is available as a package script: | ||
``` | ||
src/ | ||
├── features/ # Feature modules | ||
│ ├── core/ # Server core | ||
│ ├── fetch/ # Web content fetching | ||
│ ├── local-rest-api/# API integration | ||
│ ├── prompts/ # Prompt handling | ||
│ └── templates/ # Template execution | ||
├── shared/ # Shared utilities | ||
└── types/ # TypeScript types | ||
``` | ||
### Binary Distribution | ||
Server binaries are published with SLSA Provenance attestations. To verify a binary: | ||
```bash | ||
npm run inspector | ||
gh attestation verify --owner jacksteamdev <binary> | ||
``` | ||
The Inspector will provide a URL to access debugging tools in your browser. | ||
This verifies: | ||
- Binary's SHA256 hash | ||
- Build origin from this repository | ||
- Compliance with SLSA Level 3 | ||
## Protocol Implementation | ||
### Resources | ||
- `note://` - Vault file access | ||
- `template://` - Template execution | ||
- `search://` - Semantic search | ||
### Tools | ||
- `create_note` - Create new files | ||
- `update_note` - Modify existing files | ||
- `execute_template` - Run Templater templates | ||
- `semantic_search` - Smart search integration | ||
## Contributing | ||
1. Fork the repository | ||
2. Create a feature branch | ||
3. Add tests for new functionality | ||
4. Update documentation | ||
5. Submit a pull request | ||
See [CONTRIBUTING.md](../CONTRIBUTING.md) for detailed guidelines. | ||
## Security | ||
For security issues, please: | ||
1. **DO NOT** open a public issue | ||
2. Email [jacksteamdev+security@gmail.com](mailto:jacksteamdev+security@gmail.com) | ||
3. Follow responsible disclosure practices | ||
## License | ||
[MIT License](LICENSE) | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,80 @@ | ||
# Obsidian Sample Plugin | ||
# MCP Tools Plugin for Obsidian | ||
|
||
This is a sample plugin for Obsidian (https://obsidian.md). | ||
The Obsidian plugin component of MCP Tools, providing secure MCP server integration for accessing Obsidian vaults through Claude Desktop and other MCP clients. | ||
|
||
This project uses TypeScript to provide type checking and documentation. | ||
The repo depends on the latest plugin API (obsidian.d.ts) in TypeScript Definition format, which contains TSDoc comments describing what it does. | ||
## Features | ||
|
||
This sample plugin demonstrates some of the basic functionality the plugin API can do. | ||
- Adds a ribbon icon, which shows a Notice when clicked. | ||
- Adds a command "Open Sample Modal" which opens a Modal. | ||
- Adds a plugin setting tab to the settings page. | ||
- Registers a global click event and output 'click' to the console. | ||
- Registers a global interval which logs 'setInterval' to the console. | ||
- **Secure Access**: All communication encrypted and authenticated through Local REST API | ||
- **Semantic Search**: Seamless integration with Smart Connections for context-aware search | ||
- **Template Support**: Execute Templater templates through MCP clients | ||
- **File Management**: Comprehensive vault access and management capabilities | ||
- **Security First**: Binary attestation and secure key management | ||
|
||
## First time developing plugins? | ||
## Requirements | ||
|
||
Quick starting guide for new plugin devs: | ||
### Required | ||
|
||
- Check if [someone already developed a plugin for what you want](https://obsidian.md/plugins)! There might be an existing plugin similar enough that you can partner up with. | ||
- Make a copy of this repo as a template with the "Use this template" button (login to GitHub if you don't see it). | ||
- Clone your repo to a local development folder. For convenience, you can place this folder in your `.obsidian/plugins/your-plugin-name` folder. | ||
- Install NodeJS, then run `npm i` in the command line under your repo folder. | ||
- Run `npm run dev` to compile your plugin from `src/main.ts` to `main.js`. | ||
- Make changes to `src/main.ts` (or create new `.ts` files). Those changes should be automatically compiled into `main.js`. | ||
- Reload Obsidian to load the new version of your plugin. | ||
- Enable plugin in settings window. | ||
- For updates to the Obsidian API run `npm update` in the command line under your repo folder. | ||
- Obsidian v1.7.7 or higher | ||
- [Local REST API](https://github.com/coddingtonbear/obsidian-local-rest-api) plugin | ||
|
||
## Releasing new releases | ||
### Recommended | ||
|
||
- Update your `manifest.json` with your new version number, such as `1.0.1`, and the minimum Obsidian version required for your latest release. | ||
- Update your `versions.json` file with `"new-plugin-version": "minimum-obsidian-version"` so older versions of Obsidian can download an older version of your plugin that's compatible. | ||
- Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix `v`. See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releases | ||
- Upload the files `manifest.json`, `main.js`, `styles.css` as binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release. | ||
- Publish the release. | ||
- [Smart Connections](https://smartconnections.app/) for semantic search | ||
- [Templater](https://silentvoid13.github.io/Templater/) for template execution | ||
|
||
> You can simplify the version bump process by running `npm version patch`, `npm version minor` or `npm version major` after updating `minAppVersion` manually in `manifest.json`. | ||
> The command will bump version in `manifest.json` and `package.json`, and add the entry for the new version to `versions.json` | ||
## Development | ||
|
||
## Adding your plugin to the community plugin list | ||
This plugin is part of the MCP Tools monorepo. For development: | ||
|
||
- Check the [plugin guidelines](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines). | ||
- Publish an initial version. | ||
- Make sure you have a `README.md` file in the root of your repo. | ||
- Make a pull request at https://github.com/obsidianmd/obsidian-releases to add your plugin. | ||
```bash | ||
# Install dependencies | ||
bun install | ||
|
||
## How to use | ||
# Start development build with watch mode | ||
bun run dev | ||
|
||
- Clone this repo. | ||
- Make sure your NodeJS is at least v16 (`node --version`). | ||
- `npm i` or `yarn` to install dependencies. | ||
- `npm run dev` to start compilation in watch mode. | ||
# Create a production build | ||
bun run build | ||
|
||
## Manually installing the plugin | ||
# Link plugin to your vault for testing | ||
bun run link <path-to-vault-config-file> | ||
``` | ||
|
||
### Project Structure | ||
|
||
- Copy over `main.js`, `styles.css`, `manifest.json` to your vault `VaultFolder/.obsidian/plugins/your-plugin-id/`. | ||
``` | ||
src/ | ||
├── features/ # Feature modules | ||
│ ├── core/ # Plugin initialization | ||
│ ├── mcp-server/ # Server management | ||
│ └── shared/ # Common utilities | ||
├── main.ts # Plugin entry point | ||
└── shared/ # Shared types and utilities | ||
``` | ||
|
||
## Improve code quality with eslint (optional) | ||
- [ESLint](https://eslint.org/) is a tool that analyzes your code to quickly find problems. You can run ESLint against your plugin to find common bugs and ways to improve your code. | ||
- To use eslint with this project, make sure to install eslint from terminal: | ||
- `npm install -g eslint` | ||
- To use eslint to analyze this project use this command: | ||
- `eslint src/main.ts` | ||
- eslint will then create a report with suggestions for code improvement by file and line number. | ||
- If your source code is in a folder, such as `src`, you can use eslint with this command to analyze all files in that folder: | ||
- `eslint .\src\` | ||
### Adding New Features | ||
|
||
## Funding URL | ||
1. Create a new feature module in `src/features/` | ||
2. Implement the feature's setup function | ||
3. Add any UI components to the settings tab | ||
4. Register the feature in `main.ts` | ||
|
||
You can include funding URLs where people who use your plugin can financially support it. | ||
## Security | ||
|
||
The simple way is to set the `fundingUrl` field to your link in your `manifest.json` file: | ||
This plugin follows strict security practices: | ||
|
||
```json | ||
{ | ||
"fundingUrl": "https://buymeacoffee.com" | ||
} | ||
``` | ||
- All server binaries are signed and include SLSA provenance | ||
- Communication is encrypted using Local REST API's TLS | ||
- API keys are stored securely using platform-specific methods | ||
- Server runs with minimal required permissions | ||
|
||
If you have multiple URLs, you can also do: | ||
## Contributing | ||
|
||
```json | ||
{ | ||
"fundingUrl": { | ||
"Buy Me a Coffee": "https://buymeacoffee.com", | ||
"GitHub Sponsor": "https://github.com/sponsors", | ||
"Patreon": "https://www.patreon.com/" | ||
} | ||
} | ||
``` | ||
1. Fork the repository | ||
2. Create a feature branch | ||
3. Follow the project's TypeScript and Svelte guidelines | ||
4. Submit a pull request | ||
|
||
## API Documentation | ||
## License | ||
|
||
See https://github.com/obsidianmd/obsidian-api | ||
[MIT License](LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters