Skip to content

Commit fd9ebd1

Browse files
committed
Add initial project structure with .gitignore, LICENSE, pyproject.toml, README, upload script, and server implementation
0 parents  commit fd9ebd1

File tree

7 files changed

+577
-0
lines changed

7 files changed

+577
-0
lines changed

.gitignore

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# PyInstaller
27+
# Usually these files are written by a python script from a template
28+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29+
build/
30+
dist/
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
debug.log
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Jupyter Notebook
53+
.ipynb_checkpoints
54+
55+
# pyenv
56+
.python-version
57+
58+
# mypy
59+
.mypy_cache/
60+
.dmypy.json
61+
62+
# Pyre type checker
63+
.pyre/
64+
65+
# venv
66+
venv/
67+
68+
# Project memory file
69+
MEMORY.md

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 PYNESYS LLC.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Project Memory MCP
2+
3+
An MCP Server to store and retrieve project information from memory files. This allows AI agents (like Claude) to maintain persistent memory about projects between conversations.
4+
5+
## Overview
6+
7+
Project Memory MCP provides a simple way to:
8+
- Store project information in Markdown format
9+
- Retrieve project information at the beginning of conversations
10+
- Update project information using patches
11+
12+
The memory is stored in a `MEMORY.md` file in each project directory.
13+
14+
## Installation
15+
16+
### Local installation
17+
18+
#### Prerequisites
19+
20+
- Python 3.11 or higher
21+
- Pip package manager
22+
23+
#### Install from PyPI
24+
25+
```bash
26+
pip install project-mem-mcp
27+
```
28+
29+
#### Install from Source
30+
31+
```bash
32+
git clone https://github.com/your-username/project-mem-mcp.git
33+
cd project-mem-mcp
34+
pip install -e .
35+
```
36+
37+
## Usage
38+
39+
The MCP server is started by the client (e.g., Claude Desktop) based on the configuration you provide. You don't need to start the server manually.
40+
41+
### Integration with Claude Desktop
42+
43+
To use this MCP server with Claude Desktop, you need to add it to your `claude_desktop_config.json` file:
44+
45+
#### Using uvx (Recommended)
46+
47+
This method uses `uvx` (from the `uv` Python package manager) to run the server without permanent installation:
48+
49+
```json
50+
{
51+
"mcpServers": {
52+
"project-memory": {
53+
"command": "uvx",
54+
"args": [
55+
"project-mem-mcp",
56+
"--allowed-dir", "/Users/your-username/projects",
57+
"--allowed-dir", "/Users/your-username/Documents/code"
58+
]
59+
}
60+
}
61+
}
62+
```
63+
64+
#### Using pip installed version
65+
66+
If you've installed the package with pip:
67+
68+
```json
69+
{
70+
"mcpServers": {
71+
"project-memory": {
72+
"command": "project-mem-mcp",
73+
"args": [
74+
"--allowed-dir", "/Users/your-username/projects",
75+
"--allowed-dir", "/Users/your-username/Documents/code"
76+
]
77+
}
78+
}
79+
}
80+
```
81+
82+
### Configuring Claude Desktop
83+
84+
1. Install Claude Desktop from the [official website](https://claude.ai/desktop)
85+
2. Open Claude Desktop
86+
3. From the menu, select Settings → Developer → Edit Config
87+
4. Replace the config with one of the examples above (modify paths as needed)
88+
5. Save and restart Claude Desktop
89+
90+
## Tools
91+
92+
Project Memory MCP provides three tools:
93+
94+
### get_project_memory
95+
96+
Retrieves the entire project memory. Should be used at the beginning of every conversation.
97+
98+
```
99+
get_project_memory(project_path: str) -> str
100+
```
101+
102+
### set_project_memory
103+
104+
Sets the entire project memory. Use when creating a new memory file or when updates fail.
105+
106+
```
107+
set_project_memory(project_path: str, project_info: str)
108+
```
109+
110+
### update_project_memory
111+
112+
Updates the project memory by applying a unified diff/patch. More efficient for small changes.
113+
114+
```
115+
update_project_memory(project_path: str, project_info: str)
116+
```
117+
118+
## Example Workflow
119+
120+
1. Begin a conversation with Claude about a project
121+
2. Claude uses `get_project_memory` to retrieve project information
122+
3. Throughout the conversation, Claude uses `update_project_memory` to persist new information
123+
4. If the update fails, Claude can use `set_project_memory` instead
124+
125+
## Security Considerations
126+
127+
- Memory files should never contain sensitive information
128+
- Project paths are validated against allowed directories
129+
- All file operations are restricted to allowed directories
130+
131+
## Dependencies
132+
133+
- fastmcp (>=2.2.0, <3.0.0)
134+
- patch-ng (>=1.18.0, <2.0.0)
135+
136+
## License
137+
138+
MIT

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[project]
2+
name = "project-mem-mcp"
3+
version = "0.2.0"
4+
description = "An MCP Server to store and retreive project information from memory file"
5+
authors = [{ name = "PYNESYS LLC" }]
6+
readme = "README.md"
7+
requires-python = ">=3.11"
8+
license = { text = "MIT" }
9+
10+
dependencies = ["fastmcp>=2.2.0, <3.0.0", "unidiff>=0.7.0, <0.8.0"]
11+
12+
[project.scripts]
13+
project-mem-mcp = "project_mem_mcp.server:main"
14+
15+
[build-system]
16+
requires = ["setuptools>=68.0", "wheel"]
17+
build-backend = "setuptools.build_meta"
18+
19+
[tool.setuptools.packages.find]
20+
where = ["src"]

src/project_mem_mcp/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)