mcp-server-notion 0.1.0__tar.gz → 0.2.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.
- mcp_server_notion-0.2.0/.cursor/mcp.json +10 -0
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/.gitignore +0 -0
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/.python-version +0 -0
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/Dockerfile +0 -0
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/LICENSE +0 -0
- mcp_server_notion-0.2.0/PKG-INFO +332 -0
- mcp_server_notion-0.2.0/README.md +312 -0
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/docker-compose.yml +0 -0
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/pyproject.toml +4 -4
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/src/mcp_server_notion/__init__.py +0 -0
- mcp_server_notion-0.2.0/src/mcp_server_notion/__main__.py +21 -0
- mcp_server_notion-0.2.0/src/mcp_server_notion/__token__.py +3 -0
- mcp_server_notion-0.2.0/src/mcp_server_notion/server.py +71 -0
- mcp_server_notion-0.2.0/tests/test_server.py +30 -0
- {mcp_server_notion-0.1.0 → mcp_server_notion-0.2.0}/uv.lock +0 -0
- mcp_server_notion-0.1.0/PKG-INFO +0 -107
- mcp_server_notion-0.1.0/README.md +0 -87
- mcp_server_notion-0.1.0/src/mcp_server_notion/__main__.py +0 -6
- mcp_server_notion-0.1.0/src/mcp_server_notion/server.py +0 -61
- mcp_server_notion-0.1.0/tests/test_server.py +0 -26
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,332 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: mcp-server-notion
|
3
|
+
Version: 0.2.0
|
4
|
+
Summary: A Model Context Protocol Tool for Notion integration and automation
|
5
|
+
Author: shpark
|
6
|
+
Maintainer-email: shpark <shp8019@gmail.com>
|
7
|
+
License: MIT
|
8
|
+
License-File: LICENSE
|
9
|
+
Keywords: automation,llm,mcp,notion,tool
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
11
|
+
Classifier: Intended Audience :: Developers
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
15
|
+
Requires-Python: >=3.10
|
16
|
+
Requires-Dist: mcp>=1.0.0
|
17
|
+
Requires-Dist: notion-client>=2.2.0
|
18
|
+
Requires-Dist: pydantic>=2.0.0
|
19
|
+
Description-Content-Type: text/markdown
|
20
|
+
|
21
|
+
# mcp-server-git: A git MCP server
|
22
|
+
|
23
|
+
## Overview
|
24
|
+
|
25
|
+
A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
|
26
|
+
|
27
|
+
Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.
|
28
|
+
|
29
|
+
### Tools
|
30
|
+
|
31
|
+
1. `git_status`
|
32
|
+
- Shows the working tree status
|
33
|
+
- Input:
|
34
|
+
- `repo_path` (string): Path to Git repository
|
35
|
+
- Returns: Current status of working directory as text output
|
36
|
+
|
37
|
+
2. `git_diff_unstaged`
|
38
|
+
- Shows changes in working directory not yet staged
|
39
|
+
- Input:
|
40
|
+
- `repo_path` (string): Path to Git repository
|
41
|
+
- Returns: Diff output of unstaged changes
|
42
|
+
|
43
|
+
3. `git_diff_staged`
|
44
|
+
- Shows changes that are staged for commit
|
45
|
+
- Input:
|
46
|
+
- `repo_path` (string): Path to Git repository
|
47
|
+
- Returns: Diff output of staged changes
|
48
|
+
|
49
|
+
4. `git_diff`
|
50
|
+
- Shows differences between branches or commits
|
51
|
+
- Inputs:
|
52
|
+
- `repo_path` (string): Path to Git repository
|
53
|
+
- `target` (string): Target branch or commit to compare with
|
54
|
+
- Returns: Diff output comparing current state with target
|
55
|
+
|
56
|
+
5. `git_commit`
|
57
|
+
- Records changes to the repository
|
58
|
+
- Inputs:
|
59
|
+
- `repo_path` (string): Path to Git repository
|
60
|
+
- `message` (string): Commit message
|
61
|
+
- Returns: Confirmation with new commit hash
|
62
|
+
|
63
|
+
6. `git_add`
|
64
|
+
- Adds file contents to the staging area
|
65
|
+
- Inputs:
|
66
|
+
- `repo_path` (string): Path to Git repository
|
67
|
+
- `files` (string[]): Array of file paths to stage
|
68
|
+
- Returns: Confirmation of staged files
|
69
|
+
|
70
|
+
7. `git_reset`
|
71
|
+
- Unstages all staged changes
|
72
|
+
- Input:
|
73
|
+
- `repo_path` (string): Path to Git repository
|
74
|
+
- Returns: Confirmation of reset operation
|
75
|
+
|
76
|
+
8. `git_log`
|
77
|
+
- Shows the commit logs
|
78
|
+
- Inputs:
|
79
|
+
- `repo_path` (string): Path to Git repository
|
80
|
+
- `max_count` (number, optional): Maximum number of commits to show (default: 10)
|
81
|
+
- Returns: Array of commit entries with hash, author, date, and message
|
82
|
+
|
83
|
+
9. `git_create_branch`
|
84
|
+
- Creates a new branch
|
85
|
+
- Inputs:
|
86
|
+
- `repo_path` (string): Path to Git repository
|
87
|
+
- `branch_name` (string): Name of the new branch
|
88
|
+
- `start_point` (string, optional): Starting point for the new branch
|
89
|
+
- Returns: Confirmation of branch creation
|
90
|
+
10. `git_checkout`
|
91
|
+
- Switches branches
|
92
|
+
- Inputs:
|
93
|
+
- `repo_path` (string): Path to Git repository
|
94
|
+
- `branch_name` (string): Name of branch to checkout
|
95
|
+
- Returns: Confirmation of branch switch
|
96
|
+
11. `git_show`
|
97
|
+
- Shows the contents of a commit
|
98
|
+
- Inputs:
|
99
|
+
- `repo_path` (string): Path to Git repository
|
100
|
+
- `revision` (string): The revision (commit hash, branch name, tag) to show
|
101
|
+
- Returns: Contents of the specified commit
|
102
|
+
12. `git_init`
|
103
|
+
- Initializes a Git repository
|
104
|
+
- Inputs:
|
105
|
+
- `repo_path` (string): Path to directory to initialize git repo
|
106
|
+
- Returns: Confirmation of repository initialization
|
107
|
+
|
108
|
+
## Installation
|
109
|
+
|
110
|
+
### Using uv (recommended)
|
111
|
+
|
112
|
+
When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
|
113
|
+
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-git*.
|
114
|
+
|
115
|
+
### Using PIP
|
116
|
+
|
117
|
+
Alternatively you can install `mcp-server-git` via pip:
|
118
|
+
|
119
|
+
```
|
120
|
+
pip install mcp-server-git
|
121
|
+
```
|
122
|
+
|
123
|
+
After installation, you can run it as a script using:
|
124
|
+
|
125
|
+
```
|
126
|
+
python -m mcp_server_git
|
127
|
+
```
|
128
|
+
|
129
|
+
## Configuration
|
130
|
+
|
131
|
+
### Usage with Claude Desktop
|
132
|
+
|
133
|
+
Add this to your `claude_desktop_config.json`:
|
134
|
+
|
135
|
+
<details>
|
136
|
+
<summary>Using uvx</summary>
|
137
|
+
|
138
|
+
```json
|
139
|
+
"mcpServers": {
|
140
|
+
"git": {
|
141
|
+
"command": "uvx",
|
142
|
+
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
|
143
|
+
}
|
144
|
+
}
|
145
|
+
```
|
146
|
+
</details>
|
147
|
+
|
148
|
+
<details>
|
149
|
+
<summary>Using docker</summary>
|
150
|
+
|
151
|
+
* Note: replace '/Users/username' with the a path that you want to be accessible by this tool
|
152
|
+
|
153
|
+
```json
|
154
|
+
"mcpServers": {
|
155
|
+
"git": {
|
156
|
+
"command": "docker",
|
157
|
+
"args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"]
|
158
|
+
}
|
159
|
+
}
|
160
|
+
```
|
161
|
+
</details>
|
162
|
+
|
163
|
+
<details>
|
164
|
+
<summary>Using pip installation</summary>
|
165
|
+
|
166
|
+
```json
|
167
|
+
"mcpServers": {
|
168
|
+
"git": {
|
169
|
+
"command": "python",
|
170
|
+
"args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
|
171
|
+
}
|
172
|
+
}
|
173
|
+
```
|
174
|
+
</details>
|
175
|
+
|
176
|
+
### Usage with VS Code
|
177
|
+
|
178
|
+
For quick installation, use one of the one-click install buttons below...
|
179
|
+
|
180
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D&quality=insiders)
|
181
|
+
|
182
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D&quality=insiders)
|
183
|
+
|
184
|
+
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`.
|
185
|
+
|
186
|
+
Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
|
187
|
+
|
188
|
+
> Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.
|
189
|
+
|
190
|
+
```json
|
191
|
+
{
|
192
|
+
"mcp": {
|
193
|
+
"servers": {
|
194
|
+
"git": {
|
195
|
+
"command": "uvx",
|
196
|
+
"args": ["mcp-server-git"]
|
197
|
+
}
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
```
|
202
|
+
|
203
|
+
For Docker installation:
|
204
|
+
|
205
|
+
```json
|
206
|
+
{
|
207
|
+
"mcp": {
|
208
|
+
"servers": {
|
209
|
+
"git": {
|
210
|
+
"command": "docker",
|
211
|
+
"args": [
|
212
|
+
"run",
|
213
|
+
"--rm",
|
214
|
+
"-i",
|
215
|
+
"--mount", "type=bind,src=${workspaceFolder},dst=/workspace",
|
216
|
+
"mcp/git"
|
217
|
+
]
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
```
|
223
|
+
|
224
|
+
### Usage with [Zed](https://github.com/zed-industries/zed)
|
225
|
+
|
226
|
+
Add to your Zed settings.json:
|
227
|
+
|
228
|
+
<details>
|
229
|
+
<summary>Using uvx</summary>
|
230
|
+
|
231
|
+
```json
|
232
|
+
"context_servers": [
|
233
|
+
"mcp-server-git": {
|
234
|
+
"command": {
|
235
|
+
"path": "uvx",
|
236
|
+
"args": ["mcp-server-git"]
|
237
|
+
}
|
238
|
+
}
|
239
|
+
],
|
240
|
+
```
|
241
|
+
</details>
|
242
|
+
|
243
|
+
<details>
|
244
|
+
<summary>Using pip installation</summary>
|
245
|
+
|
246
|
+
```json
|
247
|
+
"context_servers": {
|
248
|
+
"mcp-server-git": {
|
249
|
+
"command": {
|
250
|
+
"path": "python",
|
251
|
+
"args": ["-m", "mcp_server_git"]
|
252
|
+
}
|
253
|
+
}
|
254
|
+
},
|
255
|
+
```
|
256
|
+
</details>
|
257
|
+
|
258
|
+
## Debugging
|
259
|
+
|
260
|
+
You can use the MCP inspector to debug the server. For uvx installations:
|
261
|
+
|
262
|
+
```
|
263
|
+
npx @modelcontextprotocol/inspector uvx mcp-server-git
|
264
|
+
```
|
265
|
+
|
266
|
+
Or if you've installed the package in a specific directory or are developing on it:
|
267
|
+
|
268
|
+
```
|
269
|
+
cd path/to/servers/src/git
|
270
|
+
npx @modelcontextprotocol/inspector uv run mcp-server-git
|
271
|
+
```
|
272
|
+
|
273
|
+
Running `tail -n 20 -f ~/Library/Logs/Claude/mcp*.log` will show the logs from the server and may
|
274
|
+
help you debug any issues.
|
275
|
+
|
276
|
+
## Development
|
277
|
+
|
278
|
+
If you are doing local development, there are two ways to test your changes:
|
279
|
+
|
280
|
+
1. Run the MCP inspector to test your changes. See [Debugging](#debugging) for run instructions.
|
281
|
+
|
282
|
+
2. Test using the Claude desktop app. Add the following to your `claude_desktop_config.json`:
|
283
|
+
|
284
|
+
### Docker
|
285
|
+
|
286
|
+
```json
|
287
|
+
{
|
288
|
+
"mcpServers": {
|
289
|
+
"git": {
|
290
|
+
"command": "docker",
|
291
|
+
"args": [
|
292
|
+
"run",
|
293
|
+
"--rm",
|
294
|
+
"-i",
|
295
|
+
"--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
|
296
|
+
"--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
|
297
|
+
"--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
|
298
|
+
"mcp/git"
|
299
|
+
]
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
```
|
304
|
+
|
305
|
+
### UVX
|
306
|
+
```json
|
307
|
+
{
|
308
|
+
"mcpServers": {
|
309
|
+
"git": {
|
310
|
+
"command": "uv",
|
311
|
+
"args": [
|
312
|
+
"--directory",
|
313
|
+
"/<path to mcp-servers>/mcp-servers/src/git",
|
314
|
+
"run",
|
315
|
+
"mcp-server-git"
|
316
|
+
]
|
317
|
+
}
|
318
|
+
}
|
319
|
+
```
|
320
|
+
|
321
|
+
## Build
|
322
|
+
|
323
|
+
Docker build:
|
324
|
+
|
325
|
+
```bash
|
326
|
+
cd src/git
|
327
|
+
docker build -t mcp/git .
|
328
|
+
```
|
329
|
+
|
330
|
+
## License
|
331
|
+
|
332
|
+
This 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. For more details, please see the LICENSE file in the project repository.
|
@@ -0,0 +1,312 @@
|
|
1
|
+
# mcp-server-git: A git MCP server
|
2
|
+
|
3
|
+
## Overview
|
4
|
+
|
5
|
+
A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
|
6
|
+
|
7
|
+
Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.
|
8
|
+
|
9
|
+
### Tools
|
10
|
+
|
11
|
+
1. `git_status`
|
12
|
+
- Shows the working tree status
|
13
|
+
- Input:
|
14
|
+
- `repo_path` (string): Path to Git repository
|
15
|
+
- Returns: Current status of working directory as text output
|
16
|
+
|
17
|
+
2. `git_diff_unstaged`
|
18
|
+
- Shows changes in working directory not yet staged
|
19
|
+
- Input:
|
20
|
+
- `repo_path` (string): Path to Git repository
|
21
|
+
- Returns: Diff output of unstaged changes
|
22
|
+
|
23
|
+
3. `git_diff_staged`
|
24
|
+
- Shows changes that are staged for commit
|
25
|
+
- Input:
|
26
|
+
- `repo_path` (string): Path to Git repository
|
27
|
+
- Returns: Diff output of staged changes
|
28
|
+
|
29
|
+
4. `git_diff`
|
30
|
+
- Shows differences between branches or commits
|
31
|
+
- Inputs:
|
32
|
+
- `repo_path` (string): Path to Git repository
|
33
|
+
- `target` (string): Target branch or commit to compare with
|
34
|
+
- Returns: Diff output comparing current state with target
|
35
|
+
|
36
|
+
5. `git_commit`
|
37
|
+
- Records changes to the repository
|
38
|
+
- Inputs:
|
39
|
+
- `repo_path` (string): Path to Git repository
|
40
|
+
- `message` (string): Commit message
|
41
|
+
- Returns: Confirmation with new commit hash
|
42
|
+
|
43
|
+
6. `git_add`
|
44
|
+
- Adds file contents to the staging area
|
45
|
+
- Inputs:
|
46
|
+
- `repo_path` (string): Path to Git repository
|
47
|
+
- `files` (string[]): Array of file paths to stage
|
48
|
+
- Returns: Confirmation of staged files
|
49
|
+
|
50
|
+
7. `git_reset`
|
51
|
+
- Unstages all staged changes
|
52
|
+
- Input:
|
53
|
+
- `repo_path` (string): Path to Git repository
|
54
|
+
- Returns: Confirmation of reset operation
|
55
|
+
|
56
|
+
8. `git_log`
|
57
|
+
- Shows the commit logs
|
58
|
+
- Inputs:
|
59
|
+
- `repo_path` (string): Path to Git repository
|
60
|
+
- `max_count` (number, optional): Maximum number of commits to show (default: 10)
|
61
|
+
- Returns: Array of commit entries with hash, author, date, and message
|
62
|
+
|
63
|
+
9. `git_create_branch`
|
64
|
+
- Creates a new branch
|
65
|
+
- Inputs:
|
66
|
+
- `repo_path` (string): Path to Git repository
|
67
|
+
- `branch_name` (string): Name of the new branch
|
68
|
+
- `start_point` (string, optional): Starting point for the new branch
|
69
|
+
- Returns: Confirmation of branch creation
|
70
|
+
10. `git_checkout`
|
71
|
+
- Switches branches
|
72
|
+
- Inputs:
|
73
|
+
- `repo_path` (string): Path to Git repository
|
74
|
+
- `branch_name` (string): Name of branch to checkout
|
75
|
+
- Returns: Confirmation of branch switch
|
76
|
+
11. `git_show`
|
77
|
+
- Shows the contents of a commit
|
78
|
+
- Inputs:
|
79
|
+
- `repo_path` (string): Path to Git repository
|
80
|
+
- `revision` (string): The revision (commit hash, branch name, tag) to show
|
81
|
+
- Returns: Contents of the specified commit
|
82
|
+
12. `git_init`
|
83
|
+
- Initializes a Git repository
|
84
|
+
- Inputs:
|
85
|
+
- `repo_path` (string): Path to directory to initialize git repo
|
86
|
+
- Returns: Confirmation of repository initialization
|
87
|
+
|
88
|
+
## Installation
|
89
|
+
|
90
|
+
### Using uv (recommended)
|
91
|
+
|
92
|
+
When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
|
93
|
+
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-git*.
|
94
|
+
|
95
|
+
### Using PIP
|
96
|
+
|
97
|
+
Alternatively you can install `mcp-server-git` via pip:
|
98
|
+
|
99
|
+
```
|
100
|
+
pip install mcp-server-git
|
101
|
+
```
|
102
|
+
|
103
|
+
After installation, you can run it as a script using:
|
104
|
+
|
105
|
+
```
|
106
|
+
python -m mcp_server_git
|
107
|
+
```
|
108
|
+
|
109
|
+
## Configuration
|
110
|
+
|
111
|
+
### Usage with Claude Desktop
|
112
|
+
|
113
|
+
Add this to your `claude_desktop_config.json`:
|
114
|
+
|
115
|
+
<details>
|
116
|
+
<summary>Using uvx</summary>
|
117
|
+
|
118
|
+
```json
|
119
|
+
"mcpServers": {
|
120
|
+
"git": {
|
121
|
+
"command": "uvx",
|
122
|
+
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
|
123
|
+
}
|
124
|
+
}
|
125
|
+
```
|
126
|
+
</details>
|
127
|
+
|
128
|
+
<details>
|
129
|
+
<summary>Using docker</summary>
|
130
|
+
|
131
|
+
* Note: replace '/Users/username' with the a path that you want to be accessible by this tool
|
132
|
+
|
133
|
+
```json
|
134
|
+
"mcpServers": {
|
135
|
+
"git": {
|
136
|
+
"command": "docker",
|
137
|
+
"args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"]
|
138
|
+
}
|
139
|
+
}
|
140
|
+
```
|
141
|
+
</details>
|
142
|
+
|
143
|
+
<details>
|
144
|
+
<summary>Using pip installation</summary>
|
145
|
+
|
146
|
+
```json
|
147
|
+
"mcpServers": {
|
148
|
+
"git": {
|
149
|
+
"command": "python",
|
150
|
+
"args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
|
151
|
+
}
|
152
|
+
}
|
153
|
+
```
|
154
|
+
</details>
|
155
|
+
|
156
|
+
### Usage with VS Code
|
157
|
+
|
158
|
+
For quick installation, use one of the one-click install buttons below...
|
159
|
+
|
160
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D&quality=insiders)
|
161
|
+
|
162
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D&quality=insiders)
|
163
|
+
|
164
|
+
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`.
|
165
|
+
|
166
|
+
Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
|
167
|
+
|
168
|
+
> Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.
|
169
|
+
|
170
|
+
```json
|
171
|
+
{
|
172
|
+
"mcp": {
|
173
|
+
"servers": {
|
174
|
+
"git": {
|
175
|
+
"command": "uvx",
|
176
|
+
"args": ["mcp-server-git"]
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
181
|
+
```
|
182
|
+
|
183
|
+
For Docker installation:
|
184
|
+
|
185
|
+
```json
|
186
|
+
{
|
187
|
+
"mcp": {
|
188
|
+
"servers": {
|
189
|
+
"git": {
|
190
|
+
"command": "docker",
|
191
|
+
"args": [
|
192
|
+
"run",
|
193
|
+
"--rm",
|
194
|
+
"-i",
|
195
|
+
"--mount", "type=bind,src=${workspaceFolder},dst=/workspace",
|
196
|
+
"mcp/git"
|
197
|
+
]
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
```
|
203
|
+
|
204
|
+
### Usage with [Zed](https://github.com/zed-industries/zed)
|
205
|
+
|
206
|
+
Add to your Zed settings.json:
|
207
|
+
|
208
|
+
<details>
|
209
|
+
<summary>Using uvx</summary>
|
210
|
+
|
211
|
+
```json
|
212
|
+
"context_servers": [
|
213
|
+
"mcp-server-git": {
|
214
|
+
"command": {
|
215
|
+
"path": "uvx",
|
216
|
+
"args": ["mcp-server-git"]
|
217
|
+
}
|
218
|
+
}
|
219
|
+
],
|
220
|
+
```
|
221
|
+
</details>
|
222
|
+
|
223
|
+
<details>
|
224
|
+
<summary>Using pip installation</summary>
|
225
|
+
|
226
|
+
```json
|
227
|
+
"context_servers": {
|
228
|
+
"mcp-server-git": {
|
229
|
+
"command": {
|
230
|
+
"path": "python",
|
231
|
+
"args": ["-m", "mcp_server_git"]
|
232
|
+
}
|
233
|
+
}
|
234
|
+
},
|
235
|
+
```
|
236
|
+
</details>
|
237
|
+
|
238
|
+
## Debugging
|
239
|
+
|
240
|
+
You can use the MCP inspector to debug the server. For uvx installations:
|
241
|
+
|
242
|
+
```
|
243
|
+
npx @modelcontextprotocol/inspector uvx mcp-server-git
|
244
|
+
```
|
245
|
+
|
246
|
+
Or if you've installed the package in a specific directory or are developing on it:
|
247
|
+
|
248
|
+
```
|
249
|
+
cd path/to/servers/src/git
|
250
|
+
npx @modelcontextprotocol/inspector uv run mcp-server-git
|
251
|
+
```
|
252
|
+
|
253
|
+
Running `tail -n 20 -f ~/Library/Logs/Claude/mcp*.log` will show the logs from the server and may
|
254
|
+
help you debug any issues.
|
255
|
+
|
256
|
+
## Development
|
257
|
+
|
258
|
+
If you are doing local development, there are two ways to test your changes:
|
259
|
+
|
260
|
+
1. Run the MCP inspector to test your changes. See [Debugging](#debugging) for run instructions.
|
261
|
+
|
262
|
+
2. Test using the Claude desktop app. Add the following to your `claude_desktop_config.json`:
|
263
|
+
|
264
|
+
### Docker
|
265
|
+
|
266
|
+
```json
|
267
|
+
{
|
268
|
+
"mcpServers": {
|
269
|
+
"git": {
|
270
|
+
"command": "docker",
|
271
|
+
"args": [
|
272
|
+
"run",
|
273
|
+
"--rm",
|
274
|
+
"-i",
|
275
|
+
"--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
|
276
|
+
"--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
|
277
|
+
"--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
|
278
|
+
"mcp/git"
|
279
|
+
]
|
280
|
+
}
|
281
|
+
}
|
282
|
+
}
|
283
|
+
```
|
284
|
+
|
285
|
+
### UVX
|
286
|
+
```json
|
287
|
+
{
|
288
|
+
"mcpServers": {
|
289
|
+
"git": {
|
290
|
+
"command": "uv",
|
291
|
+
"args": [
|
292
|
+
"--directory",
|
293
|
+
"/<path to mcp-servers>/mcp-servers/src/git",
|
294
|
+
"run",
|
295
|
+
"mcp-server-git"
|
296
|
+
]
|
297
|
+
}
|
298
|
+
}
|
299
|
+
```
|
300
|
+
|
301
|
+
## Build
|
302
|
+
|
303
|
+
Docker build:
|
304
|
+
|
305
|
+
```bash
|
306
|
+
cd src/git
|
307
|
+
docker build -t mcp/git .
|
308
|
+
```
|
309
|
+
|
310
|
+
## License
|
311
|
+
|
312
|
+
This 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. For more details, please see the LICENSE file in the project repository.
|
File without changes
|
@@ -1,11 +1,11 @@
|
|
1
1
|
[project]
|
2
2
|
name = "mcp-server-notion"
|
3
|
-
version = "0.
|
3
|
+
version = "0.2.0"
|
4
4
|
description = "A Model Context Protocol Tool for Notion integration and automation"
|
5
5
|
readme = "README.md"
|
6
6
|
requires-python = ">=3.10"
|
7
|
-
authors = [{ name = "
|
8
|
-
maintainers = [{ name = "
|
7
|
+
authors = [{ name = "shpark" }]
|
8
|
+
maintainers = [{ name = "shpark", email = "shp8019@gmail.com" }]
|
9
9
|
keywords = ["notion", "mcp", "llm", "automation", "tool"]
|
10
10
|
license = { text = "MIT" }
|
11
11
|
classifiers = [
|
@@ -22,7 +22,7 @@ dependencies = [
|
|
22
22
|
]
|
23
23
|
|
24
24
|
[project.scripts]
|
25
|
-
mcp-server-notion = "mcp_server_notion:main"
|
25
|
+
mcp-server-notion = "mcp_server_notion.__main__:main"
|
26
26
|
|
27
27
|
[build-system]
|
28
28
|
requires = ["hatchling"]
|
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# __main__.py
|
2
|
+
|
3
|
+
import logging
|
4
|
+
import sys
|
5
|
+
import click
|
6
|
+
from .server import serve
|
7
|
+
|
8
|
+
@click.command()
|
9
|
+
@click.option("-v", "--verbose", count=True)
|
10
|
+
def main(verbose: int) -> None:
|
11
|
+
import asyncio
|
12
|
+
logging_level = logging.WARN
|
13
|
+
if verbose == 1:
|
14
|
+
logging_level = logging.INFO
|
15
|
+
elif verbose >= 2:
|
16
|
+
logging_level = logging.DEBUG
|
17
|
+
logging.basicConfig(level=logging_level, stream=sys.stderr)
|
18
|
+
asyncio.run(serve())
|
19
|
+
|
20
|
+
if __name__ == "__main__":
|
21
|
+
main()
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import logging
|
2
|
+
from mcp.server import Server
|
3
|
+
from mcp.server.stdio import stdio_server
|
4
|
+
from mcp.types import Tool, TextContent
|
5
|
+
from pydantic import BaseModel
|
6
|
+
from notion_client import Client
|
7
|
+
|
8
|
+
class NotionCreatePageInput(BaseModel):
|
9
|
+
notion_token: str
|
10
|
+
parent_id: str
|
11
|
+
title: str
|
12
|
+
content: str
|
13
|
+
|
14
|
+
def create_notion_page(notion_token: str, parent_id: str, title: str, content: str) -> str:
|
15
|
+
notion = Client(auth=notion_token)
|
16
|
+
new_page = notion.pages.create(
|
17
|
+
parent={"database_id": parent_id},
|
18
|
+
properties={
|
19
|
+
"title": [
|
20
|
+
{
|
21
|
+
"type": "text",
|
22
|
+
"text": {"content": title}
|
23
|
+
}
|
24
|
+
]
|
25
|
+
},
|
26
|
+
children=[
|
27
|
+
{
|
28
|
+
"object": "block",
|
29
|
+
"type": "paragraph",
|
30
|
+
"paragraph": {
|
31
|
+
"rich_text": [
|
32
|
+
{
|
33
|
+
"type": "text",
|
34
|
+
"text": {"content": content}
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
}
|
39
|
+
]
|
40
|
+
)
|
41
|
+
return new_page['url']
|
42
|
+
|
43
|
+
async def serve() -> None:
|
44
|
+
logger = logging.getLogger(__name__)
|
45
|
+
server = Server("mcp-notion")
|
46
|
+
|
47
|
+
@server.list_tools()
|
48
|
+
async def list_tools():
|
49
|
+
return [
|
50
|
+
Tool(
|
51
|
+
name="notion_create_page",
|
52
|
+
description="Notion에 새 페이지를 생성",
|
53
|
+
inputSchema=NotionCreatePageInput.schema(),
|
54
|
+
),
|
55
|
+
]
|
56
|
+
|
57
|
+
@server.call_tool()
|
58
|
+
async def call_tool(name: str, arguments: dict):
|
59
|
+
if name == "notion_create_page":
|
60
|
+
url = create_notion_page(
|
61
|
+
arguments["notion_token"],
|
62
|
+
arguments["parent_id"],
|
63
|
+
arguments["title"],
|
64
|
+
arguments["content"]
|
65
|
+
)
|
66
|
+
return [TextContent(type="text", text=f"페이지 생성됨: {url}")]
|
67
|
+
raise ValueError(f"Unknown tool: {name}")
|
68
|
+
|
69
|
+
options = server.create_initialization_options()
|
70
|
+
async with stdio_server() as (read_stream, write_stream):
|
71
|
+
await server.run(read_stream, write_stream, options, raise_exceptions=True)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import pytest
|
2
|
+
from pathlib import Path
|
3
|
+
import git
|
4
|
+
from mcp_server_git.server import git_checkout
|
5
|
+
import shutil
|
6
|
+
|
7
|
+
@pytest.fixture
|
8
|
+
def test_repository(tmp_path: Path):
|
9
|
+
repo_path = tmp_path / "temp_test_repo"
|
10
|
+
test_repo = git.Repo.init(repo_path)
|
11
|
+
|
12
|
+
Path(repo_path / "test.txt").write_text("test")
|
13
|
+
test_repo.index.add(["test.txt"])
|
14
|
+
test_repo.index.commit("initial commit")
|
15
|
+
|
16
|
+
yield test_repo
|
17
|
+
|
18
|
+
shutil.rmtree(repo_path)
|
19
|
+
|
20
|
+
def test_git_checkout_existing_branch(test_repository):
|
21
|
+
test_repository.git.branch("test-branch")
|
22
|
+
result = git_checkout(test_repository, "test-branch")
|
23
|
+
|
24
|
+
assert "Switched to branch 'test-branch'" in result
|
25
|
+
assert test_repository.active_branch.name == "test-branch"
|
26
|
+
|
27
|
+
def test_git_checkout_nonexistent_branch(test_repository):
|
28
|
+
|
29
|
+
with pytest.raises(git.GitCommandError):
|
30
|
+
git_checkout(test_repository, "nonexistent-branch")
|
File without changes
|
mcp_server_notion-0.1.0/PKG-INFO
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: mcp-server-notion
|
3
|
-
Version: 0.1.0
|
4
|
-
Summary: A Model Context Protocol Tool for Notion integration and automation
|
5
|
-
Author: Your Name
|
6
|
-
Maintainer-email: Your Name <your@email.com>
|
7
|
-
License: MIT
|
8
|
-
License-File: LICENSE
|
9
|
-
Keywords: automation,llm,mcp,notion,tool
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
11
|
-
Classifier: Intended Audience :: Developers
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
15
|
-
Requires-Python: >=3.10
|
16
|
-
Requires-Dist: mcp>=1.0.0
|
17
|
-
Requires-Dist: notion-client>=2.2.0
|
18
|
-
Requires-Dist: pydantic>=2.0.0
|
19
|
-
Description-Content-Type: text/markdown
|
20
|
-
|
21
|
-
# mcp-server-notion: A Notion MCP Tool
|
22
|
-
|
23
|
-
## Overview
|
24
|
-
|
25
|
-
mcp-server-notion은 Notion에 글을 작성하는 기능을 MCP(Model Context Protocol) Tool로 제공합니다. LLM 프롬프트, Claude, uvx 등에서 직접 호출하여 Notion 페이지를 자동으로 생성할 수 있습니다.
|
26
|
-
|
27
|
-
---
|
28
|
-
|
29
|
-
## 주요 기능 (MCP Tool)
|
30
|
-
|
31
|
-
- `notion_create_page`: Notion 데이터베이스에 새 페이지를 생성합니다.
|
32
|
-
- 입력값:
|
33
|
-
- `notion_token` (string): Notion API 통합 토큰
|
34
|
-
- `parent_id` (string): 페이지를 생성할 데이터베이스 ID
|
35
|
-
- `title` (string): 페이지 제목
|
36
|
-
- `content` (string): 페이지 본문
|
37
|
-
- 반환값: 생성된 페이지의 URL
|
38
|
-
|
39
|
-
---
|
40
|
-
|
41
|
-
## 설치
|
42
|
-
|
43
|
-
```bash
|
44
|
-
pip install mcp-server-notion
|
45
|
-
```
|
46
|
-
|
47
|
-
---
|
48
|
-
|
49
|
-
## 사용법 (MCP Tool)
|
50
|
-
|
51
|
-
### MCP 프롬프트/uvx/Claude Desktop 연동 예시
|
52
|
-
|
53
|
-
#### claude_desktop_config.json
|
54
|
-
```json
|
55
|
-
"mcpServers": {
|
56
|
-
"notion": {
|
57
|
-
"command": "uvx",
|
58
|
-
"args": ["mcp-server-notion"]
|
59
|
-
}
|
60
|
-
}
|
61
|
-
```
|
62
|
-
|
63
|
-
#### VS Code .vscode/mcp.json
|
64
|
-
```json
|
65
|
-
{
|
66
|
-
"mcp": {
|
67
|
-
"servers": {
|
68
|
-
"notion": {
|
69
|
-
"command": "uvx",
|
70
|
-
"args": ["mcp-server-notion"]
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
```
|
76
|
-
|
77
|
-
---
|
78
|
-
|
79
|
-
## MCP Tool 프롬프트 예시
|
80
|
-
|
81
|
-
- notion_create_page tool을 호출할 때 아래와 같이 입력:
|
82
|
-
|
83
|
-
```json
|
84
|
-
{
|
85
|
-
"notion_token": "your_notion_token",
|
86
|
-
"parent_id": "your_database_id",
|
87
|
-
"title": "회의록",
|
88
|
-
"content": "오늘 회의 내용 정리"
|
89
|
-
}
|
90
|
-
```
|
91
|
-
|
92
|
-
- 반환 예시:
|
93
|
-
- `페이지 생성됨: https://www.notion.so/xxxxxxx`
|
94
|
-
|
95
|
-
---
|
96
|
-
|
97
|
-
## Notion API 토큰 발급 방법
|
98
|
-
|
99
|
-
1. [Notion 개발자 페이지](https://www.notion.so/my-integrations)에서 통합 생성
|
100
|
-
2. 해당 통합을 원하는 데이터베이스에 초대
|
101
|
-
3. 통합 토큰 복사 후 notion_token으로 사용
|
102
|
-
|
103
|
-
---
|
104
|
-
|
105
|
-
## License
|
106
|
-
|
107
|
-
MIT License
|
@@ -1,87 +0,0 @@
|
|
1
|
-
# mcp-server-notion: A Notion MCP Tool
|
2
|
-
|
3
|
-
## Overview
|
4
|
-
|
5
|
-
mcp-server-notion은 Notion에 글을 작성하는 기능을 MCP(Model Context Protocol) Tool로 제공합니다. LLM 프롬프트, Claude, uvx 등에서 직접 호출하여 Notion 페이지를 자동으로 생성할 수 있습니다.
|
6
|
-
|
7
|
-
---
|
8
|
-
|
9
|
-
## 주요 기능 (MCP Tool)
|
10
|
-
|
11
|
-
- `notion_create_page`: Notion 데이터베이스에 새 페이지를 생성합니다.
|
12
|
-
- 입력값:
|
13
|
-
- `notion_token` (string): Notion API 통합 토큰
|
14
|
-
- `parent_id` (string): 페이지를 생성할 데이터베이스 ID
|
15
|
-
- `title` (string): 페이지 제목
|
16
|
-
- `content` (string): 페이지 본문
|
17
|
-
- 반환값: 생성된 페이지의 URL
|
18
|
-
|
19
|
-
---
|
20
|
-
|
21
|
-
## 설치
|
22
|
-
|
23
|
-
```bash
|
24
|
-
pip install mcp-server-notion
|
25
|
-
```
|
26
|
-
|
27
|
-
---
|
28
|
-
|
29
|
-
## 사용법 (MCP Tool)
|
30
|
-
|
31
|
-
### MCP 프롬프트/uvx/Claude Desktop 연동 예시
|
32
|
-
|
33
|
-
#### claude_desktop_config.json
|
34
|
-
```json
|
35
|
-
"mcpServers": {
|
36
|
-
"notion": {
|
37
|
-
"command": "uvx",
|
38
|
-
"args": ["mcp-server-notion"]
|
39
|
-
}
|
40
|
-
}
|
41
|
-
```
|
42
|
-
|
43
|
-
#### VS Code .vscode/mcp.json
|
44
|
-
```json
|
45
|
-
{
|
46
|
-
"mcp": {
|
47
|
-
"servers": {
|
48
|
-
"notion": {
|
49
|
-
"command": "uvx",
|
50
|
-
"args": ["mcp-server-notion"]
|
51
|
-
}
|
52
|
-
}
|
53
|
-
}
|
54
|
-
}
|
55
|
-
```
|
56
|
-
|
57
|
-
---
|
58
|
-
|
59
|
-
## MCP Tool 프롬프트 예시
|
60
|
-
|
61
|
-
- notion_create_page tool을 호출할 때 아래와 같이 입력:
|
62
|
-
|
63
|
-
```json
|
64
|
-
{
|
65
|
-
"notion_token": "your_notion_token",
|
66
|
-
"parent_id": "your_database_id",
|
67
|
-
"title": "회의록",
|
68
|
-
"content": "오늘 회의 내용 정리"
|
69
|
-
}
|
70
|
-
```
|
71
|
-
|
72
|
-
- 반환 예시:
|
73
|
-
- `페이지 생성됨: https://www.notion.so/xxxxxxx`
|
74
|
-
|
75
|
-
---
|
76
|
-
|
77
|
-
## Notion API 토큰 발급 방법
|
78
|
-
|
79
|
-
1. [Notion 개발자 페이지](https://www.notion.so/my-integrations)에서 통합 생성
|
80
|
-
2. 해당 통합을 원하는 데이터베이스에 초대
|
81
|
-
3. 통합 토큰 복사 후 notion_token으로 사용
|
82
|
-
|
83
|
-
---
|
84
|
-
|
85
|
-
## License
|
86
|
-
|
87
|
-
MIT License
|
@@ -1,61 +0,0 @@
|
|
1
|
-
from mcp.server import Server
|
2
|
-
from mcp.types import Tool, TextContent
|
3
|
-
from pydantic import BaseModel
|
4
|
-
from notion_client import Client
|
5
|
-
|
6
|
-
class NotionCreatePageInput(BaseModel):
|
7
|
-
notion_token: str
|
8
|
-
parent_id: str
|
9
|
-
title: str
|
10
|
-
content: str
|
11
|
-
|
12
|
-
server = Server("mcp-notion")
|
13
|
-
|
14
|
-
@server.list_tools()
|
15
|
-
async def list_tools():
|
16
|
-
return [
|
17
|
-
Tool(
|
18
|
-
name="notion_create_page",
|
19
|
-
description="Notion에 새 페이지를 생성",
|
20
|
-
inputSchema=NotionCreatePageInput.schema(),
|
21
|
-
),
|
22
|
-
]
|
23
|
-
|
24
|
-
@server.call_tool()
|
25
|
-
async def call_tool(name: str, arguments: dict):
|
26
|
-
if name == "notion_create_page":
|
27
|
-
notion = Client(auth=arguments["notion_token"])
|
28
|
-
new_page = notion.pages.create(
|
29
|
-
parent={"database_id": arguments["parent_id"]},
|
30
|
-
properties={
|
31
|
-
"title": [
|
32
|
-
{
|
33
|
-
"type": "text",
|
34
|
-
"text": {"content": arguments["title"]}
|
35
|
-
}
|
36
|
-
]
|
37
|
-
},
|
38
|
-
children=[
|
39
|
-
{
|
40
|
-
"object": "block",
|
41
|
-
"type": "paragraph",
|
42
|
-
"paragraph": {
|
43
|
-
"rich_text": [
|
44
|
-
{
|
45
|
-
"type": "text",
|
46
|
-
"text": {"content": arguments["content"]}
|
47
|
-
}
|
48
|
-
]
|
49
|
-
}
|
50
|
-
}
|
51
|
-
]
|
52
|
-
)
|
53
|
-
return [TextContent(type="text", text=f"페이지 생성됨: {new_page['url']}")]
|
54
|
-
raise ValueError(f"Unknown tool: {name}")
|
55
|
-
|
56
|
-
def main():
|
57
|
-
import asyncio
|
58
|
-
asyncio.run(server.run_stdio())
|
59
|
-
|
60
|
-
if __name__ == "__main__":
|
61
|
-
main()
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import pytest
|
2
|
-
from mcp_server_notion.server import call_tool
|
3
|
-
|
4
|
-
class DummyNotion:
|
5
|
-
def __init__(self):
|
6
|
-
self.pages = self
|
7
|
-
def create(self, parent, properties, children):
|
8
|
-
assert parent["database_id"] == "dummy_db"
|
9
|
-
assert properties["title"][0]["text"]["content"] == "테스트"
|
10
|
-
assert children[0]["paragraph"]["rich_text"][0]["text"]["content"] == "본문"
|
11
|
-
return {"url": "https://notion.so/dummy"}
|
12
|
-
|
13
|
-
def test_notion_create_page(monkeypatch):
|
14
|
-
import mcp_server_notion.server as server
|
15
|
-
server.Client = lambda auth: DummyNotion()
|
16
|
-
result = pytest.run(asyncio_run(call_tool("notion_create_page", {
|
17
|
-
"notion_token": "dummy_token",
|
18
|
-
"parent_id": "dummy_db",
|
19
|
-
"title": "테스트",
|
20
|
-
"content": "본문"
|
21
|
-
})))
|
22
|
-
assert result[0].text == "페이지 생성됨: https://notion.so/dummy"
|
23
|
-
|
24
|
-
def asyncio_run(coro):
|
25
|
-
import asyncio
|
26
|
-
return asyncio.get_event_loop().run_until_complete(coro)
|