All docs

MCP Integration

Connect AI assistants to m-notes via the Model Context Protocol (MCP). Supports Claude Code, Claude Desktop, Cursor, Windsurf, and VS Code Copilot.

For automated agent setup, point your AI assistant to https://mnotes.framework.by/api/agent-setup — it returns a machine-readable setup guide.

1. Generate an API Key

  1. Open Settings > API Keys
  2. Click Generate to create a new API key
  3. Copy the key immediately — it is only shown once

2. Configure Your MCP Client

m-notes uses Streamable HTTP transport at /api/mcp. Replace YOUR_M_NOTES_URL with your m-notes URL (e.g., https://m-notes.app) and YOUR_API_KEY with the key from step 1.

Claude Code

Add .mcp.json to your project root:

.mcp.json
{
  "mcpServers": {
    "m-notes": {
      "type": "http",
      "url": "YOUR_M_NOTES_URL/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Or use the CLI one-liner:

bash
claude mcp add m-notes --transport http \
  --url YOUR_M_NOTES_URL/api/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/)

claude_desktop_config.json
{
  "mcpServers": {
    "m-notes": {
      "type": "http",
      "url": "YOUR_M_NOTES_URL/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Cursor

Add .cursor/mcp.json to your project root:

.cursor/mcp.json
{
  "mcpServers": {
    "m-notes": {
      "type": "http",
      "url": "YOUR_M_NOTES_URL/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

mcp_config.json
{
  "mcpServers": {
    "m-notes": {
      "type": "http",
      "url": "YOUR_M_NOTES_URL/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

VS Code Copilot

Add .vscode/mcp.json to your project root. Note: VS Code uses servers (not mcpServers) and requires "type": "http".

.vscode/mcp.json
{
  "servers": {
    "m-notes": {
      "type": "http",
      "url": "YOUR_M_NOTES_URL/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

3. Tool Reference

m-notes exposes 18 MCP tools grouped by category. All tools are scoped to the authenticated user's data.

CRUD

ToolDescriptionParameters
create_noteCreate a new notetitle (required, max 500), content (optional, max 100k), folderId (optional)
update_noteUpdate an existing noteid (required), title / content / folderId (all optional, folderId: null unsets)
delete_noteDelete a note by IDid (required)
list_notesList all notes, optionally filtered by folder or typefolderId (optional), type (optional)
get_noteGet a single note by ID with full contentid (required)
get_note_by_titleFind note by title (case-insensitive, partial match)title (required)
get_notesBatch-fetch by IDs (max 10) or paginate all notesids (optional), cursor (optional)

Search

ToolDescriptionParameters
search_notesFulltext, semantic, or hybrid search with relevance scoringquery (required), mode (hybrid/fulltext/semantic), limit (1-20), tags, folderId, type
search_by_tagsFind notes matching tags (any or all)tags (required), match (any/all), limit (1-100)
get_recent_notesNotes modified since a given timestampsince (ISO 8601, required), limit (1-100)

Organization

ToolDescriptionParameters
manage_tagsAdd or remove tags on a note (YAML frontmatter)id (required), add (optional), remove (optional)
list_foldersList all folders with hierarchy and note counts(none)
manage_foldersCreate, rename, or delete a folderaction (create/rename/delete), id, name, parentId

Metadata

ToolDescriptionParameters
get_note_frontmatterParse YAML frontmatter from a note as JSONid (required)
set_note_frontmatterMerge key-value pairs into frontmatter (null removes key)id (required), fields (required)

Navigation

ToolDescriptionParameters
get_note_linksGet outgoing wikilinks and backlinks for a notenoteId (required)
get_workspace_summaryWorkspace overview: totals, folder tree, recent activity, top tags, type counts(none)

Content

ToolDescriptionParameters
append_to_noteAppend content to end of note with newline separatorid (required), content (required, max 100k)

NoteType enum: note, prompt, template, reference, log, memory, spec, plan

4. Workflow Recipes

Orient your AI agent

Start every session with get_workspace_summary to understand the workspace, then search_notes for task-specific context, and get_note_links to follow wikilinks.

Store project decisions

Use create_note with a descriptive title, then set_note_frontmatter with { "type": "memory" }, and manage_tags to add #decision.

Build a running journal

Create a note once, then use append_to_note to add entries over time. Content is appended with a newline separator automatically.

Find related context

Use search_notes with mode: "hybrid" for best results, then get_note_links to discover connected notes through wikilinks and backlinks.

Tag-based knowledge retrieval

Use search_by_tags with tags like #decision, #spec, #architecture, #learning, #prompt. Set match: "all" to require every tag, or match: "any" (default) for at least one.

CLAUDE.md snippet

Add this to your project's CLAUDE.md to instruct Claude Code to automatically use m-notes as a knowledge base:

CLAUDE.md
## Knowledge Base (m-notes)

This project uses m-notes as its knowledge base via MCP.

**Before starting work on any task:**
1. Call `get_workspace_summary` to orient yourself
2. Call `search_notes` with task-related keywords

**When making decisions:**
- Record with `create_note` (type: memory, tag: #decision)
- Append progress to log notes with `append_to_note`

**When completing work:**
- Update relevant spec/plan notes if implementation diverged
- Add learnings with `create_note` (type: memory, tag: #learning)

Troubleshooting

Connection refused
Make sure m-notes is running and the URL in your config matches your server address and port. Test with curl YOUR_M_NOTES_URL/api/health.
401 Unauthorized
Verify the Authorization header is Bearer YOUR_API_KEY (not just the key). Check the key has not been revoked in Settings > API Keys.
Tool not found
Ensure you are connecting to /api/mcp (not /api/mcp/sse). Restart your MCP client after config changes. Check tool names match exactly (e.g., search_notes not searchNotes).
Transport compatibility
m-notes uses Streamable HTTP transport (not SSE, not stdio). All major MCP clients support this natively. If your client only supports SSE or stdio, you will need a transport bridge.