Skip to main content

A stdio MCP server to provide long-term memory for AI agents.

Project description

AI Agent Context Server

local-context-server is a lightweight, local MCP (Model Context Protocol) server designed to provide long-term memory for AI agents like Gemini, Claude, and others within environments like Cursor.

It allows an AI agent to save, load, list, and search for "contexts"—pieces of knowledge such as application maps, test data, or business requirements—making it possible to create adaptive and intelligent QA automation.

Features

  • Persistent Memory: Store any JSON-serializable data in a local SQLite database.

  • Simple Tool API: Provides four core tools for the AI to manage its knowledge:

    • save_context: Save or update a piece of knowledge.
    • load_context: Retrieve knowledge by its unique ID.
    • list_contexts: Browse all available knowledge.
    • search_contexts: Search for knowledge by keyword.
  • Automatic Database Location: The server automatically creates and manages its database file (memory_tests.db) in a folder named context-database inside your user's home directory. This requires no configuration.

Installation & Usage

The server is designed to be run on-the-fly by an MCP client like Cursor, requiring no manual setup for end-users.

Prerequisites

Python 3.8+ pipx (a tool for running Python applications in isolated environments)

pip install pipx
Usage in Cursor

To use this server with Cursor, add the following to your .cursor/mcp.json configuration file. This command downloads and runs the server package from PyPI.

"mcpServers": {
    "context-local-server": {
      "command": "pipx",
      "args": [
        "run",
        "context-local-server"
      ]
    },
}

How to Use with an AI Agent

Once configured in Cursor, you can interact with the server using the name you defined in mcp.json.

Saving a Context

Your mission is to execute the login flow and document the steps. As you perform each action (navigate, enter text, click) with @mobile-mcp, add a description of that action to a list.

When you have successfully logged in, use @local-context-server to save the complete list of steps with the id flow_login_v1.

Listing all Contexts

Use @local-context-server, execute list_contexts to show me all the knowledge you have.

Searching for a Context

Your mission is to perform the login flow. I don't remember the exact ID. Use @local-context-server to search for contexts related to "login" (search by keyword "login" or related), load the correct one, and then execute the steps using @mobile-mcp.

Using a Context

Perform a login using @mobile-mcp. Use the context app_map_v1 from @local-context-server as your knowledge base for the element IDs.

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

context_local_server-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

context_local_server-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file context_local_server-0.1.1.tar.gz.

File metadata

  • Download URL: context_local_server-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for context_local_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 94895cecfea56fa365860d44135f3894670a419ed4498ddfd832f3559a012efe
MD5 367220966d88ed9968cc71e1ce843ff4
BLAKE2b-256 b9c02de946ddb2575435183d835201a9208e92db6b7627dac2720d89c2029294

See more details on using hashes here.

File details

Details for the file context_local_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for context_local_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63e3d51644bf3607c1b35fb37c59642143191ccaa18f5b3cf40ab806406d5529
MD5 7b52f9b2a25a0cb338562d10afceeab4
BLAKE2b-256 31eb36a2eb720232a645b1b79a547b83e2fdb734a1098c3dcc7afc82400a0715

See more details on using hashes here.

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