Skip to content
MCP server
Registry

th-memory-mcp MCP Server

Local long-term memory MCP server (SQLite) for AI coding agents — OpenCode, Claude Code, Cursor

th-memory-mcp scores 46 (Fair), licensed MIT and written in JavaScript. It installs as a local process. It does not declare tools yet. Filed under Databases, AI and memory. GitHub shows 4 stars. Package registries report about 178 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.

by worakorn-princeMITJavaScript4 stars
Trust score
46Fair
Trust score 46 of 100, Fair

Fair trust

46 of 100 from six public signals. Nobody can buy a point.

  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 46 comes from

0 + 20 + 5 + 10 + 4 + 7 = 46. Each factor is capped, so no single signal can carry a listing.

Registry0 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 0 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity5 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 5 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs7 / 10

A real summary, a README with depth, listed tools.

Docs: 7 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "worakorn-prince-th-memory-mcp": {      "command": "npx",      "args": [        "-y",        "th-memory-mcp@2.5.2"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.

About

npm version npm downloads License: MIT Node CI

Listed on mcpservers.org Glama score mcprush Audited by AddonAudit

th-memory-mcp

Local-first memory for AI coding agents, over MCP. One SQLite file remembers your preferences, lessons, decisions and project context, then hands the right slice back to the agent before each task. Hybrid FTS5 + local vectors, Thai/English aware, no cloud, no API keys.

What you get

🧠 16 MCP toolsremember, recall, get_context, get_profile, save_lesson, consolidate, link_memory, merge_memory, update_memory, forget, search_history, get_recent_interactions, memory_stats, export_memory, import_memory, extract_memories
🔎 Hybrid retrievalFTS5 (Thai word-segmented, tone-tolerant) fused with 512-dim local vectors via RRF, then rescored by confidence, importance, recency and scope
🕰 Temporal + conflict-awarevalidity windows, supersession chains, duplicate/contradiction classification; ambiguous evidence is preserved, never silently destroyed
🔌 Works with your harnessOpenCode plugin with background capture; Claude Code hooks; Codex, Cursor, Qwen Code, DeepSeek Harness via MCP
🔐 Opt-in securityRBAC over every tool, identity-derived scope isolation with grants, a content-free audit_log, whole-DB SQLCipher encryption with rotation/backups/drills, and per-user capture attribution
📴 Offline by defaultno network calls, no accounts, no API keys — the database is a single local file

Performance

Measured with the internal harness on one machine, seed 42; profile normal = 20,000 memories / 5,000 queries. Each cell shows the latest three runs, oldest → newest.

metric2.5.13.0.03.0.1
insert throughput (mem/s)352.6 / 331.9 / 320.5331.7 / 277.4 / 361.5348.0 / 337.4 / 352.9
retrieve @20k (ms)103.9 / 106.2 / 90.375.8 / 87.2 / 82.276.7 / 74.4 / 73.5
get_context @20k (ms)102.5 / 116.5 / 86.270.3 / 70.7 / 80.570.5 / 68.5 / 69.5
recall p95 (ms)1.00 / 2.00 / 1.001.00 / 2.00 / 1.002.00 / 2.00 / 1.00
DB size (MB)101.1 / 101.1 / 101.1101.1 / 101.3 / 100.7100.7 / 100.7 / 100.7

Observation: v3.0.x retrieve / get_context took ~68–87 ms vs ~86–116 ms for 2.5.1; peak RSS was higher (quick ~262–306 MB vs ~110–199 MB; normal ~432 MB vs ~113–203 MB). The auth/encryption modules and native better-sqlite3-multiple-ciphers coincide with the increase, but these runs do not isolate which component consumed the extra memory.

Full performance history, three-run tables, and quality gates → docs/PERFORMANCE.md

Install in 60 seconds

git clone https://github.com/worakorn-prince/th-memory-mcp.git
cd th-memory-mcp && npm install && npm run build

# one DB shared by the server and the plugin
setx MEMORY_DB_PATH "%CD%\data\memory.db"          # Windows
# export MEMORY_DB_PATH="$PWD/data/memory.db"      # macOS/Linux (add to your shell profile)

Then register the MCP server with the ready-made block in setup/opencode.example.json (or run npm run quickstart). Optional agent rules: setup/AGENTS.memory.example.md.

Documentation

TopicWhere
Full documentation — requirements, architecture, every tool, the CLI, daily usagedocs/Docs.md
Full documentation (ไทย)docs/Docs.th.md
Authentication, RBAC and scope isolationdocs/Docs.md § Authentication
Encryption at rest, key rotation, backup / verify / restore / drilldocs/Docs.md § Encryption
Threat model and residual risksSECURITY.md
Upgrade from 2.xMIGRATION_v3.md
Performance measurementsdocs/PERFORMANCE.md
Thai search internals (reusable module)docs/thai-fts.md
ChangelogCHANGELOG.md

Harness setup

HarnessGuide
OpenCodesetup/opencode.example.json + npm run quickstart
Claude Codesetup/CLAUDE_CODE_HOOKS.md
Codexsetup/CODEX_SETUP.md
Cursorsetup/CURSOR_SETUP.md
Qwen Codesetup/QWEN_SETUP.md
DeepSeek Harnesssetup/DSH_SETUP.md

Security in one paragraph

With no environment variables set, the server behaves exactly like 2.5.x: no auth, plaintext database, no extra I/O. Security is opt-in and independent: MEMORY_AUTH=on adds a verified identity, a single role gate over all 16 tools, identity-derived scope isolation with explicit grants, and an audit_log; MEMORY_ENCRYPTION=on encrypts the whole database (SQLCipher via better-sqlite3-multiple-ciphers) and adds db rekey, db verify-backup, db restore and db drill. Details, threat model and residual risks: SECURITY.md.

License

MIT © 2026 worakorn-prince

Frequently asked questions

What is th-memory-mcp MCP Server?

Local long-term memory MCP server (SQLite) for AI coding agents — OpenCode, Claude Code, Cursor

How do I install th-memory-mcp MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. th-memory-mcp MCP Server runs locally from the npm package th-memory-mcp with the command npx -y th-memory-mcp@2.5.2.

Is th-memory-mcp MCP Server free and open source?

Yes. th-memory-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does th-memory-mcp MCP Server support remote (HTTP) connections?

No remote endpoint is listed for th-memory-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.

How is th-memory-mcp MCP Server's trust score calculated?

th-memory-mcp MCP Server scores 46 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server