Labsco
Jacobinwwey logo

Notemd MCP

โ˜… 3

from Jacobinwwey

A backend server for the Notemd Obsidian plugin, offering AI-powered text processing and knowledge management.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

Notemd MCP (Mission Control Platform) Server

==================================================
  _   _       _   _ ___    __  __ ___
 | \ | | ___ | |_| |___|  |  \/  |___ \
 |  \| |/ _ \| __| |___|  | |\/| |   | |
 | |\  | (_) | |_| |___   | |  | |___| |
 |_| \_|\___/ \__|_|___|  | |  | |____/
==================================================
   AI-Powered Backend for Your Knowledge Base
==================================================

Welcome to the Notemd MCP Server! This project provides a powerful, standalone backend server that exposes the core AI-powered text processing and knowledge management functionalities of the Notemd Obsidian Plugin.

English | ็ฎ€ไฝ“ไธญๆ–‡

Built with Python and FastAPI, this server allows you to offload heavy computational tasks from the client and provides a robust API to interact with your knowledge base programmatically.

Features

  • AI-Powered Content Enrichment: Automatically processes Markdown content to identify key concepts and create [[wiki-links]], building a deeply interconnected knowledge graph.
  • Automated Documentation Generation: Generates comprehensive, structured documentation from a single title or keyword, optionally using web research for context.
  • Integrated Web Research & Summarization: Performs web searches using Tavily or DuckDuckGo and uses an LLM to provide concise summaries on any topic.
  • Diagram Workflows (Canonical + Compatibility Alias): Supports generate_diagram as the canonical flow plus generate_experimental_diagram as a legacy compatibility alias aligned with modern NotEMD command surfaces.
  • Translation & Extraction Utilities: Adds first-class translation, concept extraction, and verbatim original-text extraction operations for automation pipelines.
  • Knowledge Graph Integrity: Includes endpoints to automatically update or remove backlinks when files are renamed or deleted, preventing broken links.
  • Syntax Correction: Provides a utility to batch-fix common Mermaid.js and LaTeX syntax errors often found in LLM-generated content.
  • Highly Configurable: All major features, API keys, file paths, and model parameters are easily managed in a central config.py file.
  • Multi-LLM Support: Compatible with any OpenAI-compliant API, including local models via LMStudio and Ollama, and cloud providers like DeepSeek, Anthropic, Google, and more.
  • Interactive API Docs: Comes with automatically generated, interactive API documentation via Swagger UI.

How It Works

The server is built on a simple and logical architecture:

  • main.py (API Layer): Defines all API endpoints using the FastAPI framework. It handles incoming requests, validates data using Pydantic, and calls the appropriate functions from the core logic layer.
  • notemd_core.py (Logic Layer): The engine of the application. It contains all the business logic for interacting with LLMs, processing text, performing web searches, and managing files within your knowledge base.
  • config.py (User-Defined Space): The central configuration hub. This is where you define your file paths, API keys, and tune the behavior of the server to fit your needs.
  • cli.js (MCP Bridge): A Node.js-based command-line interface that acts as a bridge to the Python server. It uses the @modelcontextprotocol/sdk to create a server that can be called by other tools. It starts the FastAPI server and then communicates with it via HTTP requests.

API Endpoints

EndpointMethodDescriptionRequest BodyResponse
/process_contentPOSTTakes a block of text and enriches it with [[wiki-links]].{"content": "string", "cancelled": "boolean"}{"processed_content": "string"}
/generate_titlePOSTGenerates full documentation from a single title.{"title": "string", "cancelled": "boolean"}{"generated_content": "string"}
/research_summarizePOSTPerforms a web search on a topic and returns an AI-generated summary.{"topic": "string", "cancelled": "boolean"}{"summary": "string"}
/execute_custom_promptPOSTExecute a user-defined prompt with given content.{"prompt": "string", "content": "string", "cancelled": "boolean"}{"response": "string"}
/translate_contentPOSTTranslate text/markdown into a target language.{"content": "string", "target_language": "string", "cancelled": "boolean"}{"translated_content": "string"}
/summarize_as_mermaidPOSTSummarize content as a Mermaid mindmap.{"content": "string", "target_language": "string", "cancelled": "boolean"}{"mermaid_summary": "string"}
/generate_diagramPOSTCanonical diagram generation endpoint.{"content": "string", "diagram_intent": "string", "target_language": "string", "compatibility_mode": "string", "cancelled": "boolean"}{"diagram": "string"}
/generate_experimental_diagramPOSTLegacy compatibility alias for diagram generation.{"content": "string", "diagram_intent": "string", "target_language": "string", "cancelled": "boolean"}{"diagram": "string"}
/preview_diagramPOSTCanonical preview diagram endpoint (no file side effects).{"content": "string", "diagram_intent": "string", "target_language": "string", "compatibility_mode": "string", "cancelled": "boolean"}{"diagram": "string"}
/preview_experimental_diagramPOSTLegacy preview alias for compatibility.{"content": "string", "diagram_intent": "string", "target_language": "string", "cancelled": "boolean"}{"diagram": "string"}
/extract_conceptsPOSTExtract deduplicated core concept list.{"content": "string", "cancelled": "boolean"}{"concepts": ["..."]}
/extract_original_textPOSTExtract verbatim matches for user input from reference content.{"reference_content": "string", "user_input": "string", "cancelled": "boolean"}{"extracted_text": "string"}
/check_duplicatesPOSTReturn normalized duplicate terms detected in content.{"content": "string"}{"duplicates": ["..."], "count": 0}
/handle_file_renamePOSTUpdates all backlinks in the vault when a file is renamed.{"old_path": "string", "new_path": "string"}{"status": "success"}
/handle_file_deletePOSTRemoves all backlinks to a file that has been deleted.{"path": "string"}{"status": "success"}
/batch_fix_mermaidPOSTScans a folder and corrects common Mermaid.js and LaTeX syntax errors in .md files.{"folder_path": "string"}{"errors": [], "modified_count": "integer"}
/healthGETA simple health check to confirm the server is running.(None){"status": "ok"}

Release (npm + PyPI)

Use this one-line command to bump one shared version and publish both npm and PyPI in sync:

npm run release:sync-publish -- 0.6.1

Dry-run (no publish):

npm run release:sync-publish -- 0.6.1 --dry-run

Notes:

  • The command updates npm version (package.json + package-lock.json), and syncs Python/server versions in setup.py, main.py, and cli.js.
  • Make sure npm auth is ready (npm login or NPM_TOKEN) and PyPI auth is ready (~/.pypirc or TWINE_USERNAME + TWINE_PASSWORD).
  • It builds Python artifacts and runs twine check before upload.