Skip to content
Back to search

memory-mcp-server

A Model Context Protocol server that provides knowledge graph management capabilities.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/okooo5km--memory-mcp-server/badge.svg)](/listings/okooo5km--memory-mcp-server)

HTML

<a href="/listings/okooo5km--memory-mcp-server"><img src="/api/listings/okooo5km--memory-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

Option 1: One-Line Installation (curl)

The easiest way to install is with the one-line installer, which automatically downloads the latest version and installs it to `~/.local/bin` in your home directory:

curl -fsSL https://raw.githubusercontent.com/okooo5km/memory-mcp-server/main/install.sh | bash

The installer will:

* Create `~/.local/bin` if it doesn't exist * Add this directory to your PATH (in .zshrc or .bashrc) * Download and install the latest version * Make the binary executable

Option 2: Build from Source

1. Clone the repository:

   git clone https://github.com/okooo5km/memory-mcp-server.git
   cd memory-mcp-server

2. Build the project:

   swift build -c release

3. Install the binary:

   # Install to user directory (recommended, no sudo required)
   mkdir -p ~/.local/bin
   cp $(swift build -c release --show-bin-path)/memory-mcp-server ~/.local/bin/

Make sure `~/.local/bin` is in your PATH by adding to your shell configuration file:

   echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc  # or ~/.bashrc
   source ~/.zshrc  # or source ~/.bashrc

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 313 lines · 1 finding marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Memory MCP Server
  2. > A Model Context Protocol server that provides knowledge graph management capabilities. This server enables LLMs to create, read, update, and delete entities and relations in a persistent knowledge graph, helping AI assistants maintain memory across conversations. This is a Swift implementation of the official [TypeScript Memory MCP Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory).
  3. **Note:** This Swift version requires **macOS 14.0 or later**. For broader platform support (including Windows, Linux, and macOS 11.0+), check out the Go language implementation: **[memory-mcp-server-go](https://github.com/okooo5km/memory-mcp-server-go)**.
  4. ![Swift Platform](https://img.shields.io/badge/platform-macOS-lightgrey)
  5. ![License](https://img.shields.io/badge/license-MIT-blue)
  6. ## ✨ Features
  7. * **Knowledge Graph Storage**: Maintain a persistent graph of entities and their relationships
  8. * **Entity Management**: Create, retrieve, update, and delete entities with custom types
  9. * **Relation Tracking**: Define and manage relationships between entities in active voice
  10. * **Observation System**: Add and remove observations about entities over time
  11. * **Powerful Search**: Find relevant nodes by name, type, or observation content
  12. * **Persistent Storage**: Data persists between sessions in a simple JSON format
  13. ## Available Tools
  14. * `create_entities` - Create multiple new entities in the knowledge graph
  15. * `entities` (array, required): Array of entity objects to create
  16. * `name` (string): The name of the entity
  17. * `entityType` (string): The type of the entity
  18. * `observations` (array of strings): Observations associated with the entity
  19. * `create_relations` - Create multiple new relations between entities
  20. * `relations` (array, required): Array of relation objects
  21. * `from` (string): The name of the entity where the relation starts
  22. * `to` (string): The name of the entity where the relation ends
  23. * `relationType` (string): The type of the relation (in active voice)
  24. * `add_observations` - Add new observations to existing entities
  25. * `observations` (array, required): Array of observation additions
  26. * `entityName` (string): The name of the entity to add observations to
  27. * `contents` (array of strings): The observations to add
  28. * `delete_entities` - Delete multiple entities and their associated relations
  29. * `entityNames` (array, required): Array of entity names to delete
  30. * `delete_observations` - Delete specific observations from entities
  31. * `deletions` (array, required): Array of observation deletions
  32. * `entityName` (string): The name of the entity containing the observations
  33. * `observations` (array of strings): The observations to delete
  34. * `delete_relations` - Delete multiple relations from the knowledge graph
  35. * `relations` (array, required): Array of relation objects to delete
  36. * `from` (string): The source entity name
  37. * `to` (string): The target entity name
  38. * `relationType` (string): The relation type
  39. * `read_graph` - Read the entire knowledge graph
  40. * No parameters required
  41. * `search_nodes` - Search for nodes in the knowledge graph based on a query
  42. * `query` (string, required): Search query to match against entity names, types, and observations
  43. * `open_nodes` - Open specific nodes in the knowledge graph by their names
  44. * `names` (array, required): Array of entity names to retrieve
  45. ## Installation
  46. ### Option 1: One-Line Installation (curl)
  47. The easiest way to install is with the one-line installer, which automatically downloads the latest version and installs it to `~/.local/bin` in your home directory:
  48. ```bash
  49. curl -fsSL https://raw.githubusercontent.com/okooo5km/memory-mcp-server/main/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 68 on GitHub
  50. ```
  51. The installer will:
  52. * Create `~/.local/bin` if it doesn't exist
  53. * Add this directory to your PATH (in .zshrc or .bashrc)
  54. * Download and install the latest version
  55. * Make the binary executable
  56. ### Option 2: Build from Source
  57. 1. Clone the repository:
  58. ```bash
  59. git clone https://github.com/okooo5km/memory-mcp-server.git
  60. cd memory-mcp-server
  61. ```
  62. 2. Build the project:
  63. ```bash
  64. swift build -c release
  65. ```
  66. 3. Install the binary:
  67. ```bash
  68. # Install to user directory (recommended, no sudo required)
  69. mkdir -p ~/.local/bin
  70. cp $(swift build -c release --show-bin-path)/memory-mcp-server ~/.local/bin/
  71. ```
  72. Make sure `~/.local/bin` is in your PATH by adding to your shell configuration file:
  73. ```bash
  74. echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
  75. source ~/.zshrc # or source ~/.bashrc
  76. ```
  77. ## Command Line Arguments
  78. The server supports the following command line arguments:
  79. * `-h, --help`: Display help information about the server, its usage, and available options
  80. * `-v, --version`: Display the version number of the memory-mcp-server
  81. Example usage:
  82. ```bash
  83. # Display help information
  84. memory-mcp-server --help
  85. # Display version information
  86. memory-mcp-server --version
  87. ```
  88. ## Configuration
  89. ### Environment Variables
  90. The server supports the following environment variables:
  91. * `MEMORY_FILE_PATH`: Custom path for storing the knowledge graph (optional)
  92. * If not specified, defaults to `memory.json` in the current working directory
  93. * Can be an absolute path or relative to the current working directory
  94. You can check the configured file path in the server logs when starting the server.
  95. ```bash
  96. export MEMORY_FILE_PATH="/path/to/your/memory.json"
  97. ```
  98. ### Configure for Claude.app
  99. Add to your Claude settings:
  100. ```json
  101. "mcpServers": {
  102. "memory": {
  103. "command": "memory-mcp-server",
  104. "env": {
  105. "MEMORY_FILE_PATH": "/path/to/your/memory.json"
  106. }
  107. }
  108. }
  109. ```
  110. ### Configure for Cursor
  111. Add the following configuration to your Cursor editor's Settings - mcp.json:
  112. ```json
  113. {
  114. "mcpServers": {
  115. "memory": {
  116. "command": "memory-mcp-server",
  117. "env": {
  118. "MEMORY_FILE_PATH": "/path/to/your/memory.json"
  119. }
  120. }
  121. }
  122. }
  123. ```
  124. ![cursor-settings](screenshots/cursor.webp)
  125. ### Configure for Chatwise
  126. Add the memory MCP server to your Chatwise Settings - Tools.
  127. ![chatwise-settings-tools](screenshots/chatwise.webp)
  128. ### Example System Prompt
  129. You can use the following system prompt to help Claude utilize the memory-mcp-server effectively:
  130. ```
  131. You have access to a Knowledge Graph memory system, which can store and retrieve information across conversations. Use it to remember important details about the user, their preferences, and any facts they've shared.
  132. When you discover important information, save it using memory tools:
  133. - `create_entities` to add new people, places, or concepts
  134. - `create_relations` to record how entities relate to each other
  135. - `add_observations` to record facts about existing entities
  136. Before answering questions that might require past context, check your memory:
  137. - `search_nodes` to find relevant information
  138. - `open_nodes` to retrieve specific entities
  139. - `read_graph` to get a complete view of your knowledge
  140. Always prioritize information from your memory when responding to the user, especially when they reference past conversations.
  141. ```
  142. ## Development Requirements
  143. * Swift 6.0 or later
  144. * macOS 14.0 or later
  145. * MCP Swift SDK 0.2.0 or later
  146. ## Knowledge Graph Structure
  147. The Memory MCP Server uses a simple graph structure to store knowledge:
  148. * **Entities**: Nodes in the graph with a name, type, and list of observations
  149. * **Relations**: Edges between entities with a relation type in active voice
  150. * **Observations**: Facts or details associated with entities
  151. The knowledge graph is persisted to disk as a line-delimited JSON file, where each line is either an entity or relation object.
  152. ## Usage Examples
  153. ### Creating Entities
  154. ```json
  155. {
  156. "entities": [
  157. {
  158. "name": "John Smith",
  159. "entityType": "Person",
  160. "observations": ["Software engineer", "Lives in San Francisco", "Enjoys hiking"]
  161. },
  162. {
  163. "name": "Acme Corp",
  164. "entityType": "Company",
  165. "observations": ["Founded in 2010", "Tech startup"]
  166. }
  167. ]
  168. }
  169. ```
  170. ### Creating Relations
  171. ```json
  172. {
  173. "relations": [
  174. {
  175. "from": "John Smith",
  176. "to": "Acme Corp",
  177. "relationType": "works at"
  178. }
  179. ]
  180. }
  181. ```
  182. ### Adding Observations
  183. ```json
  184. {
  185. "observations": [
  186. {
  187. "entityName": "John Smith",
  188. "contents": ["Recently promoted to Senior Engineer", "Working on AI projects"]
  189. }
  190. ]
  191. }
  192. ```
  193. ### Searching Nodes
  194. ```json
  195. {
  196. "query": "San Francisco"
  197. }
  198. ```
  199. ### Opening Specific Nodes
  200. ```json
  201. {
  202. "names": ["John Smith", "Acme Corp"]
  203. }
  204. ```
  205. ## Use Cases
  206. * **Long-term Memory for AI Assistants**: Enable AI assistants to remember user preferences, past interactions, and important facts
  207. * **Knowledge Management**: Organize information about people, places, events, and concepts
  208. * **Relationship Tracking**: Maintain networks of relationships between entities
  209. * **Context Persistence**: Preserve important context across multiple sessions
  210. * **Journal and Daily Logs**: Maintain a structured record of events, activities, and reflections over time, making it easy to retrieve and relate past experiences chronologically
  211. ## Version History
  212. See GitHub Releases for version history and changelog.
  213. ## ☕️ Support the Project
  214. If you find Memory MCP Server helpful, please consider supporting its development:
  215. * ⭐️ Star the project on GitHub
  216. * 🐛 Report bugs or suggest features
  217. * 💝 Support via:
  218. <p align="center">
  219. <a href="https://buymeacoffee.com/okooo5km">
  220. <img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=okooo5km&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" style="border-radius: 8px;" />
  221. </a>
  222. </p>
  223. ## License
  224. memory-mcp-server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.
  225. ## About
  226. A Swift implementation of a knowledge graph memory server for Model Context Protocol (MCP), enabling persistent memory capabilities for large language models. This project is based on the [official TypeScript implementation](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) but rewritten in Swift using the MCP Swift SDK.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.