Skip to main content
Glama

claude-legal-persistent-memory-pl

MCP server providing persistent memory for AI legal assistants — remember facts between sessions, recall them with full-text search. Built for Polish law practice, works with any Claude deployment.

Part of the KTZR AI ecosystem.

⚠️ Security — protect your endpoint

Never expose this server without authentication. The /mcp endpoint gives any caller full read/write access to your memory database (client data, negotiation positions, case facts).

Recommended guards — pick one or combine:

Method

How

Secret token in URL

Deploy behind a reverse proxy that requires /mcp/<secret> and strips it before forwarding

IP allowlist

Cloud Run → --ingress=internal-and-cloud-load-balancing + Cloud Armor policy

VPC + IAP

Route through Identity-Aware Proxy; requires Google account auth

Cloud Run auth

Remove --allow-unauthenticated; use Authorization: Bearer $(gcloud auth print-identity-token) in the MCP connector

This repo ships with no auth by default (URL obscurity only) — suitable for local/testing use. Add a guard before any production deployment.


Related MCP server: @contextable/mcp

Tools

Tool

Description

remember(content, category, case_ref?, tags?)

Store a note in long-term memory

recall(query, category?, case_ref?, limit?)

Full-text AND search across stored notes

list_categories()

Summary of stored notes by category

Categories: klient · negocjacje · klauzule · ryzyka · precedensy · misc

Quick start (local, SQLite)

pip install .
legal-memory          # starts stdio transport — no server, no auth needed

Add to Claude Code (~/.claude/mcp.json):

{
  "legal-memory": {
    "type": "stdio",
    "command": "legal-memory"
  }
}

Local stdio mode never exposes a network port — no auth required.

Cloud Run deployment

# Build and deploy
gcloud run deploy claude-legal-memory \
  --source . \
  --region europe-west4 \
  --set-env-vars DATABASE_URL="postgresql+asyncpg://user:pass@/db?host=/cloudsql/project:region:instance" \
  --allow-unauthenticated   # ← add a guard here in production

# Connect Claude Code
# .claude/mcp.json:
# {
#   "legal-memory": {
#     "type": "http",
#     "url": "https://<your-cloud-run-url>/mcp"
#   }
# }

Configuration

Env var

Default

Description

DATABASE_URL

sqlite+aiosqlite:///legal_memory.db

Database connection string

PORT

8080

HTTP port (Cloud Run sets this automatically)

The server auto-detects the transport:

  • K_SERVICE or PORT set → streamable-http (Cloud Run / remote)

  • Neither set → stdio (local — recommended for single-user setups)

Database

Works with SQLite (local, zero config) and PostgreSQL (production).

Backend

URL format

SQLite

sqlite+aiosqlite:///legal_memory.db

PostgreSQL

postgresql+asyncpg://user:pass@host/dbname

Cloud SQL

postgresql+asyncpg://user:pass@/dbname?host=/cloudsql/project:region:instance

  • commercial-legal-pl — Polish commercial law skill for Claude (uses this server for persistent memory)

  • legal-cite-pl — MCP server for verifying Polish & EU legal citations

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A lightweight server that provides persistent memory and context management for AI assistants using local vector storage and database, enabling efficient storage and retrieval of contextual information through semantic search and indexed retrieval.
    Last updated
    2
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A persistent AI memory server that enables storage and retrieval of context and project artifacts across conversations. It features full-text search, version history, and automatic content chunking using local SQLite or hosted cloud storage.
    Last updated
    31
    Apache 2.0
  • A
    license
    -
    quality
    C
    maintenance
    A persistent memory server that stores and retrieves atomic coding insights like architectural decisions and debugging patterns for AI agents. It enables agents to maintain institutional knowledge across sessions using semantic search and local SQLite storage.
    Last updated
    32
    10
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    A persistent long-term memory server for AI assistants that enables storing and recalling solutions, facts, and decisions with intelligent confidence tracking and relationship mapping. It allows developers to build a cross-platform knowledge base that integrates seamlessly with IDEs and CLI agents.
    Last updated
    17
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • Persistent memory for AI agents. Search, store, and recall across sessions.

  • Persistent memory for AI agents — verbatim conversations, searchable by meaning.

  • Long-term memory for AI assistants. Hybrid retrieval, query expansion, auto-topics.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/apiotrowski-afk/ktzr-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server