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

Alternative: Use a Setup Link

Instead of manually generating an API key and editing config files, you can create a one-time setup link from Settings > MCP Setup Links. Share this link with your AI assistant or open it in your MCP client — it handles authentication automatically without exposing API keys directly.

  • Each setup link can only be used once and expires after use
  • Give the link a label (e.g., “Claude Desktop — work laptop”) so you can track and revoke access later
  • Revoke any setup link from Settings if you need to disconnect a client

2. Configure Your MCP Client (Manual)

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 70+ MCP tools grouped by category. All tools are scoped to the authenticated user's workspace and 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)
append_to_noteAppend content to end of note with newline separatorid (required), content (required, max 100k)
split_noteSplit a note into multiple notes at heading boundariesid (required)

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)
find_duplicatesFind potentially duplicate notes using semantic similarity(none)
orphan_notesFind notes with no wikilinks or backlinks(none)

Organization

ToolDescriptionParameters
manage_tagsAdd or remove tags on a note (YAML frontmatter)id (required), add (optional), remove (optional)
list_tagsList all tags in the workspace with usage counts(none)
list_foldersList all folders with hierarchy and note counts(none)
manage_foldersCreate, rename, or delete a folderaction (create/rename/delete), id, name, parentId
move_folderMove a folder to a new parentid (required), parentId (required, null for root)
pin_notePin a note to the top of its folder listid (required)
unpin_noteUnpin a previously pinned noteid (required)
toggle_starToggle the starred status of a noteid (required)
list_pinnedList all pinned notes in the workspace(none)
list_starredList all starred notes in the workspace(none)

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)
set_importanceSet importance score on a note for prioritized retrievalid (required), score (required)
set_provenanceRecord the origin/source of a noteid (required), provenance (required)
get_provenanceGet the provenance metadata for a noteid (required)

Navigation & Context

ToolDescriptionParameters
get_note_linksGet outgoing wikilinks and backlinks for a notenoteId (required)
get_backlinksGet all notes that link to a given notenoteId (required)
get_workspace_summaryWorkspace overview: totals, folder tree, recent activity, top tags(none)
get_kb_statsKnowledge base statistics and health metrics(none)
context_fetchFetch context from a URL for use in notesurl (required)
daily_digestGet a summary of recent note activity(none)

Knowledge Graph

ToolDescriptionParameters
create_nodeCreate a knowledge graph node (entity)label (required), type (required), noteId (optional)
create_edgeCreate a typed relationship between two nodessourceId (required), targetId (required), type (required)
delete_nodeDelete a knowledge graph nodeid (required)
delete_edgeDelete a relationship between nodesid (required)
get_neighborsGet nodes connected to a given nodenodeId (required)
query_graphSearch the knowledge graph by type, label, or relationshiptype (optional), label (optional), relationship (optional)
query_note_graphGet the subgraph connected to a specific notenoteId (required)
populate_graphAuto-generate graph nodes and edges from a notenoteId (required)
graph_traverseWalk the graph from a starting node with depth controlstartNodeId (required), depth (optional)
find_pathFind shortest path between two nodes in the graphsourceId (required), targetId (required)
extract_entitiesExtract entities from note content using AInoteId (required)
knowledge_linkCreate a typed relationship between knowledge entries or notessourceId (required), targetId (required), type (required)

Knowledge Management

ToolDescriptionParameters
knowledge_storeStore a knowledge entry with embeddings for semantic retrievalcontent (required), metadata (optional)
memory_upsertCreate or update a memory note by keykey (required), content (required)
note_summaryGenerate an AI summary of a noteid (required)
related_notesFind semantically related notesid (required), limit (optional)
knowledge_ingestBulk ingest content into the knowledge baseentries (required)
knowledge_decayApply time-based decay to knowledge relevance scores(none)
recall_knowledgeRetrieve knowledge entries by semantic similarityquery (required), limit (optional)
scan_knowledge_conflictsScan for contradictions across notes(none)
get_knowledge_conflictsGet previously detected knowledge conflicts(none)
synthesize_notesSynthesize multiple notes into a single summarynoteIds (required)
get_clustersGet topic clusters from note embeddings(none)
generate_mocGenerate a Map of Content (MOC) note for a topictopic (required)

AI & Suggestions

ToolDescriptionParameters
ask_notesAsk a question answered from your notes (RAG)question (required)
suggest_tags_linksGet AI-suggested tags and wikilinks for a noteid (required)
suggest_tagsGet AI-suggested tags for a noteid (required)

Smart Folders

ToolDescriptionParameters
list_smart_foldersList all smart folders with their filter rules(none)
create_smart_folderCreate a dynamic folder with filter rulesname (required), rules (required)
delete_smart_folderDelete a smart folderid (required)

Object Types

ToolDescriptionParameters
list_object_typesList all defined object types with their property schemas(none)
set_note_typeAssign an object type to a note with property valuesnoteId (required), typeId (required), properties (optional)
query_by_typeFind notes of a specific object typetypeId (required)

Workspaces

ToolDescriptionParameters
list_workspacesList all workspaces with note and folder counts(none)
create_workspaceCreate a new workspacename (required), description (optional)
setup_workspaceCreate a workspace with a template (e.g., remedy-pod)name (required), template (optional)
set_active_workspaceSet the active workspace for the MCP sessionid or slug (required)
get_workspace_contextGet rich context: metadata, folder tree, recent notes, top tags(none)
update_workspaceUpdate workspace name, description, or iconid (required), name / description / icon (optional)
delete_workspaceDelete a workspace (notes move to default)id (required)

Version History

ToolDescriptionParameters
list_versionsList all saved versions of a notenoteId (required)
get_versionGet the content of a specific versionversionId (required)
restore_versionRestore a note to a previous versionversionId (required)

Tasks

ToolDescriptionParameters
list_tasksList markdown tasks (checkboxes) across notesstatus (optional: all/done/pending)
toggle_taskToggle a task checkbox in a notenoteId (required), taskIndex (required)

Bulk Operations

ToolDescriptionParameters
bulk_tagAdd or remove tags on multiple notes at oncenoteIds (required), add (optional), remove (optional)
bulk_moveMove multiple notes to a foldernoteIds (required), folderId (required)
bulk_archiveArchive multiple notesnoteIds (required)

Recipes & Automation

ToolDescriptionParameters
list_recipesList available automation recipes(none)
run_recipeRun an automation reciperecipeId (required), params (optional)

Session & Files

ToolDescriptionParameters
session_logLog a message to the current MCP session tracemessage (required)
save_conversationSave a conversation transcript as a notetitle (required), messages (required)
list_sessionsList recent MCP session traceslimit (optional)
get_session_replayGet full replay of a session tracesessionId (required)
upload_fileUpload a file attachment to a notenoteId (required), file (required)
list_timelineGet timeline of recent activity across noteslimit (optional)

NoteType enum: note, prompt, template, reference, log, memory, spec, plan. Object types extend this with custom schemas.

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.