Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 2.11 KB

File metadata and controls

65 lines (49 loc) · 2.11 KB

MindCache

MCP server that bridges Obsidian vaults with AI assistants.

Project Structure

mindcache/
├── packages/
│   ├── server/         # MCP server (npm package: mindcache)
│   └── website/        # Landing page (usemindcache.com)
├── package.json        # Root workspace config
└── pnpm-workspace.yaml

Server Package (packages/server/)

  • Entry: src/cli.ts — CLI + MCP server startup
  • Server: src/server.ts — MCP server creation, tool/resource registration
  • Obsidian Client: src/obsidian.ts — Direct filesystem client for Obsidian vaults (no plugin required)
  • Config: src/config.ts — Configuration loading from YAML/env vars
  • Templates: src/templates.ts — Note template engine
  • Tools: src/tools/ — 44 MCP tools organized by category (find, read, remember, journal, write, connect, organize, understand, tasks, vault)
  • Resources: src/resources/ — 4 MCP resources (vault://today, vault://recent, vault://tags, vault://context)

Commands

# Build
pnpm build          # Build all packages
pnpm --filter server build

# Type check
pnpm --filter server lint

# Test
pnpm --filter server test

# Dev
pnpm --filter server dev     # Watch mode
pnpm --filter website dev    # Website dev server

Tech Stack

  • TypeScript, ESM-only
  • MCP SDK v1.x (@modelcontextprotocol/sdk)
  • Zod for schema validation
  • tsup for building
  • Vitest for testing
  • Astro + Tailwind for website

Conventions

  • Logging: Always use process.stderr.write(), never console.log
  • Error handling: Return { content: [...], isError: true } for tool errors
  • Tool signatures: (server: McpServer, client: ObsidianClient, config: MindCacheConfig) => void
  • Config: Support both YAML file and environment variables
  • Templates: Mustache-style {{variable}} placeholders

Important

  • @modelcontextprotocol/sdk is imported from subpaths: server/mcp.js, server/stdio.js
  • All tool files must use _config prefix for unused config parameters (strict mode)
  • The server reads the vault directly from the filesystem — no Obsidian plugins required