Skip to main content
Glama

Context MCP

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.

Features

  • Add Context: Store text with metadata, automatically embedded and indexed

  • Query Context: Semantic search to find relevant stored information

  • Batch Operations: Efficiently add or delete multiple contexts

  • Metadata Filtering: Filter queries by metadata attributes

  • Statistics: Monitor your vector database usage

Related MCP server: Qdrant MCP Server

Prerequisites

  1. Upstash Vector DB account - Sign up at Upstash

    • Create a new Vector Index with dimension 768 (for Google's text-embedding-004)

    • Get your REST URL and Token

  2. Google AI API Key - Get from Google AI Studio

Installation

# Clone the repository
git clone <your-repo-url>
cd context-mcp

# Install dependencies
npm install

# Build the project
npm run build

Configuration

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

Usage with AI Agents

Claude Desktop

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"
      }
    }
  }
}

Cursor

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"
      }
    }
  }
}

Claude Code (Windsurf)

Add to your MCP configuration file.

Available Tools

add_context

Store a single piece of context.

Parameters:

  • id (required): Unique identifier

  • content (required): Text content to store

  • metadata (optional): Key-value pairs for filtering

add_contexts_batch

Store multiple contexts efficiently.

Parameters:

  • contexts (required): Array of {id, content, metadata} objects

query_context

Search for relevant contexts.

Parameters:

  • query (required): Natural language search query

  • topK (optional): Number of results (1-20, default: 5)

  • filter (optional): Upstash filter expression

delete_context

Delete a single context by ID.

Parameters:

  • id (required): ID of context to delete

delete_contexts_batch

Delete multiple contexts.

Parameters:

  • ids (required): Array of IDs to delete

get_stats

Get database statistics (vector count, dimensions).

Example Usage

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?"

Upstash Filter Syntax

When querying, you can filter by metadata:

# Exact match
category = 'meetings'

# Numeric comparison  
priority > 5

# Multiple conditions
category = 'docs' AND priority >= 3

Development

# Run in development mode
npm run dev

# Build for production
npm run build

# Start production server
npm start

License

MIT

Available Tools

6 tools
add_contextB

Add a piece of context/knowledge to the vector database. Use this to store information that can be retrieved later for relevant queries.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesUnique identifier for this context entry
contentYesThe text content to store and index
metadataNoOptional metadata to associate with the context (e.g., source, category, timestamp)

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool adds context to a vector database for later retrieval, implying a write operation, but doesn't disclose critical traits: whether this is idempotent (e.g., overwrites existing IDs), requires specific permissions, has rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and well-structured in two sentences: the first states the purpose, and the second provides usage guidance. Every sentence earns its place without redundancy or fluff, making it easy to parse and front-loaded with essential information. It efficiently communicates core functionality within minimal text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation with 3 parameters, no output schema, and no annotations), the description is minimally adequate. It covers the basic purpose and usage but lacks details on behavioral traits, error handling, or output expectations. Without annotations or output schema, the description should do more to explain what happens after invocation (e.g., success confirmation, error cases). It meets a bare minimum but has clear gaps for a write operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the three parameters (id, content, metadata) with their types and descriptions. The description adds no parameter-specific semantics beyond implying storage and indexing, which is already covered by the tool's purpose. Baseline 3 is appropriate as the schema does the heavy lifting, and the description doesn't compensate with additional insights like format examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Add a piece of context/knowledge to the vector database' with the specific action 'store information that can be retrieved later'. It distinguishes from siblings like delete_context (removal) and query_context (retrieval), though it doesn't explicitly differentiate from add_contexts_batch (batch version). The verb+resource combination is specific but could be more precise about the 'add' operation versus batch alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance: 'Use this to store information that can be retrieved later for relevant queries' suggests it's for storing data for future retrieval. However, it lacks explicit when-to-use vs. when-not-to-use criteria, doesn't mention alternatives like add_contexts_batch for multiple entries, and omits prerequisites or constraints. The guidance is functional but incomplete for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

add_contexts_batchA

Add multiple context entries to the vector database in a single operation. More efficient for bulk indexing.

ParametersJSON Schema
NameRequiredDescriptionDefault
contextsYesArray of context entries to add

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions efficiency for bulk operations, which is useful behavioral context, but lacks details on permissions, rate limits, error handling, or what happens on failure (e.g., partial success). For a mutation tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences with zero waste. The first sentence states the core purpose, and the second adds critical usage guidance. It is front-loaded and efficiently communicates essential information without unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a mutation tool. It covers purpose and usage well but misses behavioral aspects like side effects, return values, or error conditions. For a tool that modifies data in bulk, more context on outcomes and risks would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the 'contexts' parameter and its nested structure. The description does not add any parameter-specific information beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate as the schema handles the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add multiple context entries'), the target ('to the vector database'), and the operational context ('in a single operation'). It specifically distinguishes this tool from its sibling 'add_context' by emphasizing bulk operations and efficiency for bulk indexing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides usage guidance by stating this tool is 'More efficient for bulk indexing,' which directly advises when to use this tool (for bulk operations) versus its sibling 'add_context' (likely for single entries). It effectively differentiates between batch and single operations without needing to name alternatives explicitly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

delete_contextC

Delete a specific context entry by its ID

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the context to delete

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a deletion operation, implying it's destructive, but doesn't specify whether deletions are permanent, reversible, require specific permissions, or have side effects. This is a significant gap for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's front-loaded and appropriately sized for a simple tool with one parameter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after deletion (e.g., confirmation message, error handling), potential impacts, or how it differs from batch deletion tools. Given the complexity and lack of structured data, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions the parameter ('by its ID'), but the input schema already has 100% coverage with a clear description for the 'id' parameter. This adds minimal value beyond what's in the schema, meeting the baseline of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('a specific context entry by its ID'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'delete_contexts_batch' (which handles multiple deletions), but it's specific enough to understand what this individual tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'delete_contexts_batch' for batch operations or 'query_context' for viewing contexts. There's no mention of prerequisites, error conditions, or typical use cases, leaving the agent without contextual usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

delete_contexts_batchC

Delete multiple context entries by their IDs

ParametersJSON Schema
NameRequiredDescriptionDefault
idsYesArray of context IDs to delete

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose critical behavioral traits such as whether deletions are permanent, require specific permissions, have rate limits, or what happens on partial failures (e.g., if some IDs are invalid).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and target, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive batch operation with no annotations and no output schema, the description is inadequate. It doesn't cover behavioral implications, error handling, or output expectations, leaving significant gaps for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the 'ids' parameter fully documented in the schema. The description adds no additional meaning beyond implying batch deletion, so it meets the baseline of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and target ('multiple context entries by their IDs'), which is specific and unambiguous. However, it doesn't differentiate from its sibling 'delete_context' (singular vs batch), so it misses full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'delete_context' (for single deletions) or other context management tools. It lacks context about prerequisites, error conditions, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_statsB

Get statistics about the vector database (number of stored contexts, dimensions)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get statistics' implies a read-only operation, it doesn't specify whether this requires special permissions, if there are rate limits, what format the statistics are returned in, or whether the operation is expensive. The description provides basic intent but lacks important operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that immediately states the purpose and provides concrete examples of what statistics are returned. There's no wasted language or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter read operation with no output schema, the description provides adequate basic information about what the tool does. However, without annotations to cover behavioral aspects and no output schema to document return values, the description could do more to explain what format the statistics are returned in or what other statistics might be available beyond the two examples given.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist, earning a baseline score of 4 for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get statistics') and specifies the resource ('vector database') with concrete examples of what statistics are returned ('number of stored contexts, dimensions'). However, it doesn't explicitly differentiate this read-only stats tool from sibling tools like 'query_context' which might also return metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention whether this is for monitoring, debugging, or other purposes, nor does it reference sibling tools that might provide overlapping or complementary functionality.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_contextB

Search for relevant context based on a natural language query. Returns the most semantically similar stored contexts.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query in natural language
topKNoNumber of results to return (default: 5, max: 20)
filterNoOptional filter expression for metadata (Upstash filter syntax)

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the search returns 'most semantically similar stored contexts' which implies a ranking/retrieval operation, but doesn't cover important aspects like authentication requirements, rate limits, error conditions, response format, or whether this is a read-only operation (though implied by 'search').

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise - two clear sentences that directly state the tool's function and return behavior with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 3 parameters and 100% schema coverage but no annotations or output schema, the description is minimally adequate. It covers the basic purpose but lacks important contextual information about the search mechanism, result format, limitations, or how it differs from sibling tools. The absence of output schema means the description should ideally explain what 'returns' means in practice.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it mentions 'natural language query' which matches the schema's 'query' description, but provides no additional context about parameter interactions or usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for relevant context based on a natural language query. Returns the most semantically similar stored contexts.' It specifies the verb ('search'), resource ('stored contexts'), and mechanism ('semantically similar'), but doesn't explicitly differentiate from sibling tools like 'get_stats' which might also retrieve context information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'add_context' for adding data or 'delete_context' for removal, nor does it specify prerequisites or appropriate scenarios for semantic search versus other retrieval methods.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

Every tool has a clearly distinct purpose with no ambiguity. Tools are clearly separated into categories: adding context (single vs. batch), deleting context (single vs. batch), querying context, and getting statistics. The descriptions make it immediately clear which tool to use for each operation.

Naming Consistency5/5

Tool names follow a perfectly consistent verb_noun pattern throughout. All tools use snake_case with clear action prefixes (add, delete, get, query) followed by the object (context/stats). Even batch operations maintain the same pattern with '_batch' suffix for consistency.

Tool Count5/5

Six tools is well-scoped for a context management server. Each tool earns its place by covering essential operations: CRUD operations (create, read, delete) with both single and batch variants, plus query and statistics capabilities. No tool feels redundant or missing for the domain.

Completeness5/5

The tool surface provides complete CRUD/lifecycle coverage for context management. It covers creation (add single/batch), retrieval (query), deletion (delete single/batch), and monitoring (stats). There are no dead ends or obvious gaps for the stated purpose of managing a vector database of context/knowledge.

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to store, retrieve, and manage contextual knowledge across sessions using semantic search with PostgreSQL and vector embeddings. Supports memory relationships, clustering, multi-agent isolation, and intelligent caching for persistent conversational context.
    47
    48
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables storing and retrieving information using semantic search with Qdrant vector database. Acts as a memory layer for LLMs to persistently store and semantically search through information and metadata.
    Apache 2.0
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables persistent multimodal context storage for LLM agents with thread-based scoping, metadata filtering, and hybrid search capabilities.
    9
    Elastic 2.0
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides a persistent, versioned, and searchable context store for AI agents with local embedding and hybrid search.
    85
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Raunak-dev-18/context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server