loading…
Search for a command to run...
loading…
Provides persistent context management for AI agents by storing and querying semantic information using Upstash Vector DB and Google AI embeddings. It enables s
Provides persistent context management for AI agents by storing and querying semantic information using Upstash Vector DB and Google AI embeddings. It enables semantic search, batch operations, and metadata filtering to help agents retrieve relevant stored knowledge.
A Model Context Protocol (MCP) server that provides persistent context management for AI agents like Cursor, Claude Code, and Claude Desktop. Uses Upstash Vector DB for storage and Google AI for embeddings.
Upstash Vector DB account - Sign up at Upstash
768 (for Google's text-embedding-004)Google AI API Key - Get from Google AI Studio
# Clone the repository
git clone <your-repo-url>
cd context-mcp
# Install dependencies
npm install
# Build the project
npm run build
Create a .env file based on .env.example:
cp .env.example .env
Fill in your credentials:
UPSTASH_VECTOR_REST_URL=your_upstash_vector_url
UPSTASH_VECTOR_REST_TOKEN=your_upstash_vector_token
GOOGLE_AI_API_KEY=your_google_ai_api_key
Add to your claude_desktop_config.json:
{
"mcpServers": {
"context": {
"command": "node",
"args": ["path/to/context-mcp/dist/index.js"],
"env": {
"UPSTASH_VECTOR_REST_URL": "your_url",
"UPSTASH_VECTOR_REST_TOKEN": "your_token",
"GOOGLE_AI_API_KEY": "your_key"
}
}
}
}
Add to your Cursor MCP settings:
{
"mcpServers": {
"context": {
"command": "node",
"args": ["path/to/context-mcp/dist/index.js"],
"env": {
"UPSTASH_VECTOR_REST_URL": "your_url",
"UPSTASH_VECTOR_REST_TOKEN": "your_token",
"GOOGLE_AI_API_KEY": "your_key"
}
}
}
}
Add to your MCP configuration file.
add_contextStore a single piece of context.
Parameters:
id (required): Unique identifiercontent (required): Text content to storemetadata (optional): Key-value pairs for filteringadd_contexts_batchStore multiple contexts efficiently.
Parameters:
contexts (required): Array of {id, content, metadata} objectsquery_contextSearch for relevant contexts.
Parameters:
query (required): Natural language search querytopK (optional): Number of results (1-20, default: 5)filter (optional): Upstash filter expressiondelete_contextDelete a single context by ID.
Parameters:
id (required): ID of context to deletedelete_contexts_batchDelete multiple contexts.
Parameters:
ids (required): Array of IDs to deleteget_statsGet database statistics (vector count, dimensions).
Once connected, you can ask your AI agent to:
"Add this project documentation to my context with id 'project-readme'"
"Search my context for information about authentication"
"Store these meeting notes with category 'meetings' and date '2024-01-15'"
"What relevant context do I have about the payment system?"
When querying, you can filter by metadata:
# Exact match
category = 'meetings'
# Numeric comparison
priority > 5
# Multiple conditions
category = 'docs' AND priority >= 3
# Run in development mode
npm run dev
# Build for production
npm run build
# Start production server
npm start
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"context-mcp": {
"command": "npx",
"args": []
}
}
}