This MCP server provides a semantic search and memory management system built on txtai, enabling AI assistants like Claude and Cline to store, retrieve, and organize text-based information with powerful semantic search capabilities.
Clone the repository:
git clone https://github.com/yourusername/txtai-assistant-mcp.git
cd txtai-assistant-mcp
Run the start script to set up and launch the server:
./scripts/start.sh
This script automatically:
The server can be configured using environment variables in a .env
file. A template is provided:
# Server Configuration
HOST=0.0.0.0
PORT=8000
# CORS Configuration
CORS_ORIGINS=*
# Logging Configuration
LOG_LEVEL=DEBUG
# Memory Configuration
MAX_MEMORIES=0
Add this server to Claude's MCP configuration file (typically at ~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"txtai-assistant": {
"command": "path/to/txtai-assistant-mcp/scripts/start.sh",
"env": {}
}
}
}
Add the server to Cline's MCP settings file (typically at ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):
{
"mcpServers": {
"txtai-assistant": {
"command": "path/to/txtai-assistant-mcp/scripts/start.sh",
"env": {}
}
}
}
Stores new memory content with metadata and tags:
{
"content": "Memory content to store",
"metadata": {
"source": "conversation",
"timestamp": "2023-01-01T00:00:00Z"
},
"tags": ["important", "context"],
"type": "conversation"
}
Retrieves memories based on semantic search:
{
"query": "search query",
"n_results": 5
}
Searches memories by tags:
{
"tags": ["important", "context"]
}
Deletes a specific memory by content hash:
{
"content_hash": "hash_value"
}
Gets database statistics:
{}
Checks database and embedding model health:
{}
In Claude or Cline, you can use these tools through the MCP protocol:
# Store a memory
<use_mcp_tool>
<server_name>txtai-assistant</server_name>
<tool_name>store_memory</tool_name>
<arguments>
{
"content": "Important information to remember",
"tags": ["important"]
}
</arguments>
</use_mcp_tool>
# Retrieve memories
<use_mcp_tool>
<server_name>txtai-assistant</server_name>
<tool_name>retrieve_memory</tool_name>
<arguments>
{
"query": "what was the important information?",
"n_results": 5
}
</arguments>
</use_mcp_tool>
POST /store
Request Body:
{
"content": "Memory content to store",
"metadata": {
"source": "example",
"timestamp": "2023-01-01T00:00:00Z"
},
"tags": ["example", "memory"],
"type": "general"
}
POST /search
Request Body:
{
"query": "search query",
"n_results": 5,
"similarity_threshold": 0.7
}
POST /search_tags
Request Body:
{
"tags": ["example", "memory"]
}
DELETE /memory/{content_hash}
GET /stats
GET /health
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "txtai-assistant" '{"command":"path/to/txtai-assistant-mcp/scripts/start.sh","env":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"txtai-assistant": {
"command": "path/to/txtai-assistant-mcp/scripts/start.sh",
"env": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"txtai-assistant": {
"command": "path/to/txtai-assistant-mcp/scripts/start.sh",
"env": []
}
}
}
3. Restart Claude Desktop for the changes to take effect