mem-brain-mcp 1.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mem_brain_mcp/__init__.py +4 -0
- mem_brain_mcp/__main__.py +29 -0
- mem_brain_mcp/client.py +260 -0
- mem_brain_mcp/config.py +45 -0
- mem_brain_mcp/server.py +1564 -0
- mem_brain_mcp-1.0.6.dist-info/METADATA +208 -0
- mem_brain_mcp-1.0.6.dist-info/RECORD +9 -0
- mem_brain_mcp-1.0.6.dist-info/WHEEL +4 -0
- mem_brain_mcp-1.0.6.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mem-brain-mcp
|
|
3
|
+
Version: 1.0.6
|
|
4
|
+
Summary: MCP Server for Mem-Brain API - Exposes memory operations as MCP tools
|
|
5
|
+
Keywords: ai,claude,cursor,llm,mcp,memory,model-context-protocol
|
|
6
|
+
Classifier: Development Status :: 4 - Beta
|
|
7
|
+
Classifier: Intended Audience :: Developers
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Requires-Python: <3.14,>=3.10
|
|
15
|
+
Requires-Dist: fastmcp<3.0.0,>=2.0.0
|
|
16
|
+
Requires-Dist: httpx>=0.25.0
|
|
17
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
18
|
+
Requires-Dist: pydantic>=2.0.0
|
|
19
|
+
Requires-Dist: uvicorn[standard]>=0.27.0
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# Mem-Brain MCP Server
|
|
28
|
+
|
|
29
|
+
MCP (Model Context Protocol) server that exposes Mem-Brain API functionality as standardized tools for AI agents. Built with [FastMCP](https://gofastmcp.com) for production-ready HTTP/SSE transport.
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- **Memory Management**: Create, read, update, and delete memories
|
|
34
|
+
- **Semantic Search**: Search memories using vector similarity
|
|
35
|
+
- **Graph Operations**: Find paths and neighborhoods in the memory graph
|
|
36
|
+
- **Statistics**: Get insights about your memory system
|
|
37
|
+
- **Link Management**: Link and unlink memories
|
|
38
|
+
- **HTTP/SSE Transport**: Run independently, accessible remotely
|
|
39
|
+
- **CLI Interface**: Packaged for easy global execution
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
### From PyPI (Recommended)
|
|
44
|
+
|
|
45
|
+
Install from PyPI using `pip` or `uv`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Using pip
|
|
49
|
+
pip install mem-brain-mcp
|
|
50
|
+
|
|
51
|
+
# Using uv
|
|
52
|
+
uv pip install mem-brain-mcp
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then run globally:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
mem-brain-mcp
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Instant Execution with uvx
|
|
62
|
+
|
|
63
|
+
You can run the MCP server instantly without manual installation using `uvx`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Run using uvx (uses default API URL)
|
|
67
|
+
uvx mem-brain-mcp
|
|
68
|
+
|
|
69
|
+
# Override API URL or set JWT token if needed
|
|
70
|
+
export API_BASE_URL=http://your-custom-api-url.com
|
|
71
|
+
export MEMBRAIN_API_KEY=your-jwt-token-here
|
|
72
|
+
uvx mem-brain-mcp
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### From Source
|
|
76
|
+
|
|
77
|
+
1. Install using `uv` (recommended) or `pip`:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cd mem-brain-mcp
|
|
81
|
+
uv pip install .
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
2. Run globally:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
mem-brain-mcp
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Configuration
|
|
91
|
+
|
|
92
|
+
The server reads configuration from environment variables or a `.env` file in the current working directory. Most settings have sensible defaults:
|
|
93
|
+
|
|
94
|
+
```env
|
|
95
|
+
# API Configuration (optional - defaults to production API)
|
|
96
|
+
API_BASE_URL=http://membrain-api-alb-1094729422.ap-south-1.elb.amazonaws.com
|
|
97
|
+
# NOTE: MEMBRAIN_API_KEY is actually a JWT access token (from login/signup)
|
|
98
|
+
# Per-user JWT tokens are typically configured in MCP clients via headers
|
|
99
|
+
MEMBRAIN_API_KEY=your_jwt_token_here # Optional: fallback for single-user scenarios
|
|
100
|
+
|
|
101
|
+
# MCP Server Configuration
|
|
102
|
+
MCP_SERVER_HOST=0.0.0.0
|
|
103
|
+
MCP_SERVER_PORT=8100
|
|
104
|
+
|
|
105
|
+
# Logging
|
|
106
|
+
LOG_LEVEL=INFO
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Note**: The `API_BASE_URL` defaults to the production Mem-Brain API endpoint, so you typically don't need to set it unless you're using a custom API instance.
|
|
110
|
+
|
|
111
|
+
## Per-User JWT Token Configuration
|
|
112
|
+
|
|
113
|
+
Each user must configure their own JWT access token in their MCP client for proper user isolation. The server extracts tokens from request headers. Get your JWT token by logging in or signing up to the Mem-Brain API.
|
|
114
|
+
|
|
115
|
+
### Cursor IDE (`~/.cursor/mcp.json`)
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"mcpServers": {
|
|
120
|
+
"mem-brain": {
|
|
121
|
+
"url": "http://localhost:8100/mcp",
|
|
122
|
+
"headers": {
|
|
123
|
+
"Authorization": "Bearer your-jwt-token"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Claude Desktop
|
|
131
|
+
|
|
132
|
+
#### Option 1: Native Remote (Pro/Team plans)
|
|
133
|
+
Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"mcpServers": {
|
|
138
|
+
"mem-brain": {
|
|
139
|
+
"url": "http://your-deployed-url/mcp",
|
|
140
|
+
"headers": {
|
|
141
|
+
"Authorization": "Bearer your-jwt-token"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### Option 2: via CLI (Any plan)
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"mcpServers": {
|
|
152
|
+
"mem-brain": {
|
|
153
|
+
"command": "uvx",
|
|
154
|
+
"args": ["mem-brain-mcp"]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Note**: After installing from PyPI, you can also use `mem-brain-mcp` directly. The API URL is set by default, but you can override it if needed:
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"mcpServers": {
|
|
164
|
+
"mem-brain": {
|
|
165
|
+
"command": "mem-brain-mcp",
|
|
166
|
+
"env": {
|
|
167
|
+
"API_BASE_URL": "http://your-custom-api-url"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## AWS ECS Deployment
|
|
175
|
+
|
|
176
|
+
The MCP server can be deployed to AWS ECS (Fargate) with an Application Load Balancer.
|
|
177
|
+
|
|
178
|
+
### Quick Start
|
|
179
|
+
|
|
180
|
+
1. **Set up security groups** (see [aws/security-groups.md](./aws/security-groups.md))
|
|
181
|
+
2. **Deploy using the script:**
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
cd mem-brain-mcp/aws
|
|
185
|
+
./deploy.sh ap-south-1 membrain-mcp membrain-cluster membrain-mcp
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
For detailed instructions, see [aws/DEPLOYMENT.md](./aws/DEPLOYMENT.md).
|
|
189
|
+
|
|
190
|
+
## Development
|
|
191
|
+
|
|
192
|
+
### Running Tests
|
|
193
|
+
```bash
|
|
194
|
+
pytest
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Build and Publish
|
|
198
|
+
```bash
|
|
199
|
+
# Build the wheel
|
|
200
|
+
python3 -m build
|
|
201
|
+
|
|
202
|
+
# Upload to PyPI
|
|
203
|
+
twine upload dist/*
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
Same as Mem-Brain API project.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
mem_brain_mcp/__init__.py,sha256=u8pOjQqzMWIWU9TmVSkCxEA_LeUDUzEEatvXMKa1REs,89
|
|
2
|
+
mem_brain_mcp/__main__.py,sha256=H_mwoKm1FBmu4KzAcQcq-TXZqeNvlrAekAxB1s4F4hA,712
|
|
3
|
+
mem_brain_mcp/client.py,sha256=qVZutTX1EyH1R00TOcxk29gzqELwNqzAuFIO8-8FXrw,8049
|
|
4
|
+
mem_brain_mcp/config.py,sha256=xx2lBkCIeT85t0HxtORwZHSU3hZT_EdsThpfjwPJhbQ,1261
|
|
5
|
+
mem_brain_mcp/server.py,sha256=tHmjdhQM2cH-iD9xA-oCzUPX5yaDh4ZxnCRq3B7fCFk,70799
|
|
6
|
+
mem_brain_mcp-1.0.6.dist-info/METADATA,sha256=o7dYmpnRnchyvv7YZS7lmxPZGfcQLLP4dY1XuyDNJAE,5228
|
|
7
|
+
mem_brain_mcp-1.0.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
8
|
+
mem_brain_mcp-1.0.6.dist-info/entry_points.txt,sha256=NH6QYQ-Sd8eJn5crpe_DL1PvGeUlL3y65968xPhmwG8,62
|
|
9
|
+
mem_brain_mcp-1.0.6.dist-info/RECORD,,
|