Skip to main content

Model Context Protocol server for Project Sekha - Persistent AI Memory Controller (v2.0 multi-provider compatible)

Project description

Sekha MCP Server

Model Context Protocol Server for Sekha Memory

License: AGPL v3 CI Status codecov Python PyPI


๐Ÿ†• v0.2.0 Release - Multi-Provider Support

Sekha MCP v0.2.0 is now compatible with the new Sekha v0.2.0 multi-provider architecture!

What's New:

  • โœ… Works with Sekha v0.2.0 controller's multi-provider routing
  • โœ… Automatic provider fallback (Ollama, OpenAI, Anthropic, etc.)
  • โœ… Vision support (GPT-4o, Kimi 2.5) - just include images!
  • โœ… Cost-aware model selection
  • โœ… Multi-dimensional embeddings (per-dimension ChromaDB collections)
  • โœ… Claude Desktop & Claude Code support - memory in both apps!
  • โœ… No API changes - fully backward compatible!

What is Sekha MCP?

MCP (Model Context Protocol) server that exposes Sekha memory tools to any MCP-compatible client:

  • โœ… Claude Desktop - Anthropic's desktop app
  • โœ… Claude Code - VS Code extension (works with Ollama, Anthropic, or any provider)
  • โœ… Any MCP client - Standard protocol implementation

Supported Tools:

  • โœ… memory_store - Save conversations
  • โœ… memory_search - Semantic search
  • โœ… memory_get_context - Retrieve relevant context
  • โœ… memory_update - Update conversation metadata
  • โœ… memory_prune - Get cleanup recommendations
  • โœ… memory_export - Export your data
  • โœ… memory_stats - View usage statistics

Total: 7 MCP tools


๐Ÿ“š Documentation

Complete guide: docs.sekha.dev/integrations/mcp


๐Ÿš€ Quick Start

1. Install Sekha

# Deploy Sekha v0.2.0 stack with multi-provider support
git clone https://github.com/sekha-ai/sekha-docker.git
cd sekha-docker
docker compose -f docker/docker-compose.prod.yml up -d

2. Configure Your MCP Client

Option A: Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "sekha": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--network=host",
        "ghcr.io/sekha-ai/sekha-mcp:v0.2.0"
      ],
      "env": {
        "CONTROLLER_URL": "http://localhost:8080",
        "CONTROLLER_API_KEY": "your-mcp-api-key-here"
      }
    }
  }
}

Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json

Option B: Claude Code (VS Code Extension)

Add to VS Code settings.json or workspace config:

{
  "mcpServers": {
    "sekha": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--network=host",
        "ghcr.io/sekha-ai/sekha-mcp:v0.2.0"
      ],
      "env": {
        "CONTROLLER_URL": "http://localhost:8080",
        "CONTROLLER_API_KEY": "your-mcp-api-key-here"
      }
    }
  }
}

Claude Code Configuration:

Claude Code lets you choose your LLM provider separately from memory:

{
  // Sekha provides memory (via MCP)
  "mcpServers": {
    "sekha": { /* config above */ }
  },
  
  // Configure your LLM provider (Claude Code supports multiple)
  "claudeCode.apiProvider": "ollama",  // or "anthropic"
  "claudeCode.ollamaUrl": "http://localhost:11434",
  "claudeCode.ollamaModel": "llama3.1:8b"
}

This means:

  • Use Ollama (or other LLM) locally for generation (fast, private, free)
  • Use Sekha MCP for memory (persistent across sessions)
  • Best of both worlds!

3. Restart Your Client

  • Claude Desktop: Restart the app
  • Claude Code: Reload VS Code window (Cmd+Shift+P โ†’ "Reload Window")

Sekha memory tools will now appear!

See setup guides:


๐ŸŽฏ Use Cases

Claude Desktop - Interactive Conversations

  • Full-featured desktop app with Sekha memory
  • Perfect for brainstorming, research, general chat
  • Uses Anthropic's Claude models

Claude Code - Development Workflow Examples

  • VS Code extension with code-aware features
  • Use with Ollama for fast, local, private coding
  • Or use with Anthropic/OpenAI for powerful cloud models
  • Sekha memory works with any provider you configure

API Integration - Programmatic Access

  • Use sekha-proxy for OpenAI-compatible API
  • Multi-provider routing via LLM bridge
  • Same memory as Claude apps

๐Ÿ”ง Development

# Clone
git clone https://github.com/sekha-ai/sekha-mcp.git
cd sekha-mcp

# Install
pip install -e .

# Run locally
python -m sekha_mcp

# Test
pytest

๐Ÿ“š MCP Tools Reference

memory_store

Store a conversation in Sekha.

Parameters:

  • label (string) - Conversation label
  • messages (array) - Message array (supports images in v0.2.0!)
  • folder (string, optional) - Organization folder
  • importance (int, optional) - 1-10 scale

memory_search

Search conversations semantically.

Parameters:

  • query (string) - Search query
  • limit (int) - Max results
  • folder (string, optional) - Search within folder

memory_get_context

Assemble optimal context for LLM.

Parameters:

  • query (string) - Context query
  • context_budget (int) - Token limit
  • folders (array, optional) - Limit to specific folders

memory_update

Update conversation metadata.

Parameters:

  • conversation_id (string) - Conversation UUID
  • label (string, optional) - New label
  • folder (string, optional) - New folder
  • importance (int, optional) - New importance (1-10)
  • status (string, optional) - active/archived

memory_prune

Get cleanup recommendations.

Parameters:

  • min_age_days (int, optional) - Minimum age
  • max_importance (int, optional) - Max importance to consider
  • limit (int, optional) - Max suggestions

memory_export

Export conversations.

Parameters:

  • format (string) - json or markdown
  • folder (string, optional) - Export specific folder

memory_stats

Get memory usage statistics.

Parameters: None

Returns:

  • Total conversations
  • Total messages
  • Storage usage
  • Folder breakdown
  • Provider stats (v0.2.0) - which models are being used

Full API Reference


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  MCP Clients                                โ”‚
โ”‚  - Claude Desktop (Anthropic)               โ”‚
โ”‚  - Claude Code (Ollama/Anthropic/etc.)      โ”‚
โ”‚  - Any MCP-compatible client                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                 โ”‚
                 โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  Sekha MCP     โ”‚ โ† This repository
        โ”‚  Server        โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                 โ”‚
                 โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  Controller    โ”‚ โ† Memory APIs
        โ”‚  (Rust)        โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                 โ”‚
                 โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  ChromaDB      โ”‚ โ† Vector storage
        โ”‚  Redis         โ”‚ โ† Cache
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Separate from LLM routing:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  API Clients โ†’ Proxy โ†’ Bridge โ†’ Providers   โ”‚
โ”‚  (OpenAI SDK compatible)                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Points:

  • MCP provides memory tools only
  • Claude Desktop/Code handle their own LLM connections
  • Controller stores all conversations regardless of source
  • Same memory accessible from Claude apps and API

๐Ÿ”— Links


๐Ÿ“ Changelog

See CHANGELOG.md for full release history.


๐Ÿ“ License

AGPL-3.0 - License Details

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

sekha_mcp-0.2.0.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

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

sekha_mcp-0.2.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file sekha_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: sekha_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sekha_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4379bc874e4c1cd57767dc64c0a29698d1b3af58a52e6551ef4849fa87a0eb17
MD5 a9e7021d39022e1a2249d1bcf440739f
BLAKE2b-256 19c1adc8e3b3c4baafbbd3e6e967341e4a2c92f7846837666e6b1cfb9f2816dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for sekha_mcp-0.2.0.tar.gz:

Publisher: pypi-release.yml on sekha-ai/sekha-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sekha_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sekha_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sekha_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c62dfffd5218e5b7d8e97f8d2ff02ffd8fedf30e838e0e7de4e67f019637754
MD5 ca6091035cd18a33a78ad90e2d978158
BLAKE2b-256 9b1c5402b3c07c826b0c87cd7546b5f2b5536304af1169f2f5a9541cfa63bec6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sekha_mcp-0.2.0-py3-none-any.whl:

Publisher: pypi-release.yml on sekha-ai/sekha-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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