keep-mcp 0.1.0__tar.gz
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.
- keep_mcp-0.1.0/.example.env +3 -0
- keep_mcp-0.1.0/.gitignore +47 -0
- keep_mcp-0.1.0/.python-version +1 -0
- keep_mcp-0.1.0/LICENSE +21 -0
- keep_mcp-0.1.0/PKG-INFO +74 -0
- keep_mcp-0.1.0/README.md +33 -0
- keep_mcp-0.1.0/bin/keep-mcp.js +32 -0
- keep_mcp-0.1.0/pyproject.toml +37 -0
- keep_mcp-0.1.0/src/server/__init__.py +0 -0
- keep_mcp-0.1.0/src/server/__main__.py +4 -0
- keep_mcp-0.1.0/src/server/cli.py +43 -0
- keep_mcp-0.1.0/src/server/keep_api.py +79 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual Environment
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
|
|
28
|
+
# Environment variables
|
|
29
|
+
.env
|
|
30
|
+
.env.local
|
|
31
|
+
.env.development.local
|
|
32
|
+
.env.test.local
|
|
33
|
+
.env.production.local
|
|
34
|
+
|
|
35
|
+
# IDE specific files
|
|
36
|
+
.idea/
|
|
37
|
+
.vscode/
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
40
|
+
|
|
41
|
+
# OS specific files
|
|
42
|
+
.DS_Store
|
|
43
|
+
Thumbs.db
|
|
44
|
+
|
|
45
|
+
# Project specific
|
|
46
|
+
.cursor/
|
|
47
|
+
uv.lock
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.10
|
keep_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jannik Feuerhahn
|
|
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.
|
keep_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: keep-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP Server for Google Keep
|
|
5
|
+
Project-URL: Homepage, https://github.com/feuerdev/keep-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/feuerdev/keep-mcp
|
|
7
|
+
Author-email: Jannik Feuerhahn <jannik@feuer.dev>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2025 Jannik Feuerhahn
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Classifier: Development Status :: 4 - Beta
|
|
31
|
+
Classifier: Environment :: Console
|
|
32
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Classifier: Topic :: Utilities
|
|
37
|
+
Requires-Python: >=3.10
|
|
38
|
+
Requires-Dist: gkeepapi>=0.16.0
|
|
39
|
+
Requires-Dist: mcp[cli]
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# keep-mcp
|
|
43
|
+
|
|
44
|
+
MCP server for Google Keep
|
|
45
|
+
|
|
46
|
+
## How to use
|
|
47
|
+
|
|
48
|
+
1. Add the MCP server to your MCP servers:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"keep-mcp-pipx": {
|
|
53
|
+
"command": "pipx",
|
|
54
|
+
"args": [
|
|
55
|
+
"run",
|
|
56
|
+
"keep-mcp"
|
|
57
|
+
],
|
|
58
|
+
"env": {
|
|
59
|
+
"GOOGLE_EMAIL": "Your Google Email",
|
|
60
|
+
"GOOGLE_MASTER_TOKEN": "Your Google Master Token - see README.md"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. Add your credentials:
|
|
67
|
+
* `GOOGLE_EMAIL`: Your Google account email address
|
|
68
|
+
* `GOOGLE_MASTER_TOKEN`: Your Google account master token
|
|
69
|
+
|
|
70
|
+
Check https://gkeepapi.readthedocs.io/en/latest/#obtaining-a-master-token and https://github.com/simon-weber/gpsoauth?tab=readme-ov-file#alternative-flow for more information.
|
|
71
|
+
|
|
72
|
+
## Troubleshooting
|
|
73
|
+
|
|
74
|
+
* If you get "DeviceManagementRequiredOrSyncDisabled" check https://admin.google.com/ac/devices/settings/general and turn "Turn off mobile management (Unmanaged)"
|
keep_mcp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# keep-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for Google Keep
|
|
4
|
+
|
|
5
|
+
## How to use
|
|
6
|
+
|
|
7
|
+
1. Add the MCP server to your MCP servers:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
"mcpServers": {
|
|
11
|
+
"keep-mcp-pipx": {
|
|
12
|
+
"command": "pipx",
|
|
13
|
+
"args": [
|
|
14
|
+
"run",
|
|
15
|
+
"keep-mcp"
|
|
16
|
+
],
|
|
17
|
+
"env": {
|
|
18
|
+
"GOOGLE_EMAIL": "Your Google Email",
|
|
19
|
+
"GOOGLE_MASTER_TOKEN": "Your Google Master Token - see README.md"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. Add your credentials:
|
|
26
|
+
* `GOOGLE_EMAIL`: Your Google account email address
|
|
27
|
+
* `GOOGLE_MASTER_TOKEN`: Your Google account master token
|
|
28
|
+
|
|
29
|
+
Check https://gkeepapi.readthedocs.io/en/latest/#obtaining-a-master-token and https://github.com/simon-weber/gpsoauth?tab=readme-ov-file#alternative-flow for more information.
|
|
30
|
+
|
|
31
|
+
## Troubleshooting
|
|
32
|
+
|
|
33
|
+
* If you get "DeviceManagementRequiredOrSyncDisabled" check https://admin.google.com/ac/devices/settings/general and turn "Turn off mobile management (Unmanaged)"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
// Get the directory where the package is installed
|
|
8
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
9
|
+
|
|
10
|
+
// Find the Python script
|
|
11
|
+
const scriptPath = path.join(packageRoot, 'main.py');
|
|
12
|
+
if (!fs.existsSync(scriptPath)) {
|
|
13
|
+
console.error('Could not find main.py');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Run the Python script
|
|
18
|
+
const pythonProcess = spawn('python', [scriptPath], {
|
|
19
|
+
stdio: 'inherit' // This automatically handles all stdio forwarding
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Handle process exit
|
|
23
|
+
pythonProcess.on('exit', (code) => {
|
|
24
|
+
if (code !== 0) {
|
|
25
|
+
console.error(`Process exited with code ${code}`);
|
|
26
|
+
}
|
|
27
|
+
process.exit(code);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Forward termination signals to the Python process
|
|
31
|
+
process.on('SIGINT', () => pythonProcess.kill('SIGINT'));
|
|
32
|
+
process.on('SIGTERM', () => pythonProcess.kill('SIGTERM'));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "keep-mcp"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MCP Server for Google Keep"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"gkeepapi>=0.16.0",
|
|
9
|
+
"mcp[cli]",
|
|
10
|
+
]
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Jannik Feuerhahn", email = "jannik@feuer.dev" }
|
|
13
|
+
]
|
|
14
|
+
license = { file = "LICENSE" }
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: End Users/Desktop",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Topic :: Utilities",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/feuerdev/keep-mcp"
|
|
27
|
+
Repository = "https://github.com/feuerdev/keep-mcp"
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
mcp = "server.cli:main"
|
|
31
|
+
|
|
32
|
+
[build-system]
|
|
33
|
+
requires = ["hatchling >= 1.26"]
|
|
34
|
+
build-backend = "hatchling.build"
|
|
35
|
+
|
|
36
|
+
[tool.hatch.build.targets.wheel]
|
|
37
|
+
packages = ["src/server"]
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MCP plugin for Google Keep integration.
|
|
3
|
+
Provides tools for interacting with Google Keep notes through MCP.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from mcp.server.fastmcp import FastMCP
|
|
7
|
+
from .keep_api import get_notes, create_note
|
|
8
|
+
|
|
9
|
+
mcp = FastMCP("keep")
|
|
10
|
+
|
|
11
|
+
@mcp.resource("greeting://{name}")
|
|
12
|
+
def get_greeting(name: str) -> str:
|
|
13
|
+
"""Get a personalized greeting"""
|
|
14
|
+
return f"Hello, {name}!"
|
|
15
|
+
|
|
16
|
+
@mcp.resource("notes://all")
|
|
17
|
+
def get_all_notes() -> str:
|
|
18
|
+
"""Get all Google Keep notes as a resource"""
|
|
19
|
+
return get_notes()
|
|
20
|
+
|
|
21
|
+
@mcp.tool()
|
|
22
|
+
def create_keep_note(title: str, text: str, pinned: bool = False) -> str:
|
|
23
|
+
"""
|
|
24
|
+
Create a new Google Keep note.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
title (str): The title of the note
|
|
28
|
+
text (str): The content of the note
|
|
29
|
+
pinned (bool, optional): Whether the note should be pinned. Defaults to False.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
str: JSON string containing the created note's data
|
|
33
|
+
"""
|
|
34
|
+
return create_note(title, text, pinned)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def main():
|
|
38
|
+
mcp.run(transport='stdio')
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
main()
|
|
43
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import gkeepapi
|
|
2
|
+
import json
|
|
3
|
+
import sys
|
|
4
|
+
import os
|
|
5
|
+
from dotenv import load_dotenv
|
|
6
|
+
|
|
7
|
+
def get_notes():
|
|
8
|
+
# Load environment variables
|
|
9
|
+
load_dotenv()
|
|
10
|
+
|
|
11
|
+
# Get credentials from environment variables
|
|
12
|
+
email = os.getenv('GOOGLE_EMAIL')
|
|
13
|
+
master_token = os.getenv('GOOGLE_MASTER_TOKEN')
|
|
14
|
+
|
|
15
|
+
if not email or not master_token:
|
|
16
|
+
raise ValueError("Missing credentials in environment variables")
|
|
17
|
+
|
|
18
|
+
# Initialize the Keep API
|
|
19
|
+
keep = gkeepapi.Keep()
|
|
20
|
+
|
|
21
|
+
# Authenticate
|
|
22
|
+
keep.authenticate(email, master_token)
|
|
23
|
+
|
|
24
|
+
# Get all notes
|
|
25
|
+
notes = keep.all()
|
|
26
|
+
|
|
27
|
+
# Convert notes to a serializable format
|
|
28
|
+
notes_data = []
|
|
29
|
+
for note in notes:
|
|
30
|
+
notes_data.append({
|
|
31
|
+
'id': note.id,
|
|
32
|
+
'title': note.title,
|
|
33
|
+
'text': note.text,
|
|
34
|
+
'pinned': note.pinned,
|
|
35
|
+
'archived': note.archived,
|
|
36
|
+
'color': note.color.value if note.color else None,
|
|
37
|
+
'labels': [label.name for label in note.labels.all()]
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
# Return the JSON string
|
|
41
|
+
return json.dumps(notes_data)
|
|
42
|
+
|
|
43
|
+
def create_note(title: str, text: str, pinned: bool = False) -> str:
|
|
44
|
+
# Load environment variables
|
|
45
|
+
load_dotenv()
|
|
46
|
+
|
|
47
|
+
# Get credentials from environment variables
|
|
48
|
+
email = os.getenv('GOOGLE_EMAIL')
|
|
49
|
+
master_token = os.getenv('GOOGLE_MASTER_TOKEN')
|
|
50
|
+
|
|
51
|
+
if not email or not master_token:
|
|
52
|
+
raise ValueError("Missing credentials in environment variables")
|
|
53
|
+
|
|
54
|
+
# Initialize the Keep API
|
|
55
|
+
keep = gkeepapi.Keep()
|
|
56
|
+
|
|
57
|
+
# Authenticate
|
|
58
|
+
keep.authenticate(email, master_token)
|
|
59
|
+
|
|
60
|
+
# Create a new note
|
|
61
|
+
note = keep.createNote(title, text)
|
|
62
|
+
note.pinned = pinned
|
|
63
|
+
|
|
64
|
+
# Sync changes
|
|
65
|
+
keep.sync()
|
|
66
|
+
|
|
67
|
+
# Return the created note's data
|
|
68
|
+
return json.dumps({
|
|
69
|
+
'id': note.id,
|
|
70
|
+
'title': note.title,
|
|
71
|
+
'text': note.text,
|
|
72
|
+
'pinned': note.pinned,
|
|
73
|
+
'archived': note.archived,
|
|
74
|
+
'color': note.color.value if note.color else None,
|
|
75
|
+
'labels': [label.name for label in note.labels.all()]
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
if __name__ == '__main__':
|
|
79
|
+
print(get_notes())
|