io.github.alex-feel/mcp-context-server

平台与服务

by alex-feel

An MCP server that provides persistent multimodal context storage for LLM agents.

什么是 io.github.alex-feel/mcp-context-server

An MCP server that provides persistent multimodal context storage for LLM agents.

README

MCP Context Server

<p align="center"> <img src=".github/images/banner.jpg" alt="MCP Context Server - MCP-based server providing persistent multimodal context storage for LLM agents" width="100%"> </p>

PyPI MCP Registry GitHub License Ask DeepWiki

A high-performance Model Context Protocol (MCP) server providing persistent multimodal context storage for LLM agents. Built with FastMCP, this server enables seamless context sharing across multiple agents working on the same task through thread-based scoping.

Key Features

  • Multimodal Context Storage: Store and retrieve both text and images
  • Thread-Based Scoping: Agents working on the same task share context through thread IDs
  • Flexible Metadata Filtering: Store custom structured data with any JSON-serializable fields and filter using 16 powerful operators
  • Date Range Filtering: Filter context entries by creation timestamp using ISO 8601 format
  • Tag-Based Organization: Efficient context retrieval with normalized, indexed tags
  • Summary Generation: Optional automatic LLM-based summarization returned alongside truncated text_content in all search tool results for better agent context efficiency (enabled by default with Ollama)
  • Full-Text Search: Optional linguistic search with stemming, ranking, boolean queries (FTS5/tsvector), and cross-encoder reranking
  • Semantic Search: Optional vector similarity search for meaning-based retrieval with cross-encoder reranking
  • Hybrid Search: Optional combined FTS + semantic search using Reciprocal Rank Fusion (RRF) with cross-encoder reranking
  • Cross-Encoder Reranking: Automatic result refinement using FlashRank cross-encoder models for improved search precision (enabled by default)
  • Multiple Database Backends: Choose between SQLite (default, zero-config) or PostgreSQL (high-concurrency, production-grade)
  • High Performance: WAL mode (SQLite) / MVCC (PostgreSQL), strategic indexing, and async operations
  • MCP Standard Compliance: Works with Claude Code, LangGraph, and any MCP-compatible client
  • Production Ready: Comprehensive test coverage, type safety, and robust error handling

Prerequisites

  • uv package manager (install instructions)
  • An MCP-compatible client (Claude Code, LangGraph, or any MCP client)
  • Ollama (for embedding and summary generation - default behavior):
    • Install from ollama.com/download
    • Pull embedding model: ollama pull qwen3-embedding:0.6b
    • Pull summary model: ollama pull qwen3:0.6b

Adding the Server to Claude Code

There are two ways to add the MCP Context Server to Claude Code:

Method 1: Using CLI Command

bash
# Default setup (recommended) - embeddings + summary + reranking
# Requires: Ollama installed + models pulled (see Prerequisites)
claude mcp add context-server -- uvx --python 3.12 --with "mcp-context-server[embeddings-ollama,summary-ollama,reranking]" mcp-context-server

# From GitHub (latest development version)
claude mcp add context-server -- uvx --python 3.12 --from git+https://github.com/alex-feel/mcp-context-server --with "mcp-context-server[embeddings-ollama,summary-ollama,reranking]" mcp-context-server

For more details, see: https://docs.claude.com/en/docs/claude-code/mcp#option-1%3A-add-a-local-stdio-server

Method 2: Direct File Configuration

Add the following to your .mcp.json file in your project directory:

json
{
  "mcpServers": {
    "context-server": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--python", "3.12", "--with", "mcp-context-server[embeddings-ollama,summary-ollama,reranking]", "mcp-context-server"],
      "env": {}
    }
  }
}

Prerequisites: Ollama must be installed with the required models pulled: ollama pull qwen3-embedding:0.6b and ollama pull qwen3:0.6b.

For the latest development version from GitHub, use:

json
"args": ["--python", "3.12", "--from", "git+https://github.com/alex-feel/mcp-context-server", "--with", "mcp-context-server[embeddings-ollama,summary-ollama,reranking]", "mcp-context-server"]

For configuration file locations and details, see: https://docs.claude.com/en/docs/claude-code/settings#settings-files

Verifying Installation

bash
# Start Claude Code
claude

# Check MCP tools are available
/mcp

Environment Configuration

The server is fully configured via environment variables, supporting core settings, transport, authentication, embedding providers, summary generation, search features, database tuning, and more. Variables can be set in your MCP client configuration, in a .env file, or directly in the shell.

For the complete reference of all environment variables with types, defaults, constraints, and descriptions, see the Environment Variables Reference.

Summary Generation

Summary generation automatically creates concise LLM-based summaries for each stored context entry. Summaries are returned in the summary field of all search tool results alongside truncated text_content, providing dense, informative summaries that help agents determine relevance without fetching full entries.

This feature is enabled by default when the summary-ollama extra is installed. The default model is qwen3:0.6b (local Ollama). Alternative models in the same family: qwen3:1.7b (higher quality), qwen3:4b (high quality), qwen3:8b (highest quality).

For detailed instructions including all providers (Ollama, OpenAI, Anthropic), model selection, and custom prompt configuration, see the Summary Generation Guide.

Semantic Search

For detailed instructions on enabling optional semantic search with multiple embedding providers (Ollama, OpenAI, Azure, HuggingFace, Voyage), see the Semantic Search Guide.

Full-Text Search

For full-text search with linguistic processing, stemming, ranking, and boolean queries, see the Full-Text Search Guide.

Hybrid Search

For combined FTS + semantic search using Reciprocal Rank Fusion (RRF), see the Hybrid Search Guide.

Metadata Filtering

For comprehensive metadata filtering including 16 operators, nested JSON paths, and performance optimization, see the Metadata Guide.

Database Backends

The server supports multiple database backends, selectable via the STORAGE_BACKEND environment variable. SQLite (default) provides zero-configuration local storage perfect for single-user deployments. PostgreSQL offers high-performance capabilities with 10x+ write throughput for multi-user and high-traffic deployments.

For detailed configuration instructions including PostgreSQL setup with Docker, Supabase integration, connection methods, and troubleshooting, see the Database Backends Guide.

API Reference

The MCP Context Server exposes 13 MCP tools for context management:

Core Operations: store_context, search_context, get_context_by_ids, delete_context, update_context, list_threads, get_statistics

Search Tools: semantic_search_context, fts_search_context, hybrid_search_context

Batch Operations: store_context_batch, update_context_batch, delete_context_batch

For complete tool documentation including parameters, return values, filtering options, and examples, see the API Reference.

Docker Deployment

For production deployments with HTTP transport and container orchestration, Docker Compose configurations are available for SQLite, PostgreSQL, and external PostgreSQL (Supabase). See the Docker Deployment Guide for setup instructions and client connection details.

Kubernetes Deployment

For Kubernetes deployments, a Helm chart is provided with configurable values for different environments. See the Helm Deployment Guide for installation instructions, or the Kubernetes Deployment Guide for general Kubernetes concepts.

Authentication

For HTTP transport deployments requiring authentication, see the Authentication Guide for bearer token configuration.

<!-- mcp-name: io.github.alex-feel/mcp-context-server -->

常见问题

io.github.alex-feel/mcp-context-server 是什么?

An MCP server that provides persistent multimodal context storage for LLM agents.

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描114.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描114.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描10.2k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.4k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.4k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
35.4k

评论