- Explore MCP Servers
- contextbase-py
Contextbase Py
What is Contextbase Py
contextbase-py is a Python SDK designed for interacting with the ContextBase MCP API, providing a simple key-value memory storage service with authentication and search capabilities.
Use cases
Use cases for contextbase-py include user session management, temporary data storage, caching frequently accessed data, and implementing search functionalities in applications.
How to use
To use contextbase-py, install it via pip with ‘pip install contextbase-py’. Initialize the Context object with the base URL, authenticate using signup and login methods, and perform memory operations such as set, get, list, search, and delete.
Key features
Key features of contextbase-py include user authentication, memory storage with optional time-to-live (TTL), search functionality for memories, and the ability to list all stored memories.
Where to use
contextbase-py can be used in various fields such as web applications, data storage solutions, and any project requiring a simple key-value store with search capabilities.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Contextbase Py
contextbase-py is a Python SDK designed for interacting with the ContextBase MCP API, providing a simple key-value memory storage service with authentication and search capabilities.
Use cases
Use cases for contextbase-py include user session management, temporary data storage, caching frequently accessed data, and implementing search functionalities in applications.
How to use
To use contextbase-py, install it via pip with ‘pip install contextbase-py’. Initialize the Context object with the base URL, authenticate using signup and login methods, and perform memory operations such as set, get, list, search, and delete.
Key features
Key features of contextbase-py include user authentication, memory storage with optional time-to-live (TTL), search functionality for memories, and the ability to list all stored memories.
Where to use
contextbase-py can be used in various fields such as web applications, data storage solutions, and any project requiring a simple key-value store with search capabilities.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
ContextBase Python SDK
A Python SDK for interacting with the ContextBase MCP API, simple key-value memory storage service with authentication and search capabilities.
Installation
pip install contextbase-py
Usage
Initialization
from contextbase import Context
ctx = Context(base_url='https://contextbase.onrender.com')
Authentication
signup_token = ctx.signup('[email protected]', 'password')
login_token = ctx.login('[email protected]', 'password')
ctx.set_token('your-auth-token')
Memory Operations
ctx.set('myKey', 'myValue')
ctx.set('temporaryKey', 'temporaryValue', 3600) # 1 hour TTL
ctx.set('temporaryKey', 'temporaryValue') # Without TTL
memory = ctx.get('myKey')
all_memories = ctx.list()
search_results = ctx.search('queryString')
ctx.delete('myKey')
API Reference
Constructor
Context(
base_url: str,
token: str = None # Optional initially, required for memory operations
)
Methods
| Method | Parameters | Return Type | Description |
|---|---|---|---|
set_token |
token: str |
None |
Sets the authentication token |
signup |
email: str, password: str |
str |
Creates a new user account and returns a token |
login |
email: str, password: str |
str |
Authenticates user and returns a token |
set |
key: str, value: str, ttl: int = None |
dict |
Stores a memory with optional TTL (in seconds) |
get |
key: str |
dict |
Retrieves a memory by key |
list |
None | list |
Lists all memories |
search |
query: str |
list |
Searches memories by query string |
delete |
key: str |
dict |
Deletes a memory by key |
License
MIT
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










