GitHunt
AX

Axle-Bucamp/MCP-Docusaurus

an MCP tool for Docusorus agent system. Usefull to make git doc with human interaction.

๐Ÿง  MCP Docusaurus Toolkit

A modular Content Management Platform (MCP) to manage, embed, and search Docusaurus documentation using FastAPI, self-hosted embeddings, and PostgreSQL + pgvector.


๐Ÿš€ Features

  • ๐Ÿ“ Auto-generate site map from Docusaurus docs
  • ๐Ÿ“ Create, update, and continue editing Markdown docs
  • ๐Ÿง  Vectorize content using pluggable embedding models
  • ๐Ÿ” Perform RAG-style semantic search across the docs
  • ๐Ÿงพ Track incomplete docs with watermarks
  • ๐Ÿ”„ Sync external edits into the vector database
  • ๐ŸŽจ Apply style/theme transformations to docs
  • ๐Ÿงช Built-in tool decorators for AI agent control

๐Ÿ“‚ Project Structure


.
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ main.py             # FastAPI entrypoint with FastMCP + tools
โ”‚   โ”œโ”€โ”€ routes/             # Modular endpoints (docs, search, styles, site\_map)
โ”‚   โ”œโ”€โ”€ embeddings/         # Embedding model configuration + logic
โ”‚   โ”œโ”€โ”€ database.py         # PostgreSQL + pgvector connection logic
โ”‚   โ”œโ”€โ”€ models/             # DB + Pydantic models for documents
โ”‚   โ”œโ”€โ”€โ”€ utils/              # Sync tools, helpers
โ”‚   โ””โ”€โ”€ docs/             # Full editable Docusaurus source (used in dev mode)
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ docusaurus/         # Runtime-synced Markdown docs
โ”‚   โ””โ”€โ”€ embeddings/         # Persisted vector embeddings
โ”‚
โ”œโ”€โ”€ Dockerfile              # Multi-stage (Node + Python)
โ”œโ”€โ”€ docker-compose.yml      # Services: FastAPI, Docusaurus Dev, Postgres
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md


๐Ÿณ Getting Started (Docker)

# 1. Clone this repository
git clone https://github.com/your-org/mcp-docusaurus.git
cd mcp-docusaurus

# 2. Launch services
docker compose up --build

๐Ÿงฐ Tooling Overview (MCP API)

โž• Create a New Document

POST /tool/create_document
{
  "path": "guides/new-feature.md",
  "title": "New Feature",
  "content": "## Work in Progress..."
}

โœ๏ธ Update Existing Document

POST /tool/update_docs
{
  "path": "guides/new-feature.md",
  "line_begin": 10,
  "line_end": 15,
  "new_text": "Updated explanation here."
}

๐Ÿง  Vector Search (RAG-Style)

POST /tool/search_docs
{
  "query": "How to authenticate a plugin?"
}

๐ŸŽจ Apply CSS or Theme Style

POST /tool/apply_style
{
  "style_id": "dark-theme",
  "content": "..."
}

๐Ÿ”Œ Embedding Model Support

Pluggable embedding model backend with simple config.

โœ… Local (Default)

  • sentence-transformers/all-MiniLM-L6-v2

๐ŸŒ Optional Remote Support

  • OpenAI Embeddings (requires API key)

โš™๏ธ Environment Configuration

Use .env file or Docker environment: block:

PG_HOST=postgres
PG_USER=postgres
PG_PASSWORD=postgres
PG_DATABASE=vector_db
EMBEDDING_MODEL=local

๐Ÿ” Security

  • ๐Ÿ”’ Tool routes are gated with @tool decorators
  • โœ๏ธ Document writes are verified before embedding
  • ๐Ÿ”‘ Optional OAuth2 / API Token guardrails available

๐Ÿ“˜ Docusaurus Notes

  • The doc/ directory holds the full Docusaurus source (used for live editing).
  • The data/docusaurus/ directory contains generated Markdown synced with the vector database.

๐Ÿ“Š Metrics & Health

  • GET /tool/health_check โ€“ Check if the API is alive
  • GET /tool/metrics โ€“ Prometheus/Grafana-compatible stats

๐Ÿ“ License

MIT License ยฉ๏ธ [guidry company]

Axle-Bucamp/MCP-Docusaurus | GitHunt