@amplify-studio/open-mcp 0.9.0 → 0.10.1
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/README.md +352 -325
- package/dist/api/zhipu.d.ts +32 -0
- package/dist/api/zhipu.js +68 -0
- package/dist/error-handler.d.ts +3 -9
- package/dist/error-handler.js +23 -35
- package/dist/index.d.ts +1 -9
- package/dist/index.js +123 -86
- package/dist/resources.js +43 -16
- package/dist/search.js +25 -30
- package/dist/tools/image-generate.d.ts +5 -0
- package/dist/tools/image-generate.js +29 -0
- package/dist/tools/image-ocr.d.ts +5 -0
- package/dist/tools/image-ocr.js +102 -0
- package/dist/tools/image-understand.d.ts +5 -0
- package/dist/tools/image-understand.js +54 -0
- package/dist/types.d.ts +22 -7
- package/dist/types.js +112 -5
- package/dist/url-reader.d.ts +2 -1
- package/dist/url-reader.js +21 -27
- package/dist/utils/file-helper.d.ts +19 -0
- package/dist/utils/file-helper.js +77 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,121 +1,127 @@
|
|
|
1
|
-
# Open MCP
|
|
2
|
-
|
|
3
|
-
> An open-source MCP (Model Context Protocol) server solution for AI agent integration.
|
|
1
|
+
# Open MCP Search Server
|
|
4
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@amplify-studio/open-mcp)
|
|
4
|
+
[](https://www.npmjs.com/package/@amplify-studio/open-mcp)
|
|
5
|
+
[](https://hub.docker.com/r/amplifystudio/open-mcp)
|
|
5
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/amplify-studio/open-mcp)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Looking for free web search and page reading services? Want better MCP integration? Try this project!
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
**Doc Language:** [English](README.md) | [中文](readme/zh-CN.md)
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Deploy your own local web search and page reading service in one click. Powered by SearXNG and Firecrawl, integrated with Claude via MCP protocol.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
- General web queries via Firecrawl API
|
|
15
|
-
- Configurable result limit (default: 10, max: 100)
|
|
16
|
-
- JSON-formatted structured output
|
|
15
|
+
## Features
|
|
17
16
|
|
|
18
|
-
###
|
|
19
|
-
- Extract web page content as text/markdown
|
|
20
|
-
- Intelligent caching with TTL
|
|
21
|
-
- Section extraction and pagination options
|
|
17
|
+
### MCP Tools
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
Tools provided to AI assistants via MCP protocol:
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
21
|
+
- 🔍 **Web Search** - Search the web with pagination, time filtering, and language options
|
|
22
|
+
- 📄 **URL Reading** - Extract web page content as markdown with advanced filtering
|
|
23
|
+
- 🎨 **Image Understanding** - Analyze images, videos, and documents using Zhipu AI
|
|
24
|
+
- 🖼️ **Image Generation** - Generate images from text using Zhipu AI
|
|
29
25
|
|
|
30
|
-
###
|
|
31
|
-
- 🔄 Document indexing
|
|
32
|
-
- 🔄 Semantic search
|
|
33
|
-
- 🔄 Vector storage integration
|
|
26
|
+
### Server Features
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
- ⏳ Database connectors
|
|
37
|
-
- ⏳ API integrations
|
|
38
|
-
- ⏳ File system access
|
|
28
|
+
Infrastructure capabilities for deployment and performance:
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
- ⏳ Multi-agent coordination
|
|
30
|
+
- 💾 **Smart Caching** - Automatic caching with TTL to improve performance
|
|
31
|
+
- 🔄 **Dual Transport** - STDIO or HTTP modes for flexible deployment
|
|
32
|
+
- ⏱️ **Auto Cleanup** - Automatic shutdown after 3min of inactivity
|
|
44
33
|
|
|
45
|
-
|
|
34
|
+
### Powered By
|
|
46
35
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
│ Gateway API │
|
|
76
|
-
│ (External) │
|
|
77
|
-
└─────────────────┘
|
|
78
|
-
```
|
|
36
|
+
| Feature | Powered By |
|
|
37
|
+
|---------|------------|
|
|
38
|
+
| Search | [SearXNG](https://searxng.org/) - Privacy-respecting metasearch |
|
|
39
|
+
| Scraping | [Firecrawl](https://www.firecrawl.dev/) - Web scraping API |
|
|
40
|
+
| Image AI | [Zhipu AI](https://open.bigmodel.cn/) - Free tier for vision models |
|
|
41
|
+
| Protocol | [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) - Official implementation |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Compatible Clients
|
|
46
|
+
|
|
47
|
+
Works with any MCP client:
|
|
48
|
+
|
|
49
|
+
- **Claude Desktop** / **Claude Code** / **Cursor** / **Cline**
|
|
50
|
+
- **Continue.dev**
|
|
51
|
+
- **HTTP Mode** (for remote deployment)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
### Prerequisites
|
|
58
|
+
|
|
59
|
+
Before using this MCP server, you need:
|
|
60
|
+
|
|
61
|
+
1. **A running Gateway API instance** with SearXNG and Firecrawl
|
|
62
|
+
- Deploy your own Gateway or use a hosted service
|
|
63
|
+
- Get your Gateway URL (e.g., `http://your-gateway.com:80`)
|
|
79
64
|
|
|
80
|
-
|
|
65
|
+
2. **(Optional) Zhipu AI API Key** for image features
|
|
66
|
+
- See [Getting Zhipu AI API Key](#getting-zhipu-ai-api-key) below
|
|
81
67
|
|
|
82
|
-
###
|
|
68
|
+
### Setting Up Gateway
|
|
69
|
+
|
|
70
|
+
The open-mcp server requires a Gateway API instance. You can deploy your own using Docker Compose:
|
|
71
|
+
|
|
72
|
+
**Quick Start:**
|
|
83
73
|
|
|
84
|
-
**Using Claude CLI:**
|
|
85
74
|
```bash
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
# Clone the repository (if not already done)
|
|
76
|
+
git clone https://github.com/amplify-studio/open-mcp.git
|
|
77
|
+
cd open-mcp
|
|
78
|
+
|
|
79
|
+
# Start the Gateway services
|
|
80
|
+
docker compose --env-file .env up -d
|
|
81
|
+
|
|
82
|
+
# Verify it's running
|
|
83
|
+
curl http://localhost:80/health
|
|
90
84
|
```
|
|
91
85
|
|
|
92
|
-
**
|
|
86
|
+
**What's Included:**
|
|
87
|
+
|
|
88
|
+
The Gateway includes 7 services that work together:
|
|
89
|
+
|
|
90
|
+
| Service | Purpose | Port |
|
|
91
|
+
|---------|---------|------|
|
|
92
|
+
| **SearXNG** | Privacy-respecting metasearch engine | 8888 (internal) |
|
|
93
|
+
| **Firecrawl API** | Web scraping and crawling | 3002 (internal) |
|
|
94
|
+
| **Playwright** | Browser automation for dynamic content | 3000 (internal) |
|
|
95
|
+
| **Reader Adapter** | Jina Reader compatible API | 8082 (internal) |
|
|
96
|
+
| **Redis** | Rate limiting and caching | 6379 (internal) |
|
|
97
|
+
| **PostgreSQL** | Data persistence | 5432 (internal) |
|
|
98
|
+
| **Nginx** | API gateway (public endpoint) | **80** |
|
|
99
|
+
|
|
100
|
+
**API Endpoints (via Nginx on port 80):**
|
|
101
|
+
|
|
102
|
+
- 🔍 **Search:** `http://localhost:80/api/search/`
|
|
103
|
+
- 📄 **Read URL:** `http://localhost:80/api/read/<url>`
|
|
104
|
+
- 📊 **Status:** `http://localhost:80/api/status`
|
|
105
|
+
|
|
106
|
+
**Management:**
|
|
107
|
+
|
|
93
108
|
```bash
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
109
|
+
# View logs
|
|
110
|
+
docker compose logs -f
|
|
111
|
+
|
|
112
|
+
# Stop services
|
|
113
|
+
docker compose down
|
|
114
|
+
|
|
115
|
+
# Restart services
|
|
116
|
+
docker compose restart
|
|
101
117
|
```
|
|
102
118
|
|
|
103
|
-
|
|
119
|
+
For detailed configuration, see [docker-compose.yml](docker-compose.yml) and [.env.example](.env.example).
|
|
104
120
|
|
|
105
|
-
|
|
121
|
+
### Basic Usage
|
|
106
122
|
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
"mcpServers": {
|
|
110
|
-
"open-mcp": {
|
|
111
|
-
"command": "npx",
|
|
112
|
-
"args": ["-y", "@amplify-studio/open-mcp@latest"]
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
```
|
|
123
|
+
Add to your Claude Desktop configuration (`claude_desktop_config.json`):
|
|
117
124
|
|
|
118
|
-
**With custom gateway:**
|
|
119
125
|
```json
|
|
120
126
|
{
|
|
121
127
|
"mcpServers": {
|
|
@@ -123,279 +129,268 @@ Edit `claude_desktop_config.json`:
|
|
|
123
129
|
"command": "npx",
|
|
124
130
|
"args": ["-y", "@amplify-studio/open-mcp@latest"],
|
|
125
131
|
"env": {
|
|
126
|
-
"GATEWAY_URL": "http://
|
|
132
|
+
"GATEWAY_URL": "http://your-gateway.com:80",
|
|
133
|
+
"ZHIPUAI_API_KEY": "your-zhipu-api-key"
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
136
|
}
|
|
130
137
|
}
|
|
131
138
|
```
|
|
132
139
|
|
|
133
|
-
|
|
140
|
+
**Replace:**
|
|
141
|
+
- `http://your-gateway.com:80` with your actual Gateway URL (**required**)
|
|
142
|
+
- `your-zhipu-api-key` with your Zhipu AI API key (**optional** - only needed for image features)
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Usage
|
|
134
147
|
|
|
135
|
-
|
|
148
|
+
### Web Search Tool
|
|
149
|
+
|
|
150
|
+
**Tool Name:** `searxng_web_search`
|
|
151
|
+
|
|
152
|
+
**Parameters:**
|
|
153
|
+
- `query` (string, required): The search query
|
|
154
|
+
- `limit` (number, optional): Maximum results (1-100, default: 10)
|
|
155
|
+
|
|
156
|
+
**Example:**
|
|
136
157
|
|
|
137
158
|
```json
|
|
138
159
|
{
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
160
|
+
"query": "Model Context Protocol",
|
|
161
|
+
"limit": 5
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Response:**
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"query": "Model Context Protocol",
|
|
170
|
+
"results": [
|
|
171
|
+
{
|
|
172
|
+
"title": "Result Title",
|
|
173
|
+
"content": "Description or snippet...",
|
|
174
|
+
"url": "https://example.com"
|
|
143
175
|
}
|
|
144
|
-
|
|
176
|
+
],
|
|
177
|
+
"totalCount": 5,
|
|
178
|
+
"duration": "234ms"
|
|
145
179
|
}
|
|
146
180
|
```
|
|
147
181
|
|
|
148
|
-
###
|
|
182
|
+
### URL Reading Tool
|
|
149
183
|
|
|
150
|
-
|
|
151
|
-
# Clone the repository
|
|
152
|
-
git clone https://github.com/amplify-studio/open-mcp.git
|
|
153
|
-
cd open-mcp
|
|
184
|
+
**Tool Name:** `web_url_read`
|
|
154
185
|
|
|
155
|
-
|
|
156
|
-
|
|
186
|
+
**Parameters:**
|
|
187
|
+
- `url` (string, required): The URL to fetch
|
|
188
|
+
- `startChar` (number, optional): Starting character position (default: 0)
|
|
189
|
+
- `maxLength` (number, optional): Maximum characters to return
|
|
190
|
+
- `section` (string, optional): Extract content under specific heading
|
|
191
|
+
- `paragraphRange` (string, optional): Paragraph range like '1-5', '3', '10-'
|
|
192
|
+
- `readHeadings` (boolean, optional): Return only headings (default: false)
|
|
157
193
|
|
|
158
|
-
|
|
159
|
-
npm run build
|
|
194
|
+
**Example:**
|
|
160
195
|
|
|
161
|
-
|
|
162
|
-
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"url": "https://example.com/article",
|
|
199
|
+
"maxLength": 5000,
|
|
200
|
+
"section": "Introduction"
|
|
201
|
+
}
|
|
163
202
|
```
|
|
164
203
|
|
|
165
|
-
**
|
|
204
|
+
**Response:**
|
|
205
|
+
|
|
166
206
|
```json
|
|
167
207
|
{
|
|
168
|
-
"
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
208
|
+
"url": "https://example.com/article",
|
|
209
|
+
"content": "# Article Content\n\n...",
|
|
210
|
+
"charCount": 1500,
|
|
211
|
+
"duration": "456ms",
|
|
212
|
+
"cached": false
|
|
174
213
|
}
|
|
175
214
|
```
|
|
176
215
|
|
|
177
|
-
###
|
|
216
|
+
### Image Understanding Tool
|
|
178
217
|
|
|
179
|
-
|
|
180
|
-
cd open-mcp
|
|
181
|
-
npm run inspector
|
|
182
|
-
# Visit http://localhost:6274 to test
|
|
183
|
-
```
|
|
218
|
+
**Tool Name:** `image_understand`
|
|
184
219
|
|
|
185
|
-
|
|
220
|
+
**Parameters:**
|
|
221
|
+
- `files` (array, required): File paths, URLs, or base64 data
|
|
222
|
+
- `prompt` (string, required): Question or instruction
|
|
223
|
+
- `thinking` (boolean, optional): Enable deep thinking mode
|
|
186
224
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
225
|
+
**Example:**
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"files": ["/path/to/image.png"],
|
|
230
|
+
"prompt": "What objects are in this image?",
|
|
231
|
+
"thinking": false
|
|
232
|
+
}
|
|
191
233
|
```
|
|
192
234
|
|
|
193
|
-
|
|
235
|
+
**Response:** Text description or answer
|
|
194
236
|
|
|
195
|
-
|
|
237
|
+
### Image Generation Tool
|
|
196
238
|
|
|
197
|
-
|
|
239
|
+
**Tool Name:** `image_generate`
|
|
198
240
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
241
|
+
**Parameters:**
|
|
242
|
+
- `prompt` (string, required): Image description
|
|
243
|
+
- `size` (string, optional): Image size (default: "1024x1024")
|
|
202
244
|
|
|
203
|
-
|
|
204
|
-
claude mcp add-json -s user open-mcp '{
|
|
205
|
-
"command": "npx",
|
|
206
|
-
"args": ["-y", "@amplify-studio/open-mcp@latest"]
|
|
207
|
-
}'
|
|
208
|
-
```
|
|
245
|
+
**Example:**
|
|
209
246
|
|
|
210
|
-
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"prompt": "A beautiful sunset over mountains",
|
|
250
|
+
"size": "1024x1024"
|
|
251
|
+
}
|
|
252
|
+
```
|
|
211
253
|
|
|
212
|
-
|
|
254
|
+
**Response:** Image URL
|
|
213
255
|
|
|
214
|
-
|
|
215
|
-
# Clear npx cache
|
|
216
|
-
npm cache clean --force
|
|
256
|
+
---
|
|
217
257
|
|
|
218
|
-
|
|
219
|
-
claude mcp remove open-mcp
|
|
220
|
-
claude mcp add-json -s user open-mcp '{
|
|
221
|
-
"command": "npx",
|
|
222
|
-
"args": ["-y", "@amplify-studio/open-mcp@latest"]
|
|
223
|
-
}'
|
|
224
|
-
```
|
|
258
|
+
## Feature Showcase
|
|
225
259
|
|
|
226
|
-
###
|
|
260
|
+
### Image Understanding Example
|
|
227
261
|
|
|
228
|
-
|
|
229
|
-
# View your configuration
|
|
230
|
-
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json
|
|
231
|
-
```
|
|
262
|
+
Our image understanding feature is powered by Zhipu AI GLM-4.6V-Flash, capable of accurately analyzing images, videos, and documents.
|
|
232
263
|
|
|
233
|
-
|
|
264
|
+
**Original Image:**
|
|
234
265
|
|
|
235
|
-
|
|
266
|
+

|
|
236
267
|
|
|
237
|
-
|
|
268
|
+
**AI Understanding Result:**
|
|
238
269
|
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
"query": "search term",
|
|
242
|
-
"results": [
|
|
243
|
-
{
|
|
244
|
-
"title": "Result Title",
|
|
245
|
-
"content": "Description or snippet",
|
|
246
|
-
"url": "https://example.com"
|
|
247
|
-
}
|
|
248
|
-
],
|
|
249
|
-
"totalCount": 1,
|
|
250
|
-
"duration": "234ms"
|
|
251
|
-
}
|
|
252
|
-
```
|
|
270
|
+

|
|
253
271
|
|
|
254
|
-
|
|
272
|
+
For more details about image features, see [Image AI Tools Documentation](./docs/features/image-ai-tools.md)
|
|
255
273
|
|
|
256
|
-
|
|
257
|
-
{
|
|
258
|
-
"url": "https://example.com",
|
|
259
|
-
"content": "Page content in markdown/text format...",
|
|
260
|
-
"charCount": 1500,
|
|
261
|
-
"duration": "456ms",
|
|
262
|
-
"cached": false
|
|
263
|
-
}
|
|
264
|
-
```
|
|
274
|
+
---
|
|
265
275
|
|
|
266
276
|
## Configuration
|
|
267
277
|
|
|
268
|
-
|
|
269
|
-
|----------|----------|---------|-------------|
|
|
270
|
-
| `GATEWAY_URL` | No | `http://115.190.91.253:80` | Gateway API base URL |
|
|
271
|
-
| `AUTH_USERNAME` | No | - | Basic auth username |
|
|
272
|
-
| `AUTH_PASSWORD` | No | - | Basic auth password |
|
|
273
|
-
| `HTTP_PROXY` | No | - | Proxy URL for HTTP requests |
|
|
274
|
-
| `HTTPS_PROXY` | No | - | Proxy URL for HTTPS requests |
|
|
275
|
-
| `NO_PROXY` | No | - | Comma-separated bypass list |
|
|
276
|
-
| `MCP_HTTP_PORT` | No | - | Enable HTTP transport on specified port |
|
|
278
|
+
### Required Environment Variables
|
|
277
279
|
|
|
278
|
-
|
|
280
|
+
| Variable | Description |
|
|
281
|
+
|----------|-------------|
|
|
282
|
+
| `GATEWAY_URL` | **Required.** Your Gateway API URL (e.g., `http://your-gateway.com:80`) |
|
|
279
283
|
|
|
280
|
-
|
|
284
|
+
### Optional Environment Variables
|
|
281
285
|
|
|
282
|
-
|
|
|
283
|
-
|
|
284
|
-
|
|
|
285
|
-
| Read | GET | `/api/read/{url}` | Extract web content |
|
|
286
|
-
| Health | GET | `/health` | Health check |
|
|
287
|
-
| Status | GET | `/api/status` | Service status |
|
|
286
|
+
| Variable | Description |
|
|
287
|
+
|----------|-------------|
|
|
288
|
+
| `ZHIPUAI_API_KEY` | Optional. Required only for image understanding/generation features |
|
|
288
289
|
|
|
289
|
-
|
|
290
|
+
**Need advanced configuration?** See [Advanced Setup Guide](docs/advanced-setup.md) for proxy, authentication, and HTTP transport options.
|
|
290
291
|
|
|
291
|
-
|
|
292
|
+
### Getting Zhipu AI API Key
|
|
292
293
|
|
|
293
|
-
|
|
294
|
+
To use image understanding and generation features, you need a free API key from Zhipu AI:
|
|
294
295
|
|
|
295
|
-
|
|
296
|
+
1. **Register with Invite Link**: [https://www.bigmodel.cn/invite?icode=yn2yXKXS+Ba1UqrD19VwPwZ3c5owLmCCcMQXWcJRS8E=](https://www.bigmodel.cn/invite?icode=yn2yXKXS+Ba1UqrD19VwPwZ3c5owLmCCcMQXWcJRS8E=)
|
|
297
|
+
- Use the invite link for better benefits
|
|
296
298
|
|
|
297
|
-
|
|
299
|
+
2. **Get API Key**:
|
|
300
|
+
- After registration, visit [API Keys page](https://www.bigmodel.cn/usercenter/proj-mgmt/apikeys)
|
|
301
|
+
- Click "生成新的 API Key" (Generate new API key)
|
|
302
|
+
- Copy the generated key (format: `id.secret`)
|
|
298
303
|
|
|
299
|
-
|
|
304
|
+
3. **Free Tier Benefits**:
|
|
305
|
+
- GLM-4.6V-Flash: Free for vision understanding
|
|
306
|
+
- Cogview-3-Flash: Free for image generation
|
|
307
|
+
- No credit card required for basic usage
|
|
300
308
|
|
|
301
|
-
|
|
309
|
+
4. **Set Environment Variable**:
|
|
310
|
+
```bash
|
|
311
|
+
export ZHIPUAI_API_KEY="your-api-key-here"
|
|
312
|
+
```
|
|
302
313
|
|
|
303
|
-
|
|
304
|
-
# Basic
|
|
305
|
-
MCP_HTTP_PORT=3333 npm start
|
|
314
|
+
**Note**: The API key is optional. Only required if you want to use image understanding or generation features.
|
|
306
315
|
|
|
307
|
-
|
|
308
|
-
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
### Option 1: NPX (Recommended)
|
|
309
319
|
|
|
310
|
-
|
|
311
|
-
|
|
320
|
+
```bash
|
|
321
|
+
npx -y @amplify-studio/open-mcp@latest
|
|
312
322
|
```
|
|
313
323
|
|
|
314
|
-
|
|
324
|
+
### Option 2: Global Install
|
|
315
325
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
| `/mcp` | GET | Receive SSE notifications |
|
|
321
|
-
| `/mcp` | DELETE | Close session |
|
|
326
|
+
```bash
|
|
327
|
+
npm install -g @amplify-studio/open-mcp
|
|
328
|
+
open-mcp
|
|
329
|
+
```
|
|
322
330
|
|
|
323
|
-
|
|
331
|
+
### Option 3: Docker
|
|
324
332
|
|
|
325
333
|
```bash
|
|
326
|
-
|
|
327
|
-
|
|
334
|
+
docker pull amplifystudio/open-mcp:latest
|
|
335
|
+
```
|
|
328
336
|
|
|
329
|
-
|
|
330
|
-
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"mcpServers": {
|
|
340
|
+
"open-mcp": {
|
|
341
|
+
"command": "docker",
|
|
342
|
+
"args": [
|
|
343
|
+
"run", "-i", "--rm",
|
|
344
|
+
"-e", "GATEWAY_URL",
|
|
345
|
+
"-e", "ZHIPUAI_API_KEY",
|
|
346
|
+
"amplifystudio/open-mcp:latest"
|
|
347
|
+
],
|
|
348
|
+
"env": {
|
|
349
|
+
"GATEWAY_URL": "http://your-gateway.com:80",
|
|
350
|
+
"ZHIPUAI_API_KEY": "your-zhipu-api-key"
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
331
355
|
```
|
|
332
356
|
|
|
333
|
-
|
|
357
|
+
**Note**: For full Docker Compose deployment with all services, see [docker-compose.yml](https://github.com/amplify-studio/open-mcp/blob/main/docker-compose.yml).
|
|
358
|
+
|
|
359
|
+
### Option 4: Local Development
|
|
334
360
|
|
|
335
361
|
```bash
|
|
336
|
-
#
|
|
337
|
-
|
|
362
|
+
# Clone the repository
|
|
363
|
+
git clone https://github.com/amplify-studio/open-mcp.git
|
|
364
|
+
cd open-mcp
|
|
338
365
|
|
|
339
|
-
#
|
|
340
|
-
|
|
341
|
-
```
|
|
366
|
+
# Install dependencies
|
|
367
|
+
npm install
|
|
342
368
|
|
|
343
|
-
|
|
369
|
+
# Build the project
|
|
370
|
+
npm run build
|
|
344
371
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
curl -X POST http://localhost:3333/mcp \
|
|
348
|
-
-H "Content-Type: application/json" \
|
|
349
|
-
-H "Accept: application/json, text/event-stream" \
|
|
350
|
-
-d '{
|
|
351
|
-
"jsonrpc": "2.0",
|
|
352
|
-
"id": 1,
|
|
353
|
-
"method": "initialize",
|
|
354
|
-
"params": {
|
|
355
|
-
"protocolVersion": "2025-06-18",
|
|
356
|
-
"capabilities": {},
|
|
357
|
-
"clientInfo": {"name": "test-client", "version": "1.0"}
|
|
358
|
-
}
|
|
359
|
-
}'
|
|
360
|
-
|
|
361
|
-
# 2. List tools (use returned session-id)
|
|
362
|
-
curl -X POST http://localhost:3333/mcp \
|
|
363
|
-
-H "Content-Type: application/json" \
|
|
364
|
-
-H "mcp-session-id: <session-id>" \
|
|
365
|
-
-d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'
|
|
366
|
-
|
|
367
|
-
# 3. Call search tool
|
|
368
|
-
curl -X POST http://localhost:3333/mcp \
|
|
369
|
-
-H "Content-Type: application/json" \
|
|
370
|
-
-H "mcp-session-id: <session-id>" \
|
|
371
|
-
-d '{
|
|
372
|
-
"jsonrpc": "2.0",
|
|
373
|
-
"id": 3,
|
|
374
|
-
"method": "tools/call",
|
|
375
|
-
"params": {
|
|
376
|
-
"name": "searxng_web_search",
|
|
377
|
-
"arguments": {"query": "test"}
|
|
378
|
-
}
|
|
379
|
-
}'
|
|
372
|
+
# Run directly
|
|
373
|
+
node dist/index.js
|
|
380
374
|
```
|
|
381
375
|
|
|
382
|
-
|
|
376
|
+
## HTTP Transport Mode
|
|
383
377
|
|
|
384
|
-
|
|
378
|
+
The server supports HTTP transport for remote deployment. See [Advanced Setup Guide](docs/advanced-setup.md#http-transport-mode) for detailed instructions.
|
|
385
379
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
380
|
+
**Quick Start**:
|
|
381
|
+
```bash
|
|
382
|
+
MCP_HTTP_PORT=3333 GATEWAY_URL=http://your-gateway.com:80 npx @amplify-studio/open-mcp@latest
|
|
383
|
+
```
|
|
390
384
|
|
|
385
|
+
Then connect from Claude Code:
|
|
391
386
|
```bash
|
|
392
|
-
|
|
393
|
-
MCP_HTTP_PORT=3333
|
|
394
|
-
ALLOWED_ORIGINS=https://yourdomain.com
|
|
387
|
+
claude mcp add --transport http open-mcp http://localhost:3333/mcp
|
|
395
388
|
```
|
|
396
389
|
|
|
397
390
|
## Development
|
|
398
391
|
|
|
392
|
+
### Setup
|
|
393
|
+
|
|
399
394
|
```bash
|
|
400
395
|
# Install dependencies
|
|
401
396
|
npm install
|
|
@@ -406,6 +401,9 @@ npm run watch
|
|
|
406
401
|
# Run tests
|
|
407
402
|
npm test
|
|
408
403
|
|
|
404
|
+
# Generate coverage report
|
|
405
|
+
npm run test:coverage
|
|
406
|
+
|
|
409
407
|
# Test with MCP Inspector
|
|
410
408
|
npm run inspector
|
|
411
409
|
|
|
@@ -413,77 +411,106 @@ npm run inspector
|
|
|
413
411
|
npm run build
|
|
414
412
|
```
|
|
415
413
|
|
|
416
|
-
|
|
414
|
+
### Testing
|
|
417
415
|
|
|
418
|
-
|
|
416
|
+
```bash
|
|
417
|
+
# Run all tests
|
|
418
|
+
npm test
|
|
419
419
|
|
|
420
|
-
|
|
420
|
+
# Run coverage report
|
|
421
|
+
npm run test:coverage
|
|
421
422
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
docker build -t open-mcp:latest .
|
|
425
|
-
|
|
426
|
-
# Run HTTP server on port 3333
|
|
427
|
-
docker run -d -p 3333:3333 \
|
|
428
|
-
-e MCP_HTTP_PORT=3333 \
|
|
429
|
-
-e GATEWAY_URL=http://115.190.91.253:80 \
|
|
430
|
-
--name open-mcp \
|
|
431
|
-
open-mcp:latest
|
|
432
|
-
|
|
433
|
-
# Verify deployment
|
|
434
|
-
curl http://localhost:3333/health
|
|
423
|
+
# Test specific file
|
|
424
|
+
npx tsx __tests__/unit/search.test.ts
|
|
435
425
|
```
|
|
436
426
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
| Environment Variable | Description | Default |
|
|
440
|
-
|---------------------|-------------|---------|
|
|
441
|
-
| `MCP_HTTP_PORT` | HTTP server port | 3333 |
|
|
442
|
-
| `GATEWAY_URL` | Gateway API base URL | `http://115.190.91.253:80` |
|
|
443
|
-
| `ALLOWED_ORIGINS` | CORS allowed origins | `*` |
|
|
427
|
+
## Updating
|
|
444
428
|
|
|
445
|
-
### Claude
|
|
429
|
+
### Using Claude CLI
|
|
446
430
|
|
|
447
431
|
```bash
|
|
448
|
-
#
|
|
449
|
-
claude mcp
|
|
432
|
+
# Remove old version
|
|
433
|
+
claude mcp remove open-mcp
|
|
434
|
+
|
|
435
|
+
# Install latest version
|
|
436
|
+
claude mcp add-json -s user open-mcp '{
|
|
437
|
+
"command": "npx",
|
|
438
|
+
"args": ["-y", "@amplify-studio/open-mcp@latest"],
|
|
439
|
+
"env": {
|
|
440
|
+
"GATEWAY_URL": "https://your-gateway-instance.com",
|
|
441
|
+
"ZHIPUAI_API_KEY": "your-zhipu-api-key"
|
|
442
|
+
}
|
|
443
|
+
}'
|
|
450
444
|
```
|
|
451
445
|
|
|
452
|
-
###
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
restart: unless-stopped
|
|
446
|
+
### Clear npx Cache
|
|
447
|
+
|
|
448
|
+
If you encounter issues after updating:
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
npm cache clean --force
|
|
452
|
+
claude mcp remove open-mcp
|
|
453
|
+
claude mcp add-json -s user open-mcp '{
|
|
454
|
+
"command": "npx",
|
|
455
|
+
"args": ["-y", "@amplify-studio/open-mcp@latest"],
|
|
456
|
+
"env": {
|
|
457
|
+
"GATEWAY_URL": "https://your-gateway-instance.com",
|
|
458
|
+
"ZHIPUAI_API_KEY": "your-zhipu-api-key"
|
|
459
|
+
}
|
|
460
|
+
}'
|
|
468
461
|
```
|
|
469
462
|
|
|
470
463
|
## Contributing
|
|
471
464
|
|
|
472
|
-
We
|
|
465
|
+
We welcome contributions! Please follow these guidelines:
|
|
473
466
|
|
|
474
467
|
- Fork the repository
|
|
475
468
|
- Create a feature branch
|
|
476
469
|
- Make your changes
|
|
477
470
|
- Submit a pull request
|
|
478
471
|
|
|
472
|
+
### Coding Standards
|
|
473
|
+
|
|
474
|
+
- Use TypeScript with strict type safety
|
|
475
|
+
- Follow existing error handling patterns
|
|
476
|
+
- Write concise, informative error messages
|
|
477
|
+
- Include unit tests for new functionality
|
|
478
|
+
- Maintain 90%+ test coverage
|
|
479
|
+
|
|
479
480
|
## License
|
|
480
481
|
|
|
481
|
-
MIT
|
|
482
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
483
|
+
|
|
484
|
+
## Credits & Acknowledgments
|
|
485
|
+
|
|
486
|
+
This project is a fork of [mcp-searxng](https://github.com/ihor-sokoliuk/mcp-searxng) by [Ihor Sokoliuk](https://github.com/ihor-sokoliuk), adapted and enhanced with additional features and improvements.
|
|
487
|
+
|
|
488
|
+
### Key Dependencies
|
|
482
489
|
|
|
483
|
-
|
|
490
|
+
This project is built upon these excellent open-source projects:
|
|
484
491
|
|
|
485
|
-
|
|
492
|
+
| Project | Purpose | License |
|
|
493
|
+
|---------|---------|---------|
|
|
494
|
+
| [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) | Official MCP TypeScript SDK | MIT |
|
|
495
|
+
| [node-html-markdown](https://github.com/crosstype/node-html-markdown) | HTML to Markdown conversion | MIT |
|
|
496
|
+
| [undici](https://github.com/nodejs/undici) | HTTP client with proxy support | MIT |
|
|
497
|
+
| [express](https://github.com/expressjs/express) | HTTP server framework | MIT |
|
|
498
|
+
| [cors](https://github.com/expressjs/cors) | CORS middleware | MIT |
|
|
499
|
+
|
|
500
|
+
### Related Projects
|
|
501
|
+
|
|
502
|
+
Special thanks to these amazing projects:
|
|
503
|
+
|
|
504
|
+
- [mcp-searxng](https://github.com/ihor-sokoliuk/mcp-searxng) - Original project that we forked from, created by [Ihor Sokoliuk](https://github.com/ihor-sokoliuk)
|
|
505
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/) - Official MCP documentation
|
|
506
|
+
- [SearXNG](https://searxng.org/) - Privacy-respecting metasearch engine
|
|
507
|
+
- [Firecrawl](https://www.firecrawl.dev/) - Web scraping and crawling API
|
|
486
508
|
|
|
487
509
|
---
|
|
488
510
|
|
|
511
|
+
## Star History
|
|
512
|
+
|
|
513
|
+
[](https://star-history.com/#amplify-studio/open-mcp&Date)
|
|
514
|
+
|
|
515
|
+
|
|
489
516
|
**Made with ❤️ by [Amplify Studio](https://github.com/amplify-studio)**
|