Smriti MCP

Smriti MCP

A portable memory server for MCP that stores durable memories as markdown files, enabling AI agents to create, search, and organize persistent knowledge.

Category
访问服务器

README

Smriti MCP

A portable memory server for AI agents, built for the Model Context Protocol (MCP).

PyPI version Python 3.10+ Tests

Smriti stores durable memories as plain markdown files with YAML frontmatter. This keeps your data readable, git-friendly, and easy to inspect outside any single agent runtime.

Features

  • Framework agnostic: Works with any MCP-compatible agent (Claude, OpenAI, local models, etc.)
  • Durable & portable: All memories stored as plain markdown files—no database required
  • Git-friendly: Version control your memories alongside your code
  • Search & filter: Full-text search, filtering by tags, categories, and status
  • Relationship tracking: Use [[wikilinks]] to connect related memories
  • Memory index: Auto-generate markdown indexes of your entire memory store
  • Archive & organize: Hierarchical organization with categories and status tracking

Installation

From PyPI

pip install smriti-mcp

From source

git clone https://github.com/deepak-bhardwaj-ps/smriti-mcp.git
cd smriti-mcp
pip install -e .

Quick Start

1. Run the server locally

smriti-mcp server --memory-root ~/.smriti/memory

By default, Smriti uses ~/.smriti/memory. You can override it with:

export SMRITI_MEMORY_ROOT="$HOME/.smriti/memory"
smriti-mcp server

2. Configure in your MCP client

Claude Desktop (~/.config/claude_desktop_config.json):

{
  "mcpServers": {
    "smriti": {
      "type": "stdio",
      "command": "smriti-mcp",
      "args": ["server", "--memory-root", "~/.smriti/memory"]
    }
  }
}

Then restart Claude Desktop and Smriti will be available as a tool.

Available Tools

Core Operations

Tool Description
create_memory Create a new durable markdown memory with metadata
get_memory Retrieve a memory by ID and return its full content
append_memory Add content to the end of an existing memory
update_memory Patch metadata or replace memory content
delete_memory Permanently remove a memory

Search & Browse

Tool Description
search_memory Full-text search across title, tags, categories, and body. Returns ranked results
list_memories Browse memory metadata without loading full content. Filter by status, category, tags

Organization

Tool Description
archive_memory Mark a memory as archived (soft delete)
build_memory_index Generate a markdown index of all memories for easy browsing
rebuild_memory Fix frontmatter, apply/normalize wikilinks from titles and aliases, and rebuild indexes
load_memory_index Load the generated index as markdown

Memory Format

Each memory is stored as a markdown file with YAML frontmatter:

---
id: project/Example Architecture Decision
title: Example Architecture Decision
category: project
tags:
  - architecture
  - decision
status: active
short_description: Decided to use async/await pattern
created_at: "2026-06-05T10:30:00+10:00"
updated_at: "2026-06-05T10:30:00+10:00"
---

## Background

We needed to handle concurrent requests efficiently.

## Decision

Use async/await with asyncio for I/O-bound operations.

## Consequences

- Improved throughput for concurrent operations
- Need to manage event loop carefully in multi-threaded contexts

See also: [[Async Migration]], [[Performance Metrics]]

Metadata Fields

  • id: Unique identifier (auto-generated from category + title, or custom)
  • title: Human-readable title
  • category: Organizational category (becomes directory in file structure)
  • tags: Array of searchable tags
  • status: active, archived, or custom status
  • short_description: Brief summary (used in indexes)
  • created_at: ISO 8601 timestamp
  • updated_at: ISO 8601 timestamp

File Structure

~/.smriti/memory/
├── project/
│   ├── Example Architecture Decision.md
│   ├── Async Migration.md
│   └── Performance Metrics.md
├── research/
│   └── LLM Benchmarks.md
├── decisions/
│   └── Use Postgres.md
└── index.md

Smriti keeps default filenames aligned with memory titles so Obsidian-style wikilinks like [[API Rate Limiting Strategy]] resolve to API Rate Limiting Strategy.md.

When you run rebuild_memory, Smriti can automatically add missing wikilinks and normalize alias links. It matches longer titles and aliases first and only links whole phrases, so Durable Memory is preferred over durable, and able is not linked inside durable.

Usage Examples

Create a memory

from smriti_mcp.store import MemoryStore

store = MemoryStore("~/.smriti/memory")

result = store.create_memory(
    {
        "title": "API Rate Limiting Strategy",
        "category": "decisions",
        "tags": ["api", "performance"],
        "short_description": "Decided on sliding window rate limiting",
    },
    content="We chose sliding window over token bucket because...",
)

# Returns: {"id": "decisions/API Rate Limiting Strategy", ...}

Search memories

results = store.search_memory(
    query="rate limiting",
    include_content=False,  # Just metadata
)

for result in results:
    print(f"{result['id']}: {result['title']}")

List memories with filters

active_decisions = store.list_memories(
    status="active",
    category="decisions",
)

for memory in active_decisions:
    print(f"{memory['title']} ({memory['status']})")

Rebuild and repair memories

result = store.rebuild_memory(
    fix_frontmatter=True,
    apply_wikilinks=True,
    group_by_category=True,
)

print(result["wikilinks"]["links_added"])

Running Tests

# Install test dependencies
pip install -e ".[dev]"

# Run all tests
pytest tests/ -v

# Run integration tests only
pytest tests/test_smriti_mcp_integration.py -v

All tests pass, including full MCP stdio round-trip integration tests.

Architecture

  • MemoryStore: Core storage engine with markdown file I/O
  • Server: MCP server exposing tools to agents
  • CLI: Command-line interface for running the stdio server
  • Frontmatter: YAML metadata parsing and generation

The package has zero external database dependencies and works with Python 3.10+.

Roadmap

  • [ ] Web UI for browsing memories
  • [ ] Multi-user support with authentication
  • [ ] Memory graph visualization
  • [ ] Sync to cloud storage (S3, GCS)
  • [ ] Memory embeddings for semantic search

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Add tests for new functionality
  4. Ensure all tests pass (pytest tests/ -v)
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Author

Created by Deepak Bhardwaj.

See Also

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选