@ainote/mcp 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.
Files changed (5) hide show
  1. package/LICENSE +21 -0
  2. package/README-ko.md +276 -0
  3. package/README.md +265 -0
  4. package/index.js +229 -0
  5. package/package.json +56 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 AI Note Team
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-ko.md ADDED
@@ -0,0 +1,276 @@
1
+ # AI Note MCP 서버
2
+
3
+ [![npm version](https://badge.fury.io/js/%40ainote%2Fmcp-server.svg)](https://badge.fury.io/js/%40ainote%2Fmcp-server)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Claude Desktop을 AI Note 작업 관리 시스템에 연결하는 MCP(Model Context Protocol) 서버입니다. 이 서버를 통해 Claude가 AI Note 작업을 직접 관리할 수 있으며, 자연어 대화를 통해 작업 생성, 수정, 관리가 가능합니다.
7
+
8
+ ## 목차
9
+
10
+ - [기능](#기능)
11
+ - [사전 요구사항](#사전-요구사항)
12
+ - [설치](#설치)
13
+ - [설정](#설정)
14
+ - [사용법](#사용법)
15
+ - [사용 가능한 도구](#사용-가능한-도구)
16
+ - [API 참조](#api-참조)
17
+ - [개발](#개발)
18
+ - [문제 해결](#문제-해결)
19
+ - [기여하기](#기여하기)
20
+ - [라이선스](#라이선스)
21
+
22
+ ## 기능
23
+
24
+ - 📝 **작업 관리**: Claude Desktop에서 직접 작업 생성, 수정, 삭제, 조회
25
+ - 🏷️ **카테고리 지원**: 카테고리를 통한 작업 구성
26
+ - 🔍 **고급 검색**: 내용, 상태 등을 기준으로 작업 검색
27
+ - ⭐ **우선순위 관리**: 중요한 작업 표시
28
+ - 📅 **마감일 지원**: 작업 마감일 설정 및 관리
29
+ - 🔒 **보안 API 연동**: API 키 인증을 통한 안전한 접근
30
+
31
+ ## 사전 요구사항
32
+
33
+ - Node.js >= 16.0.0
34
+ - npm 또는 yarn
35
+ - AI Note API 접근 권한 (API 키 필요)
36
+ - MCP 지원이 활성화된 Claude Desktop
37
+
38
+ ## 설치
39
+
40
+ ### 방법 1: npm을 통한 설치
41
+
42
+ ```bash
43
+ npm install -g @ainote/mcp-server
44
+ ```
45
+
46
+ ### 방법 2: 소스코드로부터 설치
47
+
48
+ ```bash
49
+ git clone https://github.com/your-username/ainote-mcp-server.git
50
+ cd ainote-mcp-server
51
+ npm install
52
+ ```
53
+
54
+ ## 설정
55
+
56
+ ### 1. 환경 변수 설정
57
+
58
+ `.env` 파일을 생성하거나 다음 환경 변수를 설정하세요:
59
+
60
+ ```bash
61
+ # 필수
62
+ export AINOTE_API_KEY="여기에-api-키-입력"
63
+
64
+ # 선택사항 (기본값: 프로덕션 URL)
65
+ export AINOTE_API_URL="https://ainote-5muq.onrender.com"
66
+ ```
67
+
68
+ ### 2. Claude Desktop 설정
69
+
70
+ Claude Desktop 설정 파일에 다음 내용을 추가하세요:
71
+
72
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
73
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "ainote": {
79
+ "command": "node",
80
+ "args": ["/path/to/ainote-mcp-server/index.js"],
81
+ "env": {
82
+ "AINOTE_API_KEY": "여기에-api-키-입력"
83
+ }
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ npm을 통해 전역으로 설치한 경우:
90
+
91
+ ```json
92
+ {
93
+ "mcpServers": {
94
+ "ainote": {
95
+ "command": "ainote-mcp",
96
+ "env": {
97
+ "AINOTE_API_KEY": "여기에-api-키-입력"
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ ### 3. Claude Desktop 재시작
105
+
106
+ 설정 후 Claude Desktop을 재시작하여 MCP 서버를 로드하세요.
107
+
108
+ ## 사용법
109
+
110
+ 설정이 완료되면 Claude를 통해 AI Note 작업과 상호작용할 수 있습니다:
111
+
112
+ ### 대화 예시
113
+
114
+ ```
115
+ 사용자: "내 대기 중인 작업들을 보여줘"
116
+ Claude: AI Note에서 대기 중인 작업들을 가져오겠습니다...
117
+
118
+ 사용자: "금요일까지 분기 보고서 검토하는 새 작업을 만들어줘"
119
+ Claude: 금요일을 마감일로 하는 작업을 생성하겠습니다...
120
+
121
+ 사용자: "작업 ID 123을 완료로 표시해줘"
122
+ Claude: 해당 작업을 완료로 표시하겠습니다...
123
+ ```
124
+
125
+ ## 사용 가능한 도구
126
+
127
+ ### list_tasks
128
+
129
+ 필터링 옵션과 함께 AI Note에서 작업 목록을 조회합니다.
130
+
131
+ **매개변수:**
132
+ - `status` (선택사항): 상태별 필터 - "pending" 또는 "completed"
133
+ - `limit` (선택사항): 반환할 최대 작업 수 (기본값: 25, 최대: 500)
134
+ - `search` (선택사항): 작업 내용 검색 키워드
135
+
136
+ ### create_task
137
+
138
+ AI Note에 새 작업을 생성합니다.
139
+
140
+ **매개변수:**
141
+ - `content` (필수): 작업 설명
142
+ - `is_important` (선택사항): 중요 표시 (boolean)
143
+ - `due_date` (선택사항): ISO 형식의 마감일
144
+ - `category_id` (선택사항): 할당할 카테고리 ID
145
+
146
+ ### update_task
147
+
148
+ 기존 작업을 수정합니다.
149
+
150
+ **매개변수:**
151
+ - `id` (필수): 작업 ID
152
+ - `content` (선택사항): 새로운 작업 내용
153
+ - `is_important` (선택사항): 중요 상태 업데이트
154
+ - `completed_at` (선택사항): 완료로 표시 (ISO 형식) 또는 null로 미완료 처리
155
+
156
+ ### delete_task
157
+
158
+ 작업을 소프트 삭제합니다.
159
+
160
+ **매개변수:**
161
+ - `id` (필수): 삭제할 작업 ID
162
+
163
+ ### list_categories
164
+
165
+ 사용 가능한 모든 카테고리를 조회합니다.
166
+
167
+ **매개변수:** 없음
168
+
169
+ ## API 참조
170
+
171
+ MCP 서버는 다음 엔드포인트를 통해 AI Note API와 통신합니다:
172
+
173
+ - `GET /api/mcp/tasks` - 작업 목록 조회
174
+ - `POST /api/mcp/tasks` - 작업 생성
175
+ - `PUT /api/mcp/tasks/:id` - 작업 수정
176
+ - `DELETE /api/mcp/tasks/:id` - 작업 삭제
177
+ - `GET /api/mcp/categories` - 카테고리 목록 조회
178
+
179
+ 모든 요청은 `Authorization` 헤더를 통한 API 키 인증이 필요합니다.
180
+
181
+ ## 개발
182
+
183
+ ### 로컬에서 실행하기
184
+
185
+ ```bash
186
+ # 저장소 클론
187
+ git clone https://github.com/your-username/ainote-mcp-server.git
188
+ cd ainote-mcp-server
189
+
190
+ # 의존성 설치
191
+ npm install
192
+
193
+ # 서버 실행
194
+ npm start
195
+ ```
196
+
197
+ ### Claude Desktop으로 테스트
198
+
199
+ 1. Claude Desktop 설정을 로컬 개발 서버를 가리키도록 업데이트
200
+ 2. 테스트를 위한 환경 변수 설정
201
+ 3. Claude Desktop 재시작
202
+ 4. Claude Desktop 설정에서 MCP 연결 상태 확인
203
+
204
+ ### 프로젝트 구조
205
+
206
+ ```
207
+ ainote-mcp-server/
208
+ ├── index.js # 메인 서버 구현
209
+ ├── package.json # 패키지 설정
210
+ ├── README.md # 영문 문서
211
+ ├── README-ko.md # 한글 문서
212
+ └── LICENSE # MIT 라이선스
213
+ ```
214
+
215
+ ## 문제 해결
216
+
217
+ ### 일반적인 문제
218
+
219
+ 1. **"API 키를 찾을 수 없음" 오류**
220
+ - 환경 변수나 Claude 설정에 `AINOTE_API_KEY`가 설정되어 있는지 확인
221
+ - API 키가 유효하고 적절한 권한이 있는지 확인
222
+
223
+ 2. **"연결 거부됨" 오류**
224
+ - API URL이 올바른지 확인
225
+ - 네트워크 연결 확인
226
+ - AI Note API 서버가 실행 중인지 확인
227
+
228
+ 3. **"도구를 찾을 수 없음" 오류**
229
+ - 설정 변경 후 Claude Desktop 재시작
230
+ - Claude Desktop에서 MCP 서버가 올바르게 설정되었는지 확인
231
+
232
+ 4. **작업이 표시되지 않음**
233
+ - API 키 권한 확인
234
+ - 올바른 상태(pending/completed)를 조회하고 있는지 확인
235
+ - 검색 매개변수 사용 시도
236
+
237
+ ### 디버그 모드
238
+
239
+ 디버그 로깅을 활성화하려면:
240
+
241
+ ```bash
242
+ export DEBUG=mcp:*
243
+ ```
244
+
245
+ ## 기여하기
246
+
247
+ 기여를 환영합니다! 다음 단계를 따라주세요:
248
+
249
+ 1. 저장소 포크
250
+ 2. 기능 브랜치 생성 (`git checkout -b feature/amazing-feature`)
251
+ 3. 변경사항 커밋 (`git commit -m 'Add amazing feature'`)
252
+ 4. 브랜치에 푸시 (`git push origin feature/amazing-feature`)
253
+ 5. Pull Request 열기
254
+
255
+ ### 개발 가이드라인
256
+
257
+ - 기존 코드 스타일 따르기
258
+ - 새 기능에 대한 테스트 추가
259
+ - 필요시 문서 업데이트
260
+ - PR 제출 전 모든 테스트 통과 확인
261
+
262
+ ## 라이선스
263
+
264
+ 이 프로젝트는 MIT 라이선스 하에 제공됩니다 - 자세한 내용은 [LICENSE](LICENSE) 파일을 참조하세요.
265
+
266
+ ## 지원
267
+
268
+ - 📧 이메일: support@ainote.dev
269
+ - 🐛 이슈: [GitHub Issues](https://github.com/your-username/ainote-mcp-server/issues)
270
+ - 💬 Discord: [커뮤니티 참여](https://discord.gg/ainote)
271
+
272
+ ## 감사의 말
273
+
274
+ - [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk)로 제작
275
+ - [AI Note](https://ainote.dev)에서 제공
276
+ - [Claude Desktop](https://claude.ai/desktop)을 위해 제작
package/README.md ADDED
@@ -0,0 +1,265 @@
1
+ # AI Note MCP Server
2
+
3
+ [![npm version](https://badge.fury.io/js/%40ainote%2Fmcp-server.svg)](https://badge.fury.io/js/%40ainote%2Fmcp-server)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ A Model Context Protocol (MCP) server that connects Claude Desktop to your AI Note task management system. This server allows Claude to directly interact with your AI Note tasks, enabling task creation, updates, and management through natural language conversations.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Features](#features)
11
+ - [Prerequisites](#prerequisites)
12
+ - [Installation](#installation)
13
+ - [Configuration](#configuration)
14
+ - [Usage](#usage)
15
+ - [Available Tools](#available-tools)
16
+ - [API Reference](#api-reference)
17
+ - [Development](#development)
18
+ - [Troubleshooting](#troubleshooting)
19
+ - [Contributing](#contributing)
20
+ - [License](#license)
21
+
22
+ ## Features
23
+
24
+ - 📝 **Task Management**: Create, update, delete, and list tasks directly from Claude Desktop
25
+ - 🏷️ **Category Support**: Organize tasks with categories
26
+ - 🔍 **Advanced Search**: Search tasks by content, status, and more
27
+ - ⭐ **Priority Management**: Mark tasks as important
28
+ - 📅 **Due Date Support**: Set and manage task due dates
29
+ - 🔒 **Secure API Integration**: Uses API key authentication for secure access
30
+
31
+ ## Prerequisites
32
+
33
+ - Node.js >= 16.0.0
34
+ - npm or yarn
35
+ - AI Note API access (API key required)
36
+ - Claude Desktop with MCP support enabled
37
+
38
+ ## Installation
39
+
40
+ ### Option 1: Install from npm
41
+
42
+ ```bash
43
+ npm install -g @ainote/mcp
44
+ ```
45
+
46
+ ### Option 2: Install from source
47
+
48
+ ```bash
49
+ git clone https://github.com/ainote-dev/ainote-mcp.git
50
+ cd ainote-mcp-server
51
+ npm install
52
+ ```
53
+
54
+ ## Configuration
55
+
56
+ To connect the MCP server with Claude Desktop, follow these steps.
57
+
58
+ ### Step 1: Get your AI Note API Key
59
+
60
+ You need an API key from your AI Note account to allow Claude to access your tasks. You can find or generate your API key in the AI Note app's settings screen.
61
+
62
+ ### Step 2: Configure Claude Desktop
63
+
64
+ Add the `ainote-mcp` server to your Claude Desktop configuration file. This file is located at:
65
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
66
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
67
+
68
+ Open the file and add the following JSON block inside the `mcpServers` object. **Replace `your-api-key-here` with your actual AI Note API key.**
69
+
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "ainote": {
74
+ "command": "ainote-mcp",
75
+ "env": {
76
+ "AINOTE_API_KEY": "your-api-key-here"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ *Note: If you need to connect to a self-hosted or different AI Note server, you can add the `AINOTE_API_URL` environment variable as well.*
84
+
85
+ ```json
86
+ "env": {
87
+ "AINOTE_API_KEY": "your-api-key-here",
88
+ "AINOTE_API_URL": "https://your-custom-api-url.com"
89
+ }
90
+ ```
91
+
92
+ ### Step 3: Restart Claude Desktop
93
+
94
+ After saving the configuration file, **restart Claude Desktop** completely. The new MCP server will be loaded, and you can start managing your AI Note tasks through Claude.
95
+
96
+
97
+ ## Usage
98
+
99
+ Once configured, you can interact with your AI Note tasks through Claude:
100
+
101
+ ### Example Conversations
102
+
103
+ ```
104
+ You: "Show me my pending tasks"
105
+ Claude: I'll retrieve your pending tasks from AI Note...
106
+
107
+ You: "Create a new task to review the quarterly report by Friday"
108
+ Claude: I'll create that task for you with a due date set for Friday...
109
+
110
+ You: "Mark task ID 123 as completed"
111
+ Claude: I'll mark that task as completed...
112
+ ```
113
+
114
+ ## Available Tools
115
+
116
+ ### list_tasks
117
+
118
+ List tasks from AI Note with filtering options.
119
+
120
+ **Parameters:**
121
+ - `status` (optional): Filter by status - "pending" or "completed"
122
+ - `limit` (optional): Maximum number of tasks (default: 25, max: 500)
123
+ - `search` (optional): Search keyword in task content
124
+
125
+ ### create_task
126
+
127
+ Create a new task in AI Note.
128
+
129
+ **Parameters:**
130
+ - `content` (required): Task description
131
+ - `is_important` (optional): Mark as important (boolean)
132
+ - `due_date` (optional): Due date in ISO format
133
+ - `category_id` (optional): Category ID to assign
134
+
135
+ ### update_task
136
+
137
+ Update an existing task.
138
+
139
+ **Parameters:**
140
+ - `id` (required): Task ID
141
+ - `content` (optional): New task content
142
+ - `is_important` (optional): Update important status
143
+ - `completed_at` (optional): Mark as completed (ISO format) or null to uncomplete
144
+
145
+ ### delete_task
146
+
147
+ Soft delete a task.
148
+
149
+ **Parameters:**
150
+ - `id` (required): Task ID to delete
151
+
152
+ ### list_categories
153
+
154
+ List all available categories.
155
+
156
+ **Parameters:** None
157
+
158
+ ## API Reference
159
+
160
+ The MCP server communicates with the AI Note API using the following endpoints:
161
+
162
+ - `GET /api/mcp/tasks` - List tasks
163
+ - `POST /api/mcp/tasks` - Create task
164
+ - `PUT /api/mcp/tasks/:id` - Update task
165
+ - `DELETE /api/mcp/tasks/:id` - Delete task
166
+ - `GET /api/mcp/categories` - List categories
167
+
168
+ All requests require authentication via the `Authorization` header with your API key.
169
+
170
+ ## Development
171
+
172
+ ### Running Locally
173
+
174
+ ```bash
175
+ # Clone the repository
176
+ git clone https://github.com/ainote-dev/ainote-mcp.git
177
+ cd ainote-mcp-server
178
+
179
+ # Install dependencies
180
+ npm install
181
+
182
+ # Run the server
183
+ npm start
184
+ ```
185
+
186
+ ### Testing with Claude Desktop
187
+
188
+ 1. Update your Claude Desktop config to point to your local development server
189
+ 2. Set environment variables for testing
190
+ 3. Restart Claude Desktop
191
+ 4. Check the MCP connection status in Claude Desktop settings
192
+
193
+ ### Project Structure
194
+
195
+ ```
196
+ ainote-mcp-server/
197
+ ├── index.js # Main server implementation
198
+ ├── package.json # Package configuration
199
+ ├── README.md # English documentation
200
+ ├── README-ko.md # Korean documentation
201
+ └── LICENSE # MIT license
202
+ ```
203
+
204
+ ## Troubleshooting
205
+
206
+ ### Common Issues
207
+
208
+ 1. **"API key not found" error**
209
+ - Ensure `AINOTE_API_KEY` is set in your environment or Claude config
210
+ - Check that the API key is valid and has proper permissions
211
+
212
+ 2. **"Connection refused" error**
213
+ - Verify the API URL is correct
214
+ - Check network connectivity
215
+ - Ensure the AI Note API server is running
216
+
217
+ 3. **"Tool not found" error**
218
+ - Restart Claude Desktop after configuration changes
219
+ - Verify the MCP server is properly configured in Claude Desktop
220
+
221
+ 4. **Tasks not appearing**
222
+ - Check API key permissions
223
+ - Verify you're querying the correct status (pending/completed)
224
+ - Try using the search parameter
225
+
226
+ ### Debug Mode
227
+
228
+ To enable debug logging:
229
+
230
+ ```bash
231
+ export DEBUG=mcp:*
232
+ ```
233
+
234
+ ## Contributing
235
+
236
+ We welcome contributions! Please follow these steps:
237
+
238
+ 1. Fork the repository
239
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
240
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
241
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
242
+ 5. Open a Pull Request
243
+
244
+ ### Development Guidelines
245
+
246
+ - Follow the existing code style
247
+ - Add tests for new features
248
+ - Update documentation as needed
249
+ - Ensure all tests pass before submitting PR
250
+
251
+ ## License
252
+
253
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
254
+
255
+ ## Support
256
+
257
+ - 📧 Email: support@ainote.dev
258
+ - 🐛 Issues: [GitHub Issues](https://github.com/ainote-dev/ainote-mcp/issues)
259
+ - 💬 Discord: [Join our community](https://discord.gg/ainote)
260
+
261
+ ## Acknowledgments
262
+
263
+ - Built with [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk)
264
+ - Powered by [AI Note](https://ainote.dev)
265
+ - Made for [Claude Desktop](https://claude.ai/desktop)
package/index.js ADDED
@@ -0,0 +1,229 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
5
+ import axios from 'axios';
6
+
7
+ const API_KEY = process.env.AINOTE_API_KEY;
8
+ const API_URL = process.env.AINOTE_API_URL || 'https://ainote-5muq.onrender.com';
9
+
10
+ // Create axios instance with default config
11
+ const api = axios.create({
12
+ baseURL: API_URL,
13
+ headers: {
14
+ 'Authorization': API_KEY,
15
+ 'Content-Type': 'application/json'
16
+ }
17
+ });
18
+
19
+ // Create MCP server
20
+ const server = new Server(
21
+ {
22
+ name: 'ainote-mcp',
23
+ version: '1.0.0',
24
+ },
25
+ {
26
+ capabilities: {
27
+ tools: {},
28
+ },
29
+ }
30
+ );
31
+
32
+ // Define available tools
33
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
34
+ return {
35
+ tools: [
36
+ {
37
+ name: 'list_tasks',
38
+ description: 'List tasks from AI Note',
39
+ inputSchema: {
40
+ type: 'object',
41
+ properties: {
42
+ status: {
43
+ type: 'string',
44
+ enum: ['pending', 'completed'],
45
+ description: 'Filter by task status'
46
+ },
47
+ limit: {
48
+ type: 'number',
49
+ description: 'Maximum number of tasks to return (default: 25, max: 500)'
50
+ },
51
+ search: {
52
+ type: 'string',
53
+ description: 'Search keyword in task content'
54
+ }
55
+ }
56
+ }
57
+ },
58
+ {
59
+ name: 'create_task',
60
+ description: 'Create a new task in AI Note',
61
+ inputSchema: {
62
+ type: 'object',
63
+ properties: {
64
+ content: {
65
+ type: 'string',
66
+ description: 'Task content'
67
+ },
68
+ is_important: {
69
+ type: 'boolean',
70
+ description: 'Mark task as important'
71
+ },
72
+ due_date: {
73
+ type: 'string',
74
+ description: 'Due date in ISO format'
75
+ },
76
+ category_id: {
77
+ type: 'string',
78
+ description: 'Category ID'
79
+ }
80
+ },
81
+ required: ['content']
82
+ }
83
+ },
84
+ {
85
+ name: 'update_task',
86
+ description: 'Update an existing task',
87
+ inputSchema: {
88
+ type: 'object',
89
+ properties: {
90
+ id: {
91
+ type: 'string',
92
+ description: 'Task ID'
93
+ },
94
+ content: {
95
+ type: 'string',
96
+ description: 'New task content'
97
+ },
98
+ is_important: {
99
+ type: 'boolean',
100
+ description: 'Update important status'
101
+ },
102
+ completed_at: {
103
+ type: 'string',
104
+ description: 'Mark as completed (ISO format) or null to uncomplete'
105
+ }
106
+ },
107
+ required: ['id']
108
+ }
109
+ },
110
+ {
111
+ name: 'delete_task',
112
+ description: 'Delete a task (soft delete)',
113
+ inputSchema: {
114
+ type: 'object',
115
+ properties: {
116
+ id: {
117
+ type: 'string',
118
+ description: 'Task ID to delete'
119
+ }
120
+ },
121
+ required: ['id']
122
+ }
123
+ },
124
+ {
125
+ name: 'list_categories',
126
+ description: 'List all categories',
127
+ inputSchema: {
128
+ type: 'object',
129
+ properties: {}
130
+ }
131
+ }
132
+ ]
133
+ };
134
+ });
135
+
136
+ // Handle tool calls
137
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
138
+ const { name, arguments: args } = request.params;
139
+
140
+ try {
141
+ switch (name) {
142
+ case 'list_tasks': {
143
+ const response = await api.get('/api/mcp/tasks', {
144
+ params: args
145
+ });
146
+ return {
147
+ content: [
148
+ {
149
+ type: 'text',
150
+ text: JSON.stringify(response.data, null, 2)
151
+ }
152
+ ]
153
+ };
154
+ }
155
+
156
+ case 'create_task': {
157
+ const response = await api.post('/api/mcp/tasks', {
158
+ task: args
159
+ });
160
+ return {
161
+ content: [
162
+ {
163
+ type: 'text',
164
+ text: JSON.stringify(response.data, null, 2)
165
+ }
166
+ ]
167
+ };
168
+ }
169
+
170
+ case 'update_task': {
171
+ const { id, ...updateData } = args;
172
+ const response = await api.put(`/api/mcp/tasks/${id}`, {
173
+ task: updateData
174
+ });
175
+ return {
176
+ content: [
177
+ {
178
+ type: 'text',
179
+ text: JSON.stringify(response.data, null, 2)
180
+ }
181
+ ]
182
+ };
183
+ }
184
+
185
+ case 'delete_task': {
186
+ const response = await api.delete(`/api/mcp/tasks/${args.id}`);
187
+ return {
188
+ content: [
189
+ {
190
+ type: 'text',
191
+ text: JSON.stringify(response.data, null, 2)
192
+ }
193
+ ]
194
+ };
195
+ }
196
+
197
+ case 'list_categories': {
198
+ const response = await api.get('/api/mcp/categories');
199
+ return {
200
+ content: [
201
+ {
202
+ type: 'text',
203
+ text: JSON.stringify(response.data, null, 2)
204
+ }
205
+ ]
206
+ };
207
+ }
208
+
209
+ default:
210
+ throw new Error(`Unknown tool: ${name}`);
211
+ }
212
+ } catch (error) {
213
+ return {
214
+ content: [
215
+ {
216
+ type: 'text',
217
+ text: `Error: ${error.message}\n${error.response?.data ? JSON.stringify(error.response.data, null, 2) : ''}`
218
+ }
219
+ ],
220
+ isError: true
221
+ };
222
+ }
223
+ });
224
+
225
+ // Start the server
226
+ const transport = new StdioServerTransport();
227
+ await server.connect(transport);
228
+
229
+ console.error('AI Note MCP proxy server started');
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@ainote/mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for AI Note - Connect Claude Desktop to your AI Note tasks",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "ainote-mcp": "./index.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node index.js",
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
14
+ "keywords": [
15
+ "mcp",
16
+ "modelcontextprotocol",
17
+ "model-context-protocol",
18
+ "claude",
19
+ "claude-desktop",
20
+ "ainote",
21
+ "ai-note",
22
+ "tasks",
23
+ "task-management",
24
+ "todo",
25
+ "productivity",
26
+ "api",
27
+ "integration"
28
+ ],
29
+ "author": "AI Note Team <support@ainote.app>",
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/ainote-dev/ainote-mcp.git"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/ainote-dev/ainote-mcp/issues"
37
+ },
38
+ "homepage": "https://github.com/ainote-dev/ainote-mcp#readme",
39
+ "engines": {
40
+ "node": ">=16.0.0"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.0.0",
44
+ "axios": "^1.6.0"
45
+ },
46
+ "files": [
47
+ "index.js",
48
+ "README.md",
49
+ "README-ko.md",
50
+ "LICENSE"
51
+ ],
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "registry": "https://registry.npmjs.org/"
55
+ }
56
+ }