@contextable/mcp
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.
README
@contextable/mcp
MCP (Model Context Protocol) server for AI memory. Store and retrieve context across AI conversations.
Features
- Dual Transport Modes: Stdio (for Claude Desktop) or HTTP/SSE (for web clients)
- Dual Storage Modes: Local SQLite or hosted Supabase cloud storage
- Full-Text Search: FTS5-powered search across all artifacts
- Version History: Automatic versioning with rollback support
- Auto-Chunking: Large content automatically split into manageable parts
- Topic Clustering: Automatic topic detection and filtering
- Living Summaries: Auto-generated project status summaries
Installation
npm install -g @contextable/mcp
Or run directly:
npx @contextable/mcp
Storage Modes
Local Mode (Default)
Uses SQLite database stored locally at ~/.contextable/data.db. Your data stays on your machine.
npx @contextable/mcp
# or explicitly:
npx @contextable/mcp --local
Hosted Mode
Connects to the Contextable cloud service for synced storage across devices.
# Set your API key
export CONTEXTABLE_API_KEY=ctx_your_api_key_here
# Run in hosted mode
npx @contextable/mcp --hosted
Get your API key at: https://contextable.me/settings
Transport Modes
Stdio (Default)
Uses standard input/output for communication. This is the default mode and works with Claude Desktop.
npx @contextable/mcp
HTTP/SSE
Uses HTTP with Server-Sent Events for communication. This mode enables web-based clients to connect.
# Start HTTP server on default port 3000
npx @contextable/mcp --sse
# Custom port and host
npx @contextable/mcp --sse --port=8080 --host=0.0.0.0
The HTTP server provides:
GET /health- Health check endpointPOST /mcp- MCP message endpointGET /mcp- SSE stream for server-to-client messages
Usage with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Local Mode
{
"mcpServers": {
"contextable": {
"command": "npx",
"args": ["@contextable/mcp"]
}
}
}
Hosted Mode
{
"mcpServers": {
"contextable": {
"command": "npx",
"args": ["@contextable/mcp", "--hosted"],
"env": {
"CONTEXTABLE_API_KEY": "ctx_your_api_key_here"
}
}
}
}
Tools
Project Management
- project_save - Create or update a project
- project_list - List all projects
- project_resume - Load a project with artifact summaries
- project_analysis_get - Get cached AI analysis results
Artifact Management
- artifact_save - Save content to a project (auto-chunks large content)
- artifact_list - List artifacts with size estimates
- artifact_get - Load full artifact content
- artifact_delete - Archive an artifact
- artifact_restore - Restore an archived artifact
- artifact_archived - List archived artifacts
- artifact_versions - Get version history
- artifact_rollback - Rollback to previous version
Search
- search - Full-text search across all artifacts
Environment Variables
General
| Variable | Default | Description |
|---|---|---|
CONTEXTABLE_MODE |
local |
Storage mode: local or hosted |
CONTEXTABLE_LOG_LEVEL |
info |
Log level: debug, info, warn, error |
Local Mode
| Variable | Default | Description |
|---|---|---|
CONTEXTABLE_DATA_DIR |
~/.contextable |
Data directory |
CONTEXTABLE_DB_PATH |
~/.contextable/data.db |
Database path |
Hosted Mode
| Variable | Default | Description |
|---|---|---|
CONTEXTABLE_API_KEY |
- | Your API key (required for hosted mode) |
CONTEXTABLE_API_URL |
https://api.contextable.me |
API URL |
HTTP/SSE Transport
| Variable | Default | Description |
|---|---|---|
CONTEXTABLE_PORT |
3000 |
HTTP server port |
CONTEXTABLE_HOST |
127.0.0.1 |
HTTP server host |
Example Usage
Once configured, you can ask Claude to:
- "Create a project called 'My App' for tracking my mobile app development"
- "Save this design decision to the project"
- "Search for authentication-related content"
- "Show me the project summary"
- "Load all security-related artifacts"
API
The package exports types and functions for programmatic use:
Local Storage (SQLite)
import { SQLiteAdapter, projectSave, artifactGet, search } from '@contextable/mcp';
// Create local storage
const storage = new SQLiteAdapter({ path: './my-data.db' });
await storage.initialize();
// Use tools
const ctx = { storage };
const result = await projectSave(ctx, {
name: 'My Project',
description: 'A test project',
});
await storage.close();
Hosted Storage (Supabase)
import { SupabaseAdapter, projectSave } from '@contextable/mcp';
// Create hosted storage
const storage = new SupabaseAdapter({
supabaseUrl: 'https://api.contextable.me',
supabaseServiceKey: process.env.SUPABASE_SERVICE_ROLE_KEY!,
apiKey: process.env.CONTEXTABLE_API_KEY!,
});
await storage.initialize();
// Use tools - same API as local mode
const ctx = { storage };
const result = await projectSave(ctx, {
name: 'My Project',
description: 'A test project',
});
await storage.close();
Development
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Type check
npm run typecheck
License
Apache 2.0 - See LICENSE for details.
Contributing
See CONTRIBUTING.md for guidelines.
Links
- Contextable - Hosted version with advanced features
- MCP Protocol - Model Context Protocol specification
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。