@mporenta/mg

Agent-friendly CLI and Pi extension for memory-graph-mcp

Packages

Package details

extension

Install @mporenta/mg from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@mporenta/mg
Package
@mporenta/mg
Version
0.1.2
Published
May 24, 2026
Downloads
453/mo · 11/wk
Author
pi-porenta
License
MIT
Types
extension
Size
87 KB
Dependencies
2 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/memory-graph-extension.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

mg

Agent-friendly CLI for the memory-graph-mcp FastAPI surface.

# Install the CLI only.
npm i -g @mporenta/mg

# Install the CLI package as a Pi user-level package; this loads the bundled memory-graph Pi extension.
pi install npm:@mporenta/mg

export MEMORY_GRAPH_URL=http://localhost:8000
mg config doctor

Data is written to stdout; diagnostics are written to stderr. JSON is emitted by default when stdout is not a TTY. Use --format pretty for human-readable output.

Search recipes

All search subcommands require --query and return JSON-friendly results with diagnostics and next_steps hints.

# Discover candidate entities before narrowing context.
mg search entities --query "memory graph" --limit 5

# Recall repo-scoped codebase context with paths and observation IDs.
mg search codebase --query "search diagnostics" --repo memory-graph-mcp --limit 5

# Pass an embedding vector when a caller can produce one for hybrid ranking.
mg search codebase --query "ranking" --repo memory-graph-mcp --query-embedding 0.1,0.2,0.3

# Follow up on exact observations for a known entity.
mg search memory --query "noise_floor" --entity "memory-graph-mcp" --limit 5

context-mode bridge

mg ctx index-recall sends a memory-graph recall block to context-mode's ctx_index tool so it becomes searchable through ctx_search.

mg ctx index-recall --source memory-graph-recall --file recall.md
printf '%s\n' '# [memory-graph-recall]' 'Relevant project memories...' | mg ctx index-recall

# Advanced: point at a specific context-mode MCP server entrypoint or wrapper.
mg ctx index-recall --content 'Relevant project memories...' --server-bundle /path/to/server.bundle.mjs --timeout-ms 10000
mg ctx index-recall --content 'Relevant project memories...' --command 'node /path/to/server.bundle.mjs'