mcp-server-notion 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,6 @@
1
+ # __main__.py
2
+
3
+ from .server import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
@@ -0,0 +1,61 @@
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()
@@ -0,0 +1,107 @@
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
@@ -0,0 +1,8 @@
1
+ mcp_server_notion/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2
+ mcp_server_notion/__main__.py,sha256=bMqipiaNdyrHMzmMStOfzilkUFEM8UNA8Q_-qaw6Gu4,79
3
+ mcp_server_notion/server.py,sha256=2FyPYZjDWH3z2q9cRRvCTfgW04KUUKcNxD9Aqg8tQPQ,1731
4
+ mcp_server_notion-0.1.0.dist-info/METADATA,sha256=VCneX3WyPMS-W9gEltFEd4G9pDgbRxhnjoRwfzZt8ks,2425
5
+ mcp_server_notion-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ mcp_server_notion-0.1.0.dist-info/entry_points.txt,sha256=XC99PYs2yNs538euM4O3uO8PBO-7hOrZs-WsEbxH9nY,61
7
+ mcp_server_notion-0.1.0.dist-info/licenses/LICENSE,sha256=jMfG4zsk7U7o_MzDPszxAlSdBPpMuXN87Ml3Da0QgP8,1059
8
+ mcp_server_notion-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mcp-server-notion = mcp_server_notion:main
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2024 Anthropic, PBC.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.