|
| 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 |
0 commit comments