@isnow890/naver-search-mcp 1.0.7 → 1.0.18
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.
- package/LICENSE +21 -21
- package/README.md +187 -205
- package/dist/package.json +39 -0
- package/dist/src/index.js +20 -11
- package/dist/src/naver-search.client.js +155 -0
- package/dist/src/schemas/search.schemas.js +15 -0
- package/package.json +39 -41
- package/dist/src/clients/naver-api-core.client.d.ts +0 -11
- package/dist/src/clients/naver-search.client.d.ts +0 -70
- package/dist/src/handlers/datalab.handlers.d.ts +0 -61
- package/dist/src/handlers/search.handlers.d.ts +0 -44
- package/dist/src/index.d.ts +0 -1
- package/dist/src/schemas/datalab.schemas.d.ts +0 -336
- package/dist/src/schemas/search.schemas.d.ts +0 -66
- package/dist/src/tools/datalab.tools.d.ts +0 -13
- package/dist/src/tools/search.tools.d.ts +0 -13
- package/dist/src/types/datalab.types.d.ts +0 -78
- package/dist/src/types/search.types.d.ts +0 -44
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 isnow890
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 isnow890
|
|
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.md
CHANGED
|
@@ -1,205 +1,187 @@
|
|
|
1
|
-
# Naver Search MCP Server
|
|
2
|
-
|
|
3
|
-
[](README-ko.md)
|
|
4
|
-
[](https://smithery.ai/server/@isnow890/naver-search-mcp)
|
|
5
|
-
[](https://mcp.so/server/naver-search-mcp/isnow890)
|
|
6
|
-
|
|
7
|
-
MCP server for Naver Search API and DataLab API integration, enabling comprehensive search across various Naver services and data trend analysis.
|
|
8
|
-
|
|
9
|
-
#### Version History
|
|
10
|
-
|
|
11
|
-
###### 1.0.2 (2025-04-26)
|
|
12
|
-
|
|
13
|
-
- README updated: cafe article search tool and version history section improved
|
|
14
|
-
|
|
15
|
-
###### 1.0.1 (2025-04-26)
|
|
16
|
-
|
|
17
|
-
- Cafe article search feature added
|
|
18
|
-
- Shopping category info added to zod
|
|
19
|
-
- Source code refactored
|
|
20
|
-
|
|
21
|
-
###### 1.0.0 (2025-04-08)
|
|
22
|
-
|
|
23
|
-
- Initial release
|
|
24
|
-
|
|
25
|
-
#### Information
|
|
26
|
-
|
|
27
|
-
**If you want to install the MCP via npm, do NOT use @mseep/server-naver-search (https://www.npmjs.com/package/@mseep/server-naver-search). That package is a copy of my work and was published without my permission. The npx version of that package is also broken and will not work properly. Please use this official package instead.**
|
|
28
|
-
|
|
29
|
-
#### Prerequisites
|
|
30
|
-
|
|
31
|
-
- Naver Developers API Key (Client ID and Secret)
|
|
32
|
-
- Node.js 18 or higher
|
|
33
|
-
- NPM 8 or higher
|
|
34
|
-
- Docker (optional, for container deployment)
|
|
35
|
-
|
|
36
|
-
#### Getting API Keys
|
|
37
|
-
|
|
38
|
-
1. Visit [Naver Developers](https://developers.naver.com/apps/#/register)
|
|
39
|
-
2. Click "Register Application"
|
|
40
|
-
3. Enter application name and select ALL of the following APIs:
|
|
41
|
-
- Search (for blog, news, book search, etc.)
|
|
42
|
-
- DataLab (Search Trends)
|
|
43
|
-
- DataLab (Shopping Insight)
|
|
44
|
-
4. Set the obtained Client ID and Client Secret as environment variables
|
|
45
|
-
|
|
46
|
-
## Tool Details
|
|
47
|
-
|
|
48
|
-
### Available tools:
|
|
49
|
-
|
|
50
|
-
- **search_webkr**: Search Naver web documents
|
|
51
|
-
- **search_news**: Search Naver news
|
|
52
|
-
- **search_blog**: Search Naver blogs
|
|
53
|
-
- **search_cafearticle**: Search Naver cafe articles
|
|
54
|
-
- **search_shop**: Search Naver shopping
|
|
55
|
-
- **search_image**: Search Naver images
|
|
56
|
-
- **search_kin**: Search Naver KnowledgeiN
|
|
57
|
-
- **search_book**: Search Naver books
|
|
58
|
-
- **search_encyc**: Search Naver encyclopedia
|
|
59
|
-
- **search_academic**: Search Naver academic papers
|
|
60
|
-
- **search_local**: Search Naver local places
|
|
61
|
-
- **datalab_search**: Analyze search term trends
|
|
62
|
-
- **datalab_shopping_category**: Analyze shopping category trends
|
|
63
|
-
- **datalab_shopping_by_device**: Analyze shopping trends by device
|
|
64
|
-
- **datalab_shopping_by_gender**: Analyze shopping trends by gender
|
|
65
|
-
- **datalab_shopping_by_age**: Analyze shopping trends by age group
|
|
66
|
-
- **datalab_shopping_keywords**: Analyze shopping keyword trends
|
|
67
|
-
- **datalab_shopping_keyword_by_device**: Analyze shopping keyword trends by device
|
|
68
|
-
- **datalab_shopping_keyword_by_gender**: Analyze shopping keyword trends by gender
|
|
69
|
-
- **datalab_shopping_keyword_by_age**: Analyze shopping keyword trends by age group
|
|
70
|
-
|
|
71
|
-
## Installation
|
|
72
|
-
|
|
73
|
-
### Option 1: Quick Install via Smithery (Recommended)
|
|
74
|
-
|
|
75
|
-
To install Naver Search MCP Server automatically via Smithery, use one of these commands based on your AI client:
|
|
76
|
-
|
|
77
|
-
For Claude Desktop:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client claude
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
For Cursor:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client cursor
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
For Windsurf:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client windsurf
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
For Cline:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client cline
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
The installer will prompt you for:
|
|
102
|
-
|
|
103
|
-
- NAVER_CLIENT_ID
|
|
104
|
-
- NAVER_CLIENT_SECRET
|
|
105
|
-
|
|
106
|
-
### Option 2: Manual Installation
|
|
107
|
-
|
|
108
|
-
#### Environment Variables
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
# Windows
|
|
112
|
-
set NAVER_CLIENT_ID=your_client_id
|
|
113
|
-
set NAVER_CLIENT_SECRET=your_client_secret
|
|
114
|
-
|
|
115
|
-
# Linux/Mac
|
|
116
|
-
export NAVER_CLIENT_ID=your_client_id
|
|
117
|
-
export NAVER_CLIENT_SECRET=your_client_secret
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
#### Run with NPX
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npx @
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
#### Run with Docker
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
docker run -i --rm \
|
|
130
|
-
-e NAVER_CLIENT_ID=your_client_id \
|
|
131
|
-
-e NAVER_CLIENT_SECRET=your_client_secret \
|
|
132
|
-
mcp/naver-search
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
##
|
|
136
|
-
|
|
137
|
-
Add to `claude_desktop_config.json`:
|
|
138
|
-
|
|
139
|
-
```json
|
|
140
|
-
{
|
|
141
|
-
"mcpServers": {
|
|
142
|
-
"naver-search": {
|
|
143
|
-
"command": "npx",
|
|
144
|
-
"args": ["-y", "@
|
|
145
|
-
"env": {
|
|
146
|
-
"NAVER_CLIENT_ID": "your_client_id",
|
|
147
|
-
"NAVER_CLIENT_SECRET": "your_client_secret"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
"mcp/naver-search"
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## Build
|
|
196
|
-
|
|
197
|
-
Docker build:
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
docker build -t mcp/naver-search .
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## License
|
|
204
|
-
|
|
205
|
-
MIT License
|
|
1
|
+
# Naver Search MCP Server
|
|
2
|
+
|
|
3
|
+
[](README-ko.md)
|
|
4
|
+
[](https://smithery.ai/server/@isnow890/naver-search-mcp)
|
|
5
|
+
[](https://mcp.so/server/naver-search-mcp/isnow890)
|
|
6
|
+
|
|
7
|
+
MCP server for Naver Search API and DataLab API integration, enabling comprehensive search across various Naver services and data trend analysis.
|
|
8
|
+
|
|
9
|
+
#### Version History
|
|
10
|
+
|
|
11
|
+
###### 1.0.2 (2025-04-26)
|
|
12
|
+
|
|
13
|
+
- README updated: cafe article search tool and version history section improved
|
|
14
|
+
|
|
15
|
+
###### 1.0.1 (2025-04-26)
|
|
16
|
+
|
|
17
|
+
- Cafe article search feature added
|
|
18
|
+
- Shopping category info added to zod
|
|
19
|
+
- Source code refactored
|
|
20
|
+
|
|
21
|
+
###### 1.0.0 (2025-04-08)
|
|
22
|
+
|
|
23
|
+
- Initial release
|
|
24
|
+
|
|
25
|
+
#### Information
|
|
26
|
+
|
|
27
|
+
**If you want to install the MCP via npm, do NOT use @mseep/server-naver-search (https://www.npmjs.com/package/@mseep/server-naver-search). That package is a copy of my work and was published without my permission. The npx version of that package is also broken and will not work properly. Please use this official package instead.**
|
|
28
|
+
|
|
29
|
+
#### Prerequisites
|
|
30
|
+
|
|
31
|
+
- Naver Developers API Key (Client ID and Secret)
|
|
32
|
+
- Node.js 18 or higher
|
|
33
|
+
- NPM 8 or higher
|
|
34
|
+
- Docker (optional, for container deployment)
|
|
35
|
+
|
|
36
|
+
#### Getting API Keys
|
|
37
|
+
|
|
38
|
+
1. Visit [Naver Developers](https://developers.naver.com/apps/#/register)
|
|
39
|
+
2. Click "Register Application"
|
|
40
|
+
3. Enter application name and select ALL of the following APIs:
|
|
41
|
+
- Search (for blog, news, book search, etc.)
|
|
42
|
+
- DataLab (Search Trends)
|
|
43
|
+
- DataLab (Shopping Insight)
|
|
44
|
+
4. Set the obtained Client ID and Client Secret as environment variables
|
|
45
|
+
|
|
46
|
+
## Tool Details
|
|
47
|
+
|
|
48
|
+
### Available tools:
|
|
49
|
+
|
|
50
|
+
- **search_webkr**: Search Naver web documents
|
|
51
|
+
- **search_news**: Search Naver news
|
|
52
|
+
- **search_blog**: Search Naver blogs
|
|
53
|
+
- **search_cafearticle**: Search Naver cafe articles
|
|
54
|
+
- **search_shop**: Search Naver shopping
|
|
55
|
+
- **search_image**: Search Naver images
|
|
56
|
+
- **search_kin**: Search Naver KnowledgeiN
|
|
57
|
+
- **search_book**: Search Naver books
|
|
58
|
+
- **search_encyc**: Search Naver encyclopedia
|
|
59
|
+
- **search_academic**: Search Naver academic papers
|
|
60
|
+
- **search_local**: Search Naver local places
|
|
61
|
+
- **datalab_search**: Analyze search term trends
|
|
62
|
+
- **datalab_shopping_category**: Analyze shopping category trends
|
|
63
|
+
- **datalab_shopping_by_device**: Analyze shopping trends by device
|
|
64
|
+
- **datalab_shopping_by_gender**: Analyze shopping trends by gender
|
|
65
|
+
- **datalab_shopping_by_age**: Analyze shopping trends by age group
|
|
66
|
+
- **datalab_shopping_keywords**: Analyze shopping keyword trends
|
|
67
|
+
- **datalab_shopping_keyword_by_device**: Analyze shopping keyword trends by device
|
|
68
|
+
- **datalab_shopping_keyword_by_gender**: Analyze shopping keyword trends by gender
|
|
69
|
+
- **datalab_shopping_keyword_by_age**: Analyze shopping keyword trends by age group
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
### Option 1: Quick Install via Smithery (Recommended)
|
|
74
|
+
|
|
75
|
+
To install Naver Search MCP Server automatically via Smithery, use one of these commands based on your AI client:
|
|
76
|
+
|
|
77
|
+
For Claude Desktop:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client claude
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For Cursor:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client cursor
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For Windsurf:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client windsurf
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For Cline:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx -y @smithery/cli@latest install @isnow890/naver-search-mcp --client cline
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The installer will prompt you for:
|
|
102
|
+
|
|
103
|
+
- NAVER_CLIENT_ID
|
|
104
|
+
- NAVER_CLIENT_SECRET
|
|
105
|
+
|
|
106
|
+
### Option 2: Manual Installation
|
|
107
|
+
|
|
108
|
+
#### Environment Variables
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Windows
|
|
112
|
+
set NAVER_CLIENT_ID=your_client_id
|
|
113
|
+
set NAVER_CLIENT_SECRET=your_client_secret
|
|
114
|
+
|
|
115
|
+
# Linux/Mac
|
|
116
|
+
export NAVER_CLIENT_ID=your_client_id
|
|
117
|
+
export NAVER_CLIENT_SECRET=your_client_secret
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Run with NPX
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npx @modelcontextprotocol/server-naver-search
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### Run with Docker
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
docker run -i --rm \
|
|
130
|
+
-e NAVER_CLIENT_ID=your_client_id \
|
|
131
|
+
-e NAVER_CLIENT_SECRET=your_client_secret \
|
|
132
|
+
mcp/naver-search
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Cursor Desktop Configuration
|
|
136
|
+
|
|
137
|
+
Add to `claude_desktop_config.json`:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"mcpServers": {
|
|
142
|
+
"naver-search": {
|
|
143
|
+
"command": "npx",
|
|
144
|
+
"args": ["-y", "@modelcontextprotocol/server-naver-search"],
|
|
145
|
+
"env": {
|
|
146
|
+
"NAVER_CLIENT_ID": "your_client_id",
|
|
147
|
+
"NAVER_CLIENT_SECRET": "your_client_secret"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
For Docker:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"mcpServers": {
|
|
159
|
+
"naver-search": {
|
|
160
|
+
"command": "docker",
|
|
161
|
+
"args": [
|
|
162
|
+
"run",
|
|
163
|
+
"-i",
|
|
164
|
+
"--rm",
|
|
165
|
+
"-e",
|
|
166
|
+
"NAVER_CLIENT_ID=your_client_id",
|
|
167
|
+
"-e",
|
|
168
|
+
"NAVER_CLIENT_SECRET=your_client_secret",
|
|
169
|
+
"mcp/naver-search"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
## Build
|
|
176
|
+
|
|
177
|
+
Docker build:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
docker build -t mcp/naver-search .
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT License
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@isnow890/naver-search-mcp",
|
|
3
|
+
"version": "1.0.18",
|
|
4
|
+
"description": "Naver Search MCP Server",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"prebuild": "shx rm -rf dist",
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"prepare": "npm run build",
|
|
14
|
+
"watch": "tsc --watch",
|
|
15
|
+
"start": "node dist/src/index.js"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "1.10.2",
|
|
22
|
+
"axios": "^1.6.7",
|
|
23
|
+
"zod": "^3.22.4",
|
|
24
|
+
"zod-to-json-schema": "^3.23.5",
|
|
25
|
+
"sharp": "^0.33.2",
|
|
26
|
+
"dotenv": "^16.4.5"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^22",
|
|
30
|
+
"shx": "^0.3.4",
|
|
31
|
+
"typescript": "^5.3.3"
|
|
32
|
+
},
|
|
33
|
+
"author": "isnow890",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"bin": {
|
|
36
|
+
"naver-search-mcp": "dist/src/index.js"
|
|
37
|
+
},
|
|
38
|
+
"type": "module"
|
|
39
|
+
}
|
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import * as dotenv from "dotenv";
|
|
3
|
+
import pkg from "../package.json" with { type: "json" };
|
|
4
|
+
console.error("[MCP] dotenv import 완료");
|
|
2
5
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
7
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -8,12 +11,13 @@ import { datalabTools } from "./tools/datalab.tools.js";
|
|
|
8
11
|
import { searchToolHandlers } from "./handlers/search.handlers.js";
|
|
9
12
|
import { datalabToolHandlers } from "./handlers/datalab.handlers.js";
|
|
10
13
|
dotenv.config();
|
|
11
|
-
console.
|
|
14
|
+
console.error("[MCP] dotenv.config() 실행됨");
|
|
12
15
|
// 환경 변수 유효성 검사
|
|
13
16
|
const NAVER_CLIENT_ID = process.env.NAVER_CLIENT_ID;
|
|
14
17
|
const NAVER_CLIENT_SECRET = process.env.NAVER_CLIENT_SECRET;
|
|
18
|
+
console.error("[MCP] 환경변수 읽음", { NAVER_CLIENT_ID, NAVER_CLIENT_SECRET });
|
|
15
19
|
if (!NAVER_CLIENT_ID || !NAVER_CLIENT_SECRET) {
|
|
16
|
-
console.error("Error: NAVER_CLIENT_ID and NAVER_CLIENT_SECRET environment variables are required");
|
|
20
|
+
console.error("[MCP] Error: NAVER_CLIENT_ID and NAVER_CLIENT_SECRET environment variables are required");
|
|
17
21
|
process.exit(1);
|
|
18
22
|
}
|
|
19
23
|
// 네이버 검색 클라이언트 초기화
|
|
@@ -22,17 +26,20 @@ client.initialize({
|
|
|
22
26
|
clientId: NAVER_CLIENT_ID,
|
|
23
27
|
clientSecret: NAVER_CLIENT_SECRET,
|
|
24
28
|
});
|
|
29
|
+
console.error("[MCP] NaverSearchClient 초기화 완료");
|
|
25
30
|
// MCP 서버 인스턴스 생성
|
|
26
31
|
const server = new Server({
|
|
27
32
|
name: "naver-search",
|
|
28
|
-
version:
|
|
33
|
+
version: pkg.version,
|
|
29
34
|
}, {
|
|
30
35
|
capabilities: {
|
|
31
36
|
tools: {},
|
|
32
37
|
},
|
|
33
38
|
});
|
|
39
|
+
console.error("[MCP] Server 인스턴스 생성 완료");
|
|
34
40
|
// 도구 목록을 반환하는 핸들러 등록
|
|
35
41
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
42
|
+
console.error("[MCP] ListToolsRequestSchema 핸들러 호출됨");
|
|
36
43
|
return {
|
|
37
44
|
tools: [...searchTools, ...datalabTools],
|
|
38
45
|
};
|
|
@@ -44,7 +51,7 @@ const toolHandlers = {
|
|
|
44
51
|
// 에러 응답 헬퍼 함수
|
|
45
52
|
function createErrorResponse(error) {
|
|
46
53
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
47
|
-
console.error("API Error:", errorMessage);
|
|
54
|
+
console.error("[MCP] API Error:", errorMessage);
|
|
48
55
|
return {
|
|
49
56
|
content: [{ type: "text", text: `Error: ${errorMessage}` }],
|
|
50
57
|
isError: true,
|
|
@@ -54,7 +61,7 @@ function createErrorResponse(error) {
|
|
|
54
61
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
55
62
|
try {
|
|
56
63
|
const { name, arguments: args } = request.params;
|
|
57
|
-
console.error(`Executing tool: ${name} with args:`, args);
|
|
64
|
+
console.error(`[MCP] Executing tool: ${name} with args:`, args);
|
|
58
65
|
if (!args) {
|
|
59
66
|
throw new Error("Arguments are required");
|
|
60
67
|
}
|
|
@@ -62,7 +69,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
62
69
|
if (!handler)
|
|
63
70
|
throw new Error(`Unknown tool: ${name}`);
|
|
64
71
|
const result = await handler(args);
|
|
65
|
-
console.error(`Tool ${name} executed successfully`);
|
|
72
|
+
console.error(`[MCP] Tool ${name} executed successfully`);
|
|
66
73
|
return {
|
|
67
74
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
68
75
|
};
|
|
@@ -74,24 +81,26 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
74
81
|
// 서버 시작 함수
|
|
75
82
|
async function runServer() {
|
|
76
83
|
try {
|
|
84
|
+
console.error("[MCP] runServer 진입");
|
|
77
85
|
const transport = new StdioServerTransport();
|
|
78
86
|
// 서버 에러 핸들링
|
|
79
87
|
process.on("uncaughtException", (error) => {
|
|
80
|
-
console.error("Uncaught Exception:", error);
|
|
88
|
+
console.error("[MCP] Uncaught Exception:", error);
|
|
81
89
|
});
|
|
82
90
|
process.on("unhandledRejection", (reason, promise) => {
|
|
83
|
-
console.error("Unhandled Rejection at:", promise, "reason:", reason);
|
|
91
|
+
console.error("[MCP] Unhandled Rejection at:", promise, "reason:", reason);
|
|
84
92
|
});
|
|
85
93
|
await server.connect(transport);
|
|
86
|
-
console.error("Naver Search MCP Server running on stdio");
|
|
94
|
+
console.error("[MCP] Naver Search MCP Server running on stdio");
|
|
87
95
|
}
|
|
88
96
|
catch (error) {
|
|
89
|
-
console.error("Fatal error running server:", error);
|
|
97
|
+
console.error("[MCP] Fatal error running server:", error);
|
|
90
98
|
process.exit(1);
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
101
|
// 서버 시작
|
|
102
|
+
console.error("[MCP] runServer 호출 직전");
|
|
94
103
|
runServer().catch((error) => {
|
|
95
|
-
console.error("Fatal error running server:", error);
|
|
104
|
+
console.error("[MCP] Fatal error running server (catch):", error);
|
|
96
105
|
process.exit(1);
|
|
97
106
|
});
|