engram-notion-mcp 0.1.0 → 1.0.0-rc.0
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.
- package/README.md +245 -0
- package/dist/index.js +18808 -0
- package/package.json +35 -7
- package/scripts/release.ts +76 -0
- package/src/{index.js → index.ts} +122 -81
- package/tsconfig.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# Engram Notion MCP - Semantic Memory for AI Agents
|
|
2
|
+
|
|
3
|
+
**Engram Notion MCP** is a powerful Model Context Protocol (MCP) server that gives your AI agents a **permanent, semantic memory**. It seamlessly integrates with [Notion](https://notion.so) to store, retrieve, and organize information, turning your workspace into an intelligent knowledge base.
|
|
4
|
+
|
|
5
|
+
> 🧠 **Why Engram?**
|
|
6
|
+
> AI Agents often suffer from amnesia. Engram solves this by providing a persistent memory layer backed by Notion's robust database structure.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 📦 Features
|
|
11
|
+
|
|
12
|
+
### Notion Integration
|
|
13
|
+
| Feature | Tool Name | Description |
|
|
14
|
+
| :--- | :--- | :--- |
|
|
15
|
+
| **Page Creation** | `create_page` | Create new pages with content. Supports explicit parent IDs or defaults. |
|
|
16
|
+
| **Page Updates** | `update_page` | Append content to existing pages. |
|
|
17
|
+
| **Logging** | `log_to_notion` | Fast logging wrapper for appending notes/logs. |
|
|
18
|
+
| **Reading** | `read_page_content` | Read and parse page content into Agent-friendly text. |
|
|
19
|
+
| **Databases** | `list_databases` | detailed list of accessible databases. |
|
|
20
|
+
| **Querying** | `query_database` | Query databases with filters to find specific items. |
|
|
21
|
+
| **Organization** | `list_sub_pages` | List pages within a parent page. |
|
|
22
|
+
| **Cleanup** | `delete_block` | Archive/Delete blocks or pages. |
|
|
23
|
+
|
|
24
|
+
### Semantic Memory (SQLite)
|
|
25
|
+
| Feature | Tool Name | Description |
|
|
26
|
+
| :--- | :--- | :--- |
|
|
27
|
+
| **Store Facts** | `remember_fact` | Saves key info to internal vector-like storage. |
|
|
28
|
+
| **Search** | `search_memory` | Full-text search over stored memories. |
|
|
29
|
+
| **Recall** | `get_recent_memories`| Retrieve the latest context/facts. |
|
|
30
|
+
|
|
31
|
+
### Operations
|
|
32
|
+
| Feature | Tool Name | Description |
|
|
33
|
+
| :--- | :--- | :--- |
|
|
34
|
+
| **Alerts** | `send_alert` | Send push notifications via Telegram. |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 🛠 Configuration
|
|
39
|
+
|
|
40
|
+
To use Engram Notion MCP, you need to set up your environment variables.
|
|
41
|
+
|
|
42
|
+
| Variable | Required | Description |
|
|
43
|
+
| :--- | :--- | :--- |
|
|
44
|
+
| `NOTION_API_KEY` | **Yes** | Your Notion Internal Integration Token (`secret_...`). |
|
|
45
|
+
| `NOTION_PAGE_ID` | No | Default Page ID for creating pages if no parent is specified. |
|
|
46
|
+
| `TELEGRAM_BOT_TOKEN`| No | For `send_alert` tool. |
|
|
47
|
+
| `TELEGRAM_CHAT_ID` | No | For `send_alert` tool. |
|
|
48
|
+
| `AGENT_MEMORY_PATH` | No | Custom path for the SQLite memory database. |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
> ### 💡 Quick Setup Tips
|
|
53
|
+
> <details>
|
|
54
|
+
> <summary>
|
|
55
|
+
> <strong>🔑 How to get Notion API Key</strong>
|
|
56
|
+
> </summary>
|
|
57
|
+
>
|
|
58
|
+
> 1. Go to [Notion My Integrations](https://www.notion.so/my-integrations).
|
|
59
|
+
> 2. Click **New integration**.
|
|
60
|
+
> 3. Name it (e.g., "Engram Notion MCP") and submit.
|
|
61
|
+
> 4. Copy the **Internal Integration Secret**. this is your `NOTION_API_KEY`.
|
|
62
|
+
> </details>
|
|
63
|
+
>
|
|
64
|
+
> <details>
|
|
65
|
+
> <summary>
|
|
66
|
+
> <strong>🤖 How to get Telegram Bot Token & Chat ID</strong>
|
|
67
|
+
> </summary>
|
|
68
|
+
>
|
|
69
|
+
> 1. **Bot Token**:
|
|
70
|
+
> - Open Telegram and search for **@BotFather**.
|
|
71
|
+
> - Send the command `/newbot`.
|
|
72
|
+
> - Follow the prompts to name your bot.
|
|
73
|
+
> - Copy the **HTTP API Token**.
|
|
74
|
+
>
|
|
75
|
+
> 2. **Chat ID**:
|
|
76
|
+
> - Search for **@userinfobot** in Telegram.
|
|
77
|
+
> - Click Start or send `/start`.
|
|
78
|
+
> - It will reply with your **Id**. Copy this number.
|
|
79
|
+
> </details>
|
|
80
|
+
>
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### Configuration Patterns
|
|
85
|
+
|
|
86
|
+
#### 1. Minimal Setup (Flexible / Unbound)
|
|
87
|
+
You can omit `NOTION_PAGE_ID` to keep the agent "unbound". It will force the agent to ask for a destination or search for one.
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
"env": {
|
|
91
|
+
"NOTION_API_KEY": "secret_your_key_here"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### 2. Multi-Page Support
|
|
96
|
+
You don't need to configure an array of IDs. **Engram relies on Notion's native permissions.**
|
|
97
|
+
To give the agent access to multiple specific pages:
|
|
98
|
+
1. Open any page in Notion.
|
|
99
|
+
2. Click the **... (three dots)** menu (top-right) -> **Connections**.
|
|
100
|
+
3. Look for the name you gave your integration (e.g., "Engram Notion MCP").
|
|
101
|
+
4. Once connected, the agent can automatically see this page using the `list_accessible_pages` tool.
|
|
102
|
+
5. **Repeat this** for any other page you want the agent to see.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 🔌 Installation & Client Setup Instructions
|
|
107
|
+
|
|
108
|
+
<details open>
|
|
109
|
+
<summary>
|
|
110
|
+
<h3 style="display: inline-block;"> ⚡ Recommended (Fastest) - Bun</h3>
|
|
111
|
+
</summary>
|
|
112
|
+
|
|
113
|
+
Use `bunx` to run the server with native performance (`bun:sqlite`).
|
|
114
|
+
|
|
115
|
+
Add this to your `claude_desktop_config.json` or `mcp.json`.
|
|
116
|
+
|
|
117
|
+
**Config using `bunx` (Recommended):**
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"mcpServers": {
|
|
121
|
+
"engram-notion-mcp": {
|
|
122
|
+
"command": "bunx",
|
|
123
|
+
"args": ["engram-notion-mcp"],
|
|
124
|
+
"env": {
|
|
125
|
+
"NOTION_API_KEY": "secret_your_key_here"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
</details>
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary>
|
|
137
|
+
<h3 style="display: inline-block;"> 🐢 Standard - Node.js (NPX)</h3>
|
|
138
|
+
</summary>
|
|
139
|
+
|
|
140
|
+
Works with any standard Node.js environment (`better-sqlite3`).
|
|
141
|
+
|
|
142
|
+
Add this to your `claude_desktop_config.json` or `mcp.json`.
|
|
143
|
+
|
|
144
|
+
**Config using `npx` (Standard):**
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"engram-notion-mcp": {
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["-y", "engram-notion-mcp"],
|
|
151
|
+
"env": {
|
|
152
|
+
"NOTION_API_KEY": "secret_your_key_here"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
</details>
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
<details>
|
|
163
|
+
<summary>
|
|
164
|
+
<h3 style="display: inline-block;"> 🐍 Alternative - Python (UVX / PIPX)</h3>
|
|
165
|
+
</summary>
|
|
166
|
+
|
|
167
|
+
If you prefer `uvx` or `pipx` or have strict Python environments:
|
|
168
|
+
|
|
169
|
+
Add this to your `claude_desktop_config.json` or `mcp.json`.
|
|
170
|
+
|
|
171
|
+
**Config using `uvx` (Alternative):**
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"mcpServers": {
|
|
175
|
+
"engram-notion-mcp": {
|
|
176
|
+
"command": "uvx",
|
|
177
|
+
"args": ["engram-notion-mcp"],
|
|
178
|
+
"env": {
|
|
179
|
+
"NOTION_API_KEY": "secret_your_key_here"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
**Config using `pipx` (Alternative):**
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"mcpServers": {
|
|
193
|
+
"engram-notion-mcp": {
|
|
194
|
+
"command": "pipx",
|
|
195
|
+
"args": ["run", "engram-notion-mcp"],
|
|
196
|
+
"env": { ... }
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
</details>
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
**Where to put it:**
|
|
206
|
+
- **🖥️ Desktop Apps (Claude Desktop): `claude_desktop_config.json`**
|
|
207
|
+
- **🆚 VS Code / Cursor / Windsurf**: User Settings (`settings.json`).
|
|
208
|
+
- **Cline / Roo Code**: Extension Settings -> MCP Servers.
|
|
209
|
+
- **Kilo Code**: `.kilo/config.json`.
|
|
210
|
+
- **⌨️ Gemini CLI:**
|
|
211
|
+
<details>
|
|
212
|
+
<summary>
|
|
213
|
+
<strong>Bun (Recommended)</strong>
|
|
214
|
+
</summary>
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
gemini mcp add engram-notion-mcp bunx "engram-notion-mcp" -e NOTION_API_KEY=<your_secret_key>
|
|
218
|
+
```
|
|
219
|
+
</details>
|
|
220
|
+
|
|
221
|
+
<details>
|
|
222
|
+
<summary>
|
|
223
|
+
<strong>Node.js - NPX (Standard)</strong>
|
|
224
|
+
</summary>
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
gemini mcp add engram node "npx engram-notion-mcp" -e NOTION_API_KEY=<your_secret_key>
|
|
228
|
+
```
|
|
229
|
+
</details>
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 💬 Support & Feedback
|
|
234
|
+
If you face any issues or have suggestions, please feel free to:
|
|
235
|
+
- Open an issue on this [GitHub Repository](https://github.com/shubhamomar/engram-notion-mcp/issues).
|
|
236
|
+
- Reach out to me directly via my GitHub profile.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Quick Links
|
|
241
|
+
|
|
242
|
+
This MCP tool is published as a package on NPM and PyPI.
|
|
243
|
+
|
|
244
|
+
- [Bun / Node.js Package on NPM](https://www.npmjs.com/package/engram-notion-mcp)
|
|
245
|
+
- [Python Package on PyPI](https://pypi.org/project/engram-notion-mcp/)
|