|
69 | 69 | - `--enabledTools`: Comma-separated list of tools to enable (e.g. "notion_retrieve_page,notion_query_database"). When specified, only the listed tools will be available. If not specified, all tools are enabled.
|
70 | 70 |
|
71 | 71 | Read-only tools example (copy-paste friendly):
|
| 72 | + |
72 | 73 | ```bash
|
73 | 74 | node build/index.js --enabledTools=notion_retrieve_block,notion_retrieve_block_children,notion_retrieve_page,notion_query_database,notion_retrieve_database,notion_search,notion_list_all_users,notion_retrieve_user,notion_retrieve_bot_user,notion_retrieve_comments
|
74 | 75 | ```
|
@@ -126,6 +127,48 @@ If you encounter permission errors:
|
126 | 127 | 2. Verify that the integration is invited to the relevant pages or databases.
|
127 | 128 | 3. Confirm the token and configuration are correctly set in `claude_desktop_config.json`.
|
128 | 129 |
|
| 130 | +## Project Structure |
| 131 | + |
| 132 | +The project is organized in a modular way to improve maintainability and readability: |
| 133 | + |
| 134 | +``` |
| 135 | +notion/ |
| 136 | +├── src/ |
| 137 | +│ ├── index.ts # Entry point and command-line handling |
| 138 | +│ ├── client/ |
| 139 | +│ │ └── index.ts # NotionClientWrapper class for API interactions |
| 140 | +│ ├── server/ |
| 141 | +│ │ └── index.ts # MCP server setup and request handling |
| 142 | +│ ├── types/ |
| 143 | +│ │ ├── index.ts # Type exports |
| 144 | +│ │ ├── args.ts # Tool argument interfaces |
| 145 | +│ │ ├── common.ts # Common schema definitions |
| 146 | +│ │ ├── responses.ts # API response type definitions |
| 147 | +│ │ └── schemas.ts # Tool schema definitions |
| 148 | +│ ├── utils/ |
| 149 | +│ │ └── index.ts # Utility functions |
| 150 | +│ └── markdown/ |
| 151 | +│ └── index.ts # Markdown conversion utilities |
| 152 | +``` |
| 153 | + |
| 154 | +### Directory Descriptions |
| 155 | + |
| 156 | +- **index.ts**: Application entry point. Parses command-line arguments and starts the server. |
| 157 | +- **client/**: Module responsible for communication with the Notion API. |
| 158 | + - **index.ts**: NotionClientWrapper class implements all API calls. |
| 159 | +- **server/**: MCP server implementation. |
| 160 | + - **index.ts**: Processes requests received from Claude and calls appropriate client methods. |
| 161 | +- **types/**: Type definition module. |
| 162 | + - **index.ts**: Exports for all types. |
| 163 | + - **args.ts**: Interface definitions for tool arguments. |
| 164 | + - **common.ts**: Definitions for common schemas (ID formats, rich text, etc.). |
| 165 | + - **responses.ts**: Type definitions for Notion API responses. |
| 166 | + - **schemas.ts**: Definitions for MCP tool schemas. |
| 167 | +- **utils/**: Utility functions. |
| 168 | + - **index.ts**: Functions like filtering enabled tools. |
| 169 | +- **markdown/**: Markdown conversion functionality. |
| 170 | + - **index.ts**: Logic for converting JSON responses to Markdown format. |
| 171 | + |
129 | 172 | ## Tools
|
130 | 173 |
|
131 | 174 | All tools support the following optional parameter:
|
@@ -284,4 +327,4 @@ All tools support the following optional parameter:
|
284 | 327 |
|
285 | 328 | ## License
|
286 | 329 |
|
287 |
| -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. |
| 330 | +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 commit comments