Skip to main content

hugo-memex

MCP server that makes any Hugo site's content queryable via SQLite with FTS5 full-text search.

Your Hugo blog is ground truth. hugo-memex indexes it into a SQLite cache with full-text search, taxonomy queries, and JSON front matter extraction : then exposes it via MCP so AI assistants can query, search, and create content.

Install

pip install hugo-memex

Quick Start

# Configure
mkdir -p ~/.config/hugo-memex
cat > ~/.config/hugo-memex/config.yaml << 'EOF'
hugo_root: ~/path/to/your/hugo-site
database_path: ~/.config/hugo-memex/hugo.db
EOF

# Index your site
hugo-memex index

# Query it
hugo-memex search "machine learning"
hugo-memex sql "SELECT title, section, date FROM pages ORDER BY date DESC LIMIT 10"
hugo-memex stats

MCP Integration

Add to your .mcp.json for Claude Code:

{
  "mcpServers": {
    "hugo-memex": {
      "command": "python",
      "args": ["-m", "hugo_memex", "mcp"],
      "env": {
        "HUGO_MEMEX_CONFIG": "/path/to/config.yaml"
      }
    }
  }
}

Tools

Tool Purpose
execute_sql Read-only SQL with ~10 exemplar queries in the docstring
get_pages Bulk content retrieval : filter by section, tag, FTS search, paths
get_content Raw markdown from filesystem for a single file
create_page Create new content with proper leaf bundle structure
update_page Merge front matter / replace body on existing pages
suggest_tags FTS5-based tag suggestions with canonical casing
get_front_matter_template Derive section conventions from actual data
validate_page Check completeness, tag consistency, cross-references
rebuild_index Incremental re-sync after content changes

Resources

Resource Purpose
hugo://schema Full DDL + relationship docs + query patterns
hugo://site Hugo site config (hugo.toml) as JSON
hugo://stats Aggregate stats for quick orientation

Architecture

  • DB is a read-only cache : Hugo content files are ground truth
  • Generic schema : JSON front_matter column, no per-content-type tables
  • Taxonomies auto-discovered from hugo.toml
  • Incremental sync via SHA-256 content hash + file mtime
  • FTS5 with porter stemming + unicode61 tokenizer
  • SQLite authorizer enforces read-only (not bypassable via PRAGMA)
  • Raw sqlite3 : no ORM. WAL mode, foreign keys.

Configuration

# ~/.config/hugo-memex/config.yaml
hugo_root: ~/github/repos/my-hugo-site   # contains hugo.toml + content/
database_path: ~/.config/hugo-memex/hugo.db

Environment variable overrides: HUGO_MEMEX_CONFIG, HUGO_MEMEX_HUGO_ROOT, HUGO_MEMEX_DATABASE_PATH.

License

MIT

Release files for hugo-memex 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hugo-memex 0.1.0
File Size Uploaded
hugo_memex-0.1.0.tar.gz 33.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hugo-memex 0.1.0
File Interpreter ABI Platform
hugo_memex-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 57.9 kB

Release files / hugo_memex-0.1.0.tar.gz

Download URL hugo_memex-0.1.0.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8dcf79f6564a9328b9df65bbb5844e582dc257c677ade68e21c3a83a74532022
BLAKE2b-256 checksum
How to use checksums
e0f081a4c95ec73a895db97face947efbf9baad83493e05e262664a57e6211fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / hugo_memex-0.1.0-py3-none-any.whl

Download URL hugo_memex-0.1.0-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07bcb5b7dd1f25ca461c6d2281c844b58345485fef9bf97ffd1410fc3e658306
BLAKE2b-256 checksum
How to use checksums
a2680a28a3864a0dc463c43bcada85750ac148b515e17ef7e7f4fa1bbcfd9d98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page