omnisearch-mcp 0.0.0-stage → 1.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -2
  3. package/dist/index.js +193 -0
  4. package/package.json +25 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OmniSearch SDK Contributors
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,3 +1,94 @@
1
- # Temporary Holding Version
1
+ # omnisearch-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Model Context Protocol (MCP) server for multi-provider web search retrieval, powered by [`omnisearch-sdk`](https://www.npmjs.com/package/omnisearch-sdk).
4
+
5
+ Give Claude Desktop, Cursor, and MCP-compatible AI agent runtimes real-time search across 15+ search providers (Brave, Google, Bing, DuckDuckGo, Tavily, Perplexity, PubMed, Arxiv, GitHub, and more) with automatic fallback and canonical deduplication.
6
+
7
+ ---
8
+
9
+ ## ⚡ Quick Setup
10
+
11
+ ### 1. Claude Desktop Setup
12
+
13
+ Add to your `claude_desktop_config.json`:
14
+
15
+ * **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
16
+ * **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
17
+
18
+ ```json
19
+ {
20
+ "mcpServers": {
21
+ "omnisearch": {
22
+ "command": "npx",
23
+ "args": ["-y", "omnisearch-mcp"],
24
+ "env": {
25
+ "BRAVE_API_KEY": "YOUR_BRAVE_API_KEY",
26
+ "TAVILY_API_KEY": "YOUR_TAVILY_API_KEY"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ > **Note:** If no API keys are provided in `env`, the server automatically defaults to zero-config public providers (DuckDuckGo, PubMed, Arxiv, Semantic Scholar).
34
+
35
+ ---
36
+
37
+ ### 2. Cursor IDE Setup
38
+
39
+ In Cursor Settings -> **Features** -> **MCP Servers** -> **Add New MCP Server**:
40
+
41
+ * **Name:** `omnisearch`
42
+ * **Type:** `command`
43
+ * **Command:** `npx -y omnisearch-mcp`
44
+
45
+ ---
46
+
47
+ ## 🛠 Available MCP Tools
48
+
49
+ The server automatically registers two tools:
50
+
51
+ ### `web_search`
52
+ Search the live web across multiple engines with automatic multi-provider fallback, canonical deduplication, and domain filtering.
53
+
54
+ | Argument | Type | Description |
55
+ | :--- | :--- | :--- |
56
+ | `query` | `string` | The search query string (**required**). |
57
+ | `maxResults` | `number` | Maximum number of results to return (default: `10`). |
58
+ | `freshness` | `string` | Recency filter: `'day'`, `'week'`, `'month'`, `'year'`. |
59
+ | `includeDomains` | `string[]` | Whitelist specific domains (e.g. `["github.com", "arxiv.org"]`). |
60
+ | `excludeDomains` | `string[]` | Blacklist specific domains (e.g. `["pinterest.com"]`). |
61
+ | `deduplicate` | `boolean` | Enable intelligent canonical URL deduplication (default: `true`). |
62
+
63
+ ### `news_search`
64
+ Search breaking news and recent journalistic coverage across supported news providers.
65
+
66
+ | Argument | Type | Description |
67
+ | :--- | :--- | :--- |
68
+ | `query` | `string` | The news query string (**required**). |
69
+ | `maxResults` | `number` | Maximum number of results to return (default: `10`). |
70
+ | `freshness` | `string` | Recency filter: `'day'`, `'week'`, `'month'` (default: `'week'`). |
71
+
72
+ ---
73
+
74
+ ## 🌐 Supported Provider Environment Variables
75
+
76
+ Configure any combination of API keys:
77
+
78
+ * `BRAVE_API_KEY` - Brave Search API
79
+ * `TAVILY_API_KEY` - Tavily Search API
80
+ * `GOOGLE_API_KEY` & `GOOGLE_CX` - Google Custom Search API
81
+ * `BING_API_KEY` - Azure Bing Search API
82
+ * `YOU_API_KEY` - You.com Search API
83
+ * `EXA_API_KEY` - Exa Neural Search API
84
+ * `PERPLEXITY_API_KEY` - Perplexity Search API
85
+ * `PARALLEL_API_KEY` - Parallel Search API
86
+ * `SERPAPI_API_KEY` - SerpAPI
87
+ * `SEARXNG_BASE_URL` - Self-hosted SearXNG endpoint
88
+ * `GITHUB_TOKEN` - GitHub API Token (optional, raises rate limits)
89
+
90
+ ---
91
+
92
+ ## 📄 License
93
+
94
+ MIT © [OmniSearch SDK Contributors](https://github.com/gbks121/omnisearch-sdk)
package/dist/index.js ADDED
@@ -0,0 +1,193 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
+ import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
7
+ import {
8
+ createArxivProvider,
9
+ createBingProvider,
10
+ createBraveProvider,
11
+ createDuckDuckGoProvider,
12
+ createExaProvider,
13
+ createGitHubProvider,
14
+ createGoogleProvider,
15
+ createParallelProvider,
16
+ createPerplexityProvider,
17
+ createPubMedProvider,
18
+ createSearXNGProvider,
19
+ createSemanticScholarProvider,
20
+ createSerpApiProvider,
21
+ createTavilyProvider,
22
+ createYouProvider,
23
+ webSearch
24
+ } from "omnisearch-sdk";
25
+ function getActiveProviders() {
26
+ const env = process.env;
27
+ const providers = [];
28
+ if (env.BRAVE_API_KEY || env.BRAVE_SEARCH_API_KEY) {
29
+ providers.push(
30
+ createBraveProvider({ apiKey: env.BRAVE_API_KEY || env.BRAVE_SEARCH_API_KEY })
31
+ );
32
+ }
33
+ if (env.TAVILY_API_KEY) {
34
+ providers.push(createTavilyProvider({ apiKey: env.TAVILY_API_KEY }));
35
+ }
36
+ if (env.EXA_API_KEY) {
37
+ providers.push(createExaProvider({ apiKey: env.EXA_API_KEY }));
38
+ }
39
+ if (env.GOOGLE_API_KEY && env.GOOGLE_CX) {
40
+ providers.push(createGoogleProvider({ apiKey: env.GOOGLE_API_KEY, cx: env.GOOGLE_CX }));
41
+ }
42
+ if (env.PERPLEXITY_API_KEY) {
43
+ providers.push(createPerplexityProvider({ apiKey: env.PERPLEXITY_API_KEY }));
44
+ }
45
+ if (env.BING_API_KEY) {
46
+ providers.push(createBingProvider({ apiKey: env.BING_API_KEY }));
47
+ }
48
+ if (env.YOU_API_KEY) {
49
+ providers.push(createYouProvider({ apiKey: env.YOU_API_KEY }));
50
+ }
51
+ if (env.PARALLEL_API_KEY) {
52
+ providers.push(createParallelProvider({ apiKey: env.PARALLEL_API_KEY }));
53
+ }
54
+ if (env.SERPAPI_API_KEY) {
55
+ providers.push(createSerpApiProvider({ apiKey: env.SERPAPI_API_KEY }));
56
+ }
57
+ if (env.SEARXNG_BASE_URL) {
58
+ providers.push(createSearXNGProvider({ baseUrl: env.SEARXNG_BASE_URL }));
59
+ }
60
+ providers.push(createDuckDuckGoProvider());
61
+ providers.push(createPubMedProvider());
62
+ providers.push(createArxivProvider());
63
+ providers.push(createSemanticScholarProvider());
64
+ providers.push(createGitHubProvider({ apiKey: env.GITHUB_TOKEN || env.GITHUB_API_KEY }));
65
+ return providers;
66
+ }
67
+ async function runServer() {
68
+ const server = new Server(
69
+ {
70
+ name: "omnisearch-mcp",
71
+ version: "1.0.0"
72
+ },
73
+ {
74
+ capabilities: {
75
+ tools: {}
76
+ }
77
+ }
78
+ );
79
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
80
+ return {
81
+ tools: [
82
+ {
83
+ name: "web_search",
84
+ description: "Search the live web across multiple search engines with automatic fallback, deduplication, and domain filtering.",
85
+ inputSchema: {
86
+ type: "object",
87
+ properties: {
88
+ query: { type: "string", description: "The search query to execute." },
89
+ maxResults: {
90
+ type: "number",
91
+ description: "Maximum results to return (default 10)."
92
+ },
93
+ freshness: {
94
+ type: "string",
95
+ enum: ["day", "week", "month", "year"],
96
+ description: "Filter content published within the last day, week, month, or year."
97
+ },
98
+ strategy: {
99
+ type: "string",
100
+ enum: ["parallel", "fallback", "race"],
101
+ description: "Multi-provider execution strategy."
102
+ },
103
+ includeDomains: {
104
+ type: "array",
105
+ items: { type: "string" },
106
+ description: "List of domain names to restrict results to."
107
+ },
108
+ excludeDomains: {
109
+ type: "array",
110
+ items: { type: "string" },
111
+ description: "List of domain names to exclude from results."
112
+ }
113
+ },
114
+ required: ["query"]
115
+ }
116
+ },
117
+ {
118
+ name: "news_search",
119
+ description: "Search breaking and recent news articles across search engines.",
120
+ inputSchema: {
121
+ type: "object",
122
+ properties: {
123
+ query: { type: "string", description: "The news search query." },
124
+ maxResults: { type: "number", description: "Maximum news results to return." },
125
+ freshness: {
126
+ type: "string",
127
+ enum: ["day", "week", "month", "year"],
128
+ description: "Recency filter for news."
129
+ }
130
+ },
131
+ required: ["query"]
132
+ }
133
+ }
134
+ ]
135
+ };
136
+ });
137
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
138
+ const { name, arguments: args } = request.params;
139
+ const providers = getActiveProviders();
140
+ if (name === "web_search" || name === "news_search") {
141
+ const query = args?.query || "";
142
+ const maxResults = args?.maxResults || 10;
143
+ const freshness = args?.freshness;
144
+ const strategy = args?.strategy || "parallel";
145
+ const searchType = name === "news_search" ? "news" : "web";
146
+ const includeDomains = args?.includeDomains;
147
+ const excludeDomains = args?.excludeDomains;
148
+ try {
149
+ const results = await webSearch({
150
+ query,
151
+ provider: providers,
152
+ maxResults,
153
+ freshness,
154
+ strategy,
155
+ searchType,
156
+ includeDomains,
157
+ excludeDomains,
158
+ deduplicate: true
159
+ });
160
+ const formatted = results.map((r, i) => `${i + 1}. [${r.title}](${r.url})
161
+ ${r.snippet ?? ""}`).join("\n\n");
162
+ return {
163
+ content: [
164
+ {
165
+ type: "text",
166
+ text: formatted || `No results found for "${query}".`
167
+ }
168
+ ]
169
+ };
170
+ } catch (err) {
171
+ return {
172
+ content: [
173
+ {
174
+ type: "text",
175
+ text: `Search error: ${err instanceof Error ? err.message : String(err)}`
176
+ }
177
+ ],
178
+ isError: true
179
+ };
180
+ }
181
+ }
182
+ throw new Error(`Unknown tool: ${name}`);
183
+ });
184
+ const transport = new StdioServerTransport();
185
+ await server.connect(transport);
186
+ }
187
+ runServer().catch((error) => {
188
+ console.error("Fatal MCP Server error:", error);
189
+ process.exit(1);
190
+ });
191
+ export {
192
+ runServer
193
+ };
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "omnisearch-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.1",
4
+ "description": "Model Context Protocol server for OmniSearch SDK",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "bin": {
8
+ "omnisearch-mcp": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "engines": {
14
+ "node": ">=24.0.0"
15
+ },
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.6.1",
18
+ "omnisearch-sdk": "5.0.1"
19
+ },
20
+ "devDependencies": {
21
+ "tsup": "^8.5.1",
22
+ "typescript": "~6.0.3"
23
+ },
24
+ "scripts": {
25
+ "build": "tsup",
26
+ "dev": "tsup --watch"
27
+ }
6
28
  }