mnemos-capture 1.0.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/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/cli/index.js +54 -0
- package/dist/cli/mcp-server.js +74 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sofía Padrón Valdez
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Mnemos
|
|
2
|
+
|
|
3
|
+
**Stop saving things you'll never apply.**
|
|
4
|
+
|
|
5
|
+
Mnemos is a knowledge capture tool for builders who use AI agents. Paste any resource — article, thread, transcript, notes — and an LLM extracts the insight, tags where it applies, and stores it in a GitHub repo you own. Your AI tools (Claude Code, or any MCP-compatible agent) can then pull from that repo directly.
|
|
6
|
+
|
|
7
|
+
Every capture has an **"Applied to"** field — a concrete connection between what you learned and what you're building. Knowledge doesn't sit in a saved-for-later graveyard. It feeds your workflows.
|
|
8
|
+
|
|
9
|
+
## Get started
|
|
10
|
+
|
|
11
|
+
### 1. Sign up (30 seconds)
|
|
12
|
+
|
|
13
|
+
Go to **[mnemos-capture.vercel.app](https://mnemos-capture.vercel.app)** → **Sign in with GitHub**.
|
|
14
|
+
|
|
15
|
+
During setup, Mnemos:
|
|
16
|
+
- Creates a knowledge repo in your GitHub account (you own it, it's just Markdown files)
|
|
17
|
+
- Asks for your Anthropic API key (your key, stored in the database — Mnemos never pays for your API calls)
|
|
18
|
+
- Sets a PIN for quick mobile access
|
|
19
|
+
|
|
20
|
+
No config files. No CLI setup. No cloning repos.
|
|
21
|
+
|
|
22
|
+
### 2. Capture something
|
|
23
|
+
|
|
24
|
+
Open the app on any device (phone, tablet, desktop), paste content, hit **Capture**. That's it.
|
|
25
|
+
|
|
26
|
+
**What the LLM extracts from each capture:**
|
|
27
|
+
- **Core idea** — the actual insight, not a summary
|
|
28
|
+
- **Key takeaways** — specific, opinionated, actionable
|
|
29
|
+
- **Quotes** — only genuinely quotable lines
|
|
30
|
+
- **Mode tags** — where this applies (career, work, founder, life)
|
|
31
|
+
- **Applied to** — one sentence connecting this to something you're building right now
|
|
32
|
+
|
|
33
|
+
The result is auto-committed to your GitHub knowledge repo as a Markdown file.
|
|
34
|
+
|
|
35
|
+
### 3. Connect to Claude Code (optional)
|
|
36
|
+
|
|
37
|
+
After signing up, you get an API key. This lets you connect Mnemos to Claude Code so your agent can capture and search knowledge without leaving the terminal.
|
|
38
|
+
|
|
39
|
+
Run this once in your terminal:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
claude mcp add mnemos -- npx mnemos-capture serve-mcp --key <your-api-key>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This installs a small bridge that connects Claude Code to the hosted Mnemos app. Now you can say things like:
|
|
46
|
+
- *"Capture this article about prompt caching"*
|
|
47
|
+
- *"What's in my inbox?"*
|
|
48
|
+
- *"Search my captures for evaluation frameworks"*
|
|
49
|
+
|
|
50
|
+
> **What's happening under the hood:** `npx mnemos-capture serve-mcp` runs a lightweight local process that translates between Claude Code's stdio protocol and the Mnemos HTTP API. Your API key authenticates the requests. No data is stored locally — everything goes to your GitHub repo via the hosted app.
|
|
51
|
+
|
|
52
|
+
## How it works
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
You find something valuable
|
|
56
|
+
↓
|
|
57
|
+
Open Mnemos → paste it → hit Capture
|
|
58
|
+
↓
|
|
59
|
+
LLM extracts: core idea · takeaways · quotes · context tags · applied to
|
|
60
|
+
↓
|
|
61
|
+
Structured Markdown committed to your GitHub knowledge repo
|
|
62
|
+
↓
|
|
63
|
+
Your AI tools pull from it via MCP or by reading the repo directly
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Mobile access
|
|
67
|
+
|
|
68
|
+
Mnemos is a PWA (Progressive Web App). On your phone: open the app URL in Safari or Chrome → Share → **Add to Home Screen**. It looks and feels like a native app — instant capture from anywhere.
|
|
69
|
+
|
|
70
|
+
## Why GitHub as storage?
|
|
71
|
+
|
|
72
|
+
Your knowledge lives in a repo you own. No proprietary database, no vendor lock-in. It's version-controlled, portable, and readable as plain Markdown. Clone it, search it with `grep`, back it up — it's just files. And because it's a standard Git repo, any MCP-compatible agent or tool can read from it.
|
|
73
|
+
|
|
74
|
+
## Tech stack
|
|
75
|
+
|
|
76
|
+
Next.js · TypeScript (strict) · Anthropic SDK · GitHub OAuth · Vercel Postgres (Neon) · GitHub API · MCP protocol · Tailwind CSS
|
|
77
|
+
|
|
78
|
+
## Roadmap
|
|
79
|
+
|
|
80
|
+
- [ ] Multi-provider support (OpenAI, Google — schema is ready, extraction code needs updating)
|
|
81
|
+
- [ ] Batch capture (multiple resources at once)
|
|
82
|
+
- [ ] URL auto-fetch (paste a link, Mnemos fetches the content)
|
|
83
|
+
- [ ] Full-text search across knowledge hub
|
|
84
|
+
- [ ] Browser extension for one-click capture
|
|
85
|
+
- [ ] Settings page (change API key, repo, regenerate MCP key)
|
|
86
|
+
- [ ] Team knowledge hubs (shared captures)
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const HOSTED_URL = "https://mnemos-capture.vercel.app";
|
|
3
|
+
async function main() {
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
const command = args[0];
|
|
6
|
+
if (command === "help" || command === "--help" || command === "-h") {
|
|
7
|
+
printHelp();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (command === "serve-mcp") {
|
|
11
|
+
// MCP server mode — proxies to hosted instance
|
|
12
|
+
const { serveMcp } = await import("./mcp-server.js");
|
|
13
|
+
await serveMcp();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
// Default: open the hosted app
|
|
17
|
+
console.log("");
|
|
18
|
+
console.log(" Mnemos — Knowledge capture for agentic workflows\n");
|
|
19
|
+
console.log(` Open ${HOSTED_URL} to start capturing.`);
|
|
20
|
+
console.log("");
|
|
21
|
+
console.log(" First time? Sign in with GitHub — setup takes 30 seconds.");
|
|
22
|
+
console.log("");
|
|
23
|
+
console.log(" Connect to Claude Code:");
|
|
24
|
+
console.log(" claude mcp add mnemos -- npx mnemos-capture serve-mcp --key YOUR_API_KEY");
|
|
25
|
+
console.log("");
|
|
26
|
+
// Try to open the URL in the default browser
|
|
27
|
+
const { exec } = await import("child_process");
|
|
28
|
+
const openCmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
29
|
+
exec(`${openCmd} ${HOSTED_URL}`);
|
|
30
|
+
}
|
|
31
|
+
function printHelp() {
|
|
32
|
+
console.log(`
|
|
33
|
+
Mnemos — Knowledge capture for agentic workflows
|
|
34
|
+
|
|
35
|
+
Usage:
|
|
36
|
+
npx mnemos-capture Open Mnemos in your browser
|
|
37
|
+
npx mnemos-capture serve-mcp Start the MCP server for Claude Code
|
|
38
|
+
npx mnemos-capture help Show this help
|
|
39
|
+
|
|
40
|
+
Get started:
|
|
41
|
+
1. Run: npx mnemos-capture
|
|
42
|
+
2. Sign in with GitHub (creates your knowledge repo automatically)
|
|
43
|
+
3. Set a PIN for quick mobile access
|
|
44
|
+
4. Start capturing!
|
|
45
|
+
|
|
46
|
+
Connect to Claude Code:
|
|
47
|
+
claude mcp add mnemos -- npx mnemos-capture serve-mcp --key YOUR_API_KEY
|
|
48
|
+
`);
|
|
49
|
+
}
|
|
50
|
+
main().catch((err) => {
|
|
51
|
+
console.error("Error:", err);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// MCP server that runs locally via stdio and proxies to the hosted Mnemos API.
|
|
2
|
+
// Used by Claude Code: claude mcp add mnemos -- npx mnemos serve-mcp --key <api-key>
|
|
3
|
+
const HOSTED_URL = "https://mnemos-capture.vercel.app/api/mcp";
|
|
4
|
+
function sendMessage(msg) {
|
|
5
|
+
const json = JSON.stringify(msg);
|
|
6
|
+
process.stdout.write(`Content-Length: ${Buffer.byteLength(json)}\r\n\r\n${json}`);
|
|
7
|
+
}
|
|
8
|
+
async function proxyToHosted(apiKey, msg) {
|
|
9
|
+
try {
|
|
10
|
+
const res = await fetch(HOSTED_URL, {
|
|
11
|
+
method: "POST",
|
|
12
|
+
headers: {
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
Authorization: `Bearer ${apiKey}`,
|
|
15
|
+
},
|
|
16
|
+
body: JSON.stringify(msg),
|
|
17
|
+
});
|
|
18
|
+
const data = (await res.json());
|
|
19
|
+
sendMessage(data);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
sendMessage({
|
|
23
|
+
jsonrpc: "2.0",
|
|
24
|
+
id: msg.id,
|
|
25
|
+
error: { code: -32603, message: err instanceof Error ? err.message : "Proxy error" },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export async function serveMcp() {
|
|
30
|
+
// Parse --key flag
|
|
31
|
+
const args = process.argv.slice(2);
|
|
32
|
+
const keyIdx = args.indexOf("--key");
|
|
33
|
+
const apiKey = keyIdx !== -1 ? args[keyIdx + 1] : undefined;
|
|
34
|
+
if (!apiKey) {
|
|
35
|
+
process.stderr.write("\nMnemos MCP server requires an API key.\n");
|
|
36
|
+
process.stderr.write("Usage: npx mnemos serve-mcp --key <your-api-key>\n\n");
|
|
37
|
+
process.stderr.write("Get your API key at: https://mnemos-capture.vercel.app/onboard\n\n");
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
process.stderr.write("Mnemos MCP server starting (proxying to hosted instance)...\n");
|
|
41
|
+
let buffer = "";
|
|
42
|
+
process.stdin.setEncoding("utf-8");
|
|
43
|
+
process.stdin.on("data", (chunk) => {
|
|
44
|
+
buffer += chunk;
|
|
45
|
+
while (true) {
|
|
46
|
+
const headerEnd = buffer.indexOf("\r\n\r\n");
|
|
47
|
+
if (headerEnd === -1)
|
|
48
|
+
break;
|
|
49
|
+
const header = buffer.slice(0, headerEnd);
|
|
50
|
+
const match = header.match(/Content-Length:\s*(\d+)/i);
|
|
51
|
+
if (!match) {
|
|
52
|
+
buffer = buffer.slice(headerEnd + 4);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const contentLength = parseInt(match[1], 10);
|
|
56
|
+
const bodyStart = headerEnd + 4;
|
|
57
|
+
if (buffer.length < bodyStart + contentLength)
|
|
58
|
+
break;
|
|
59
|
+
const body = buffer.slice(bodyStart, bodyStart + contentLength);
|
|
60
|
+
buffer = buffer.slice(bodyStart + contentLength);
|
|
61
|
+
try {
|
|
62
|
+
const msg = JSON.parse(body);
|
|
63
|
+
// Handle notifications/initialized locally (no response needed)
|
|
64
|
+
if (msg.method === "notifications/initialized")
|
|
65
|
+
continue;
|
|
66
|
+
void proxyToHosted(apiKey, msg);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
process.stderr.write(`Failed to parse: ${body}\n`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
process.stdin.on("end", () => process.exit(0));
|
|
74
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mnemos-capture",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Zero-friction knowledge capture for agentic workflows. Paste anything → Claude extracts insights → auto-commits to your knowledge repo → your Claude Code workflow picks it up.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mnemos-capture": "./dist/cli/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "next dev",
|
|
11
|
+
"build": "next build",
|
|
12
|
+
"start": "next start",
|
|
13
|
+
"build:cli": "tsc -p cli/tsconfig.json",
|
|
14
|
+
"prepublishOnly": "npm run build:cli"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai",
|
|
18
|
+
"knowledge",
|
|
19
|
+
"capture",
|
|
20
|
+
"claude",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"mcp",
|
|
23
|
+
"agents",
|
|
24
|
+
"agentic",
|
|
25
|
+
"llm",
|
|
26
|
+
"workflow"
|
|
27
|
+
],
|
|
28
|
+
"author": "Sofía Padrón Valdez",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/Soph20/mnemos-capture.git"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/Soph20/mnemos-capture",
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/cli/",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"README.md"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@anthropic-ai/sdk": "^0.36.3",
|
|
42
|
+
"@vercel/postgres": "^0.10.0",
|
|
43
|
+
"next": "^16.1.6",
|
|
44
|
+
"react": "^19.0.0",
|
|
45
|
+
"react-dom": "^19.0.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^20",
|
|
49
|
+
"@types/react": "^19",
|
|
50
|
+
"@types/react-dom": "^19",
|
|
51
|
+
"autoprefixer": "^10.4.21",
|
|
52
|
+
"postcss": "^8.5.3",
|
|
53
|
+
"tailwindcss": "^3.4.17",
|
|
54
|
+
"typescript": "^5"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18"
|
|
58
|
+
}
|
|
59
|
+
}
|