Skip to main content

Local Memory Hub MCP Server with stdio transport for ZenCoder and MCP clients

Project description

Memory Hub MCP Server (UV/UVX)

A local memory hub for AI agents with MCP integration, designed for ZenCoder and other MCP clients using stdio transport.

Quick Start with UVX

Installation & Usage

# Install and run directly with uvx
uvx memory-hub-mcp

# Or install locally first
uv pip install memory-hub-mcp
memory-hub-mcp

For ZenCoder Integration

In ZenCoder's custom MCP server configuration, you must now provide the URLs for the dependent services (Qdrant and LM Studio).

Command: uvx

Arguments:

[
    "memory-hub-mcp",
    "--qdrant-url",
    "http://<ip_address_of_qdrant>:6333",
    "--lm-studio-url",
    "http://<ip_address_of_lm_studio>:1234/v1"
]

Note: Replace <ip_address_...> with the actual IP addresses where your services are running. If they are on the same machine, the IP will be the same for both.

Development Setup

# Clone and setup
git clone <your-repo>
cd memory-hub
uv venv
source .venv/bin/activate
uv pip install -e .

# Run in development
memory-hub-mcp --log-level DEBUG --qdrant-url http://localhost:6333 --lm-studio-url http://localhost:1234/v1

Publishing to PyPI

To publish a new version of the package to PyPI:

  1. Update the Version: Increment the version number in pyproject.toml. PyPI does not allow re-uploading the same version.

    # pyproject.toml
    [project]
    name = "memory-hub-mcp"
    version = "0.1.2" # Increment this
    
  2. Clean and Rebuild: Remove old builds and create the new distributions.

    rm -rf dist/
    uv build
    
  3. Publish with an API Token:

    The recommended way to publish is to use a PyPI API token. You can provide it directly to the command via an environment variable for security.

    # Replace <your_pypi_token> with your actual token
    UV_PUBLISH_TOKEN=<your_pypi_token> uv publish dist/*
    

Available Tools

  • add_memory: Store content with hierarchical metadata (app_id, project_id, ticket_id)
  • search_memories: Semantic search with keyword enhancement and LLM synthesis
  • get_project_memories: Retrieve ALL memories for a specific app_id/project_id without search queries
  • update_memory: Update existing memories with automatic version incrementing
  • get_recent_memories: Retrieve memories from the last N hours (perfect for resuming work)
  • list_app_ids: List all application IDs
  • list_project_ids: List all project IDs
  • list_ticket_ids: List all ticket IDs
  • list_memory_types: List memory types currently in use (with counts and metadata)
  • get_memory_type_guide: Get the recommended memory type conventions
  • health_check: Server health status

Configuration

The server expects:

  • Qdrant: Vector database running (see docker-compose.yml)
  • LM Studio: For embeddings and chat completions
  • Environment: Standard .env configuration

Key File & Directory Locations

  • pyproject.toml: Defines project metadata, dependencies, and the memory-hub-mcp script entry point.
  • src/memory_hub/: The main Python package source code.
  • src/memory_hub/cli.py: The command-line interface logic that launches the server.
  • src/memory_hub/mcp_server.py: Core stdio server implementation and tool registration.
  • src/memory_hub/core/handlers/: Contains the implementation for each MCP tool (e.g., add_memory, search_memories).
  • src/memory_hub/core/services.py: Handles communication with external services like Qdrant and LM Studio.
  • src/memory_hub/core/models.py: Pydantic models defining the data structures used throughout the application.
  • docker-compose.yml: Defines the Qdrant service dependency.

Architecture

  • stdio transport: Direct MCP protocol communication
  • No HTTP dependencies: Lightweight, focused on MCP clients
  • Hierarchical memory: Flexible app/project/ticket organization
  • Hybrid search: Vector similarity + keyword matching + LLM synthesis
  • Version management: Automatic versioning for memory updates
  • Time-based retrieval: Query recent memories by hours

Agent Usage Guide

Saving Agent Progress

# Save initial work
add_memory(
    content="Implemented user authentication with JWT tokens...",
    metadata={
        "app_id": "eatzos",
        "project_id": "next",
        "type": "feature_implementation"
    }
)

# Update existing memory
update_memory(
    app_id="eatzos",
    project_id="next", 
    memory_type="feature_implementation",
    new_content="Completed authentication with JWT tokens and added refresh token logic..."
)

Resuming Agent Work

# Get ALL context for a project (no search guessing!)
get_project_memories(
    app_id="eatzos",
    project_id="next",
    limit=50
)

# See what changed recently
get_recent_memories(
    app_id="eatzos",
    hours=24,
    include_summary=True
)

Differences from HTTP Version

This UV/UVX version:

  • ✅ Uses stdio transport (ZenCoder compatible)
  • ✅ No FastAPI dependencies
  • ✅ Lightweight packaging
  • ✅ Direct MCP protocol
  • ❌ No web interface
  • ❌ No HTTP endpoints

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memory_hub_mcp-1.3.1.tar.gz (82.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memory_hub_mcp-1.3.1-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file memory_hub_mcp-1.3.1.tar.gz.

File metadata

  • Download URL: memory_hub_mcp-1.3.1.tar.gz
  • Upload date:
  • Size: 82.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for memory_hub_mcp-1.3.1.tar.gz
Algorithm Hash digest
SHA256 12879c40afb7c7747e58f1e40cc2c585559c9d052d18e503d074fa0a5807e755
MD5 a345e1eb9b9d9a494e706aeda2818972
BLAKE2b-256 9d05c1d423c60622ebdf84775b67e768536d6057e3f6ff7c9920c94f8b9be2c5

See more details on using hashes here.

File details

Details for the file memory_hub_mcp-1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for memory_hub_mcp-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1142e7469576b7e9b1bff55bfe90af3f1a51648032ac510f1bade767a856f808
MD5 dde2d2e1d5106d6bba480e2a26ecea99
BLAKE2b-256 d2499a72aeb14da6c64b0062ee3319accf5c9ec5569bdedfa8e89160ea92f5a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page