@youdotcom-oss/mcp 1.2.4 → 1.2.5

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/docs/API.md ADDED
@@ -0,0 +1,319 @@
1
+ # You.com MCP Server API Reference
2
+
3
+ Complete technical documentation for all MCP tools provided by the You.com MCP Server.
4
+
5
+ For setup and usage guides, see [README.md](../README.md).
6
+ For development patterns and architecture, see [AGENTS.md](../AGENTS.md).
7
+
8
+ ## Tools Overview
9
+
10
+ | Tool | Purpose | Authentication |
11
+ |------|---------|----------------|
12
+ | `you-search` | Web and news search with advanced filtering | X-API-Key |
13
+ | `you-express` | AI-powered answers with optional web search | Bearer token |
14
+ | `you-contents` | Content extraction from web pages | X-API-Key |
15
+
16
+ ---
17
+
18
+ ## `you-search`
19
+
20
+ Performs a comprehensive web and news search using the You.com Search API.
21
+
22
+ ### Parameters
23
+
24
+ - `query` (string, required): The base search query to send to the You.com API. This will be combined with additional filters like site, fileType, and language to create the final search query. You can also use operators directly: + (exact term, e.g., "Enron +GAAP"), - (exclude term, e.g., "guitar -prs"), site: (domain, e.g., "site:uscourts.gov"), filetype: (e.g., "filetype:pdf"), lang: (e.g., "lang:es"). Use parentheses for multi-word phrases (e.g., "+(machine learning)", "-(social media)").
25
+ - `site` (string, optional): Search within a specific website domain (e.g., 'github.com')
26
+ - `fileType` (string, optional): Filter by a specific file type (e.g., 'pdf', 'doc', 'txt')
27
+ - `language` (string, optional): Filter by a specific language using ISO 639-1 code (e.g., 'en', 'es', 'fr')
28
+ - `exactTerms` (string, optional): Exact terms with logical operators: 'python AND|tutorial|NOT beginner' (pipe-separated, add AND/OR after terms, default OR). Use parentheses for multi-word phrases (e.g., '(machine learning)|typescript')
29
+ - `excludeTerms` (string, optional): Terms to exclude with logical operators: 'spam AND|ads|NOT relevant' (pipe-separated, add AND/OR after terms, default OR). Use parentheses for multi-word phrases (e.g., '(social media)|ads'). Cannot be used with exactTerms.
30
+ - `count` (integer, optional): Maximum number of results to return per section. Range: 1-20.
31
+ - `freshness` (string, optional): Freshness of results. Options: `day`, `week`, `month`, `year`.
32
+ - `offset` (integer, optional): Offset for pagination (calculated in multiples of count). Range: 0-9.
33
+ - `country` (string, optional): Country code for localized results. Examples: `US`, `GB`, `DE`, `FR`, `JP`, `CA`, `AU`, etc.
34
+ - `safesearch` (string, optional): Content filtering level. Options: `off`, `moderate` (default), `strict`.
35
+
36
+ ### Response Format
37
+
38
+ ```json
39
+ {
40
+ "content": [
41
+ {
42
+ "type": "text",
43
+ "text": "Search Results for \"machine learning\":\n\nWEB RESULTS:\n\nTitle: Introduction to Machine Learning\nURL: https://github.com/ml-tutorials/intro\nDescription: A comprehensive guide to machine learning fundamentals\nSnippets:\n- Learn the basics of supervised and unsupervised learning\n- Practical examples with Python and TensorFlow\n\n---\n\nTitle: Machine Learning Course\nURL: https://coursera.org/ml-course\nDescription: Stanford's machine learning course materials\nSnippets:\n- Mathematical foundations of ML algorithms\n- Hands-on programming assignments\n\n==================================================\n\nNEWS RESULTS:\n\nTitle: AI Breakthrough in Medical Diagnosis\nURL: https://techcrunch.com/ai-medical-breakthrough\nDescription: New machine learning model achieves 95% accuracy\nPublished: 2024-01-15T10:30:00"
44
+ }
45
+ ],
46
+ "structuredContent": {
47
+ "results": {
48
+ "web": [
49
+ {
50
+ "url": "https://github.com/ml-tutorials/intro",
51
+ "title": "Introduction to Machine Learning",
52
+ "description": "A comprehensive guide to machine learning fundamentals",
53
+ "snippets": [
54
+ "Learn the basics of supervised and unsupervised learning",
55
+ "Practical examples with Python and TensorFlow"
56
+ ],
57
+ "page_age": "2024-01-10T14:20:00",
58
+ "authors": ["ML Tutorial Team"]
59
+ }
60
+ ],
61
+ "news": [
62
+ {
63
+ "url": "https://techcrunch.com/ai-medical-breakthrough",
64
+ "title": "AI Breakthrough in Medical Diagnosis",
65
+ "description": "New machine learning model achieves 95% accuracy",
66
+ "page_age": "2024-01-15T10:30:00"
67
+ }
68
+ ]
69
+ },
70
+ "metadata": {
71
+ "query": "machine learning",
72
+ "request_uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
73
+ "latency": 0.247
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ ## `you-express`
82
+
83
+ Fast AI-powered agent for quick responses with optional real-time web search integration.
84
+
85
+ ### Parameters
86
+
87
+ - `input` (string, required): The query or instruction to send to the Express agent. Example: "What is the capital of France?"
88
+ - `tools` (array, optional): Array of tool objects to expand the agent's capabilities. Currently supports:
89
+ - `{ type: "web_search" }` - Enables real-time web search to provide more accurate and up-to-date information
90
+
91
+ ### Features
92
+
93
+ - Fast response times optimized for straightforward queries
94
+ - Optional web search integration for real-time information
95
+ - AI-synthesized answers with source citations (when web_search is enabled)
96
+ - Non-streaming JSON responses (`stream: false`) for reliability
97
+
98
+ ### Response Structure
99
+
100
+ The tool returns a token-efficient MCP response format:
101
+
102
+ - `answer` (string, required): AI-synthesized answer from the Express agent
103
+ - `results` (object, optional): Web search results included when `web_search` tool is used
104
+ - `web` (array): Array of search result objects, each containing:
105
+ - `url` (string): The URL of the search result
106
+ - `title` (string): The title of the search result
107
+ - `snippet` (string): A text snippet from the search result
108
+ - `agent` (string, optional): Agent identifier (e.g., "express")
109
+
110
+ ### Example 1: Simple query without web_search
111
+
112
+ **Input:**
113
+
114
+ ```json
115
+ {
116
+ "input": "What is 2 + 2?"
117
+ }
118
+ ```
119
+
120
+ **Response:**
121
+
122
+ ```json
123
+ {
124
+ "content": [
125
+ {
126
+ "type": "text",
127
+ "text": "Express Agent Answer:\n\n2 + 2 equals 4."
128
+ }
129
+ ],
130
+ "structuredContent": {
131
+ "answer": "2 + 2 equals 4.",
132
+ "agent": "express"
133
+ }
134
+ }
135
+ ```
136
+
137
+ ### Example 2: Query with web_search enabled
138
+
139
+ **Input:**
140
+
141
+ ```json
142
+ {
143
+ "input": "What is the capital of France?",
144
+ "tools": [{ "type": "web_search" }]
145
+ }
146
+ ```
147
+
148
+ **Response:**
149
+
150
+ ```json
151
+ {
152
+ "content": [
153
+ {
154
+ "type": "text",
155
+ "text": "Express Agent Answer:\n\nThe capital of France is Paris, the country's largest city and its political, economic, and cultural center..."
156
+ },
157
+ {
158
+ "type": "text",
159
+ "text": "\nSearch Results:\n\nTitle: Paris - Wikipedia\nURL: https://en.wikipedia.org/wiki/Paris\nSnippet: Paris is the capital and most populous city of France. With an official estimated population of 2,102,650 residents...\n\nTitle: Paris | History, Map, Population, & Facts | Britannica\nURL: https://www.britannica.com/place/Paris\nSnippet: Paris, city and capital of France, situated in the north-central part of the country..."
160
+ }
161
+ ],
162
+ "structuredContent": {
163
+ "answer": "The capital of France is Paris, the country's largest city and its political, economic, and cultural center...",
164
+ "results": {
165
+ "web": [
166
+ {
167
+ "url": "https://en.wikipedia.org/wiki/Paris",
168
+ "title": "Paris - Wikipedia",
169
+ "snippet": "Paris is the capital and most populous city of France. With an official estimated population of 2,102,650 residents..."
170
+ },
171
+ {
172
+ "url": "https://www.britannica.com/place/Paris",
173
+ "title": "Paris | History, Map, Population, & Facts | Britannica",
174
+ "snippet": "Paris, city and capital of France, situated in the north-central part of the country..."
175
+ }
176
+ ]
177
+ },
178
+ "agent": "express"
179
+ }
180
+ }
181
+ ```
182
+
183
+ ### Notes
184
+
185
+ - The `content` array always displays the answer first, followed by search results (if web_search was used)
186
+ - The response format is optimized for token efficiency, returning only essential fields
187
+ - Search results are formatted consistently with the `you-search` tool using shared formatting utilities
188
+
189
+ ---
190
+
191
+ ## `you-contents`
192
+
193
+ Extract and retrieve full content from web pages using the You.com Contents API. Returns content in markdown or HTML format for documentation, analysis, and content processing.
194
+
195
+ ### Parameters
196
+
197
+ - `urls` (array of strings, required): Array of URLs to extract content from. The API processes all URLs in a single request. Example: `["https://example.com", "https://wikipedia.org/wiki/AI"]`
198
+ - `format` (string, optional): Output format for the extracted content. Default: `"markdown"`
199
+ - `"markdown"` - Recommended for: text extraction, documentation, simpler consumption, and general content analysis
200
+ - `"html"` - Recommended for: layout preservation, interactive content, visual fidelity, training data with structural details, and complex formatting
201
+
202
+ ### Format Selection Guidance
203
+
204
+ **Use markdown when you need:**
205
+
206
+ - Clean, readable text without HTML tags
207
+ - Content for documentation or note-taking
208
+ - Simpler content parsing and processing
209
+ - Text-focused analysis
210
+
211
+ **Use HTML when you need:**
212
+
213
+ - Preserve original page layout and structure
214
+ - Interactive elements (forms, buttons, etc.)
215
+ - Visual fidelity and styling information
216
+ - Training data with semantic HTML structure
217
+ - Complex formatting like tables with styling
218
+
219
+ ### Response Structure
220
+
221
+ The tool returns both text and structured content formats:
222
+
223
+ - `content` (array): Text representation with metadata and full extracted content
224
+ - `structuredContent` (object): Machine-readable format with metadata
225
+ - `count` (number): Number of URLs processed
226
+ - `format` (string): Format used for extraction ("markdown" or "html")
227
+ - `items` (array): Array of extracted content objects, each containing:
228
+ - `url` (string): URL of the extracted content
229
+ - `title` (string): Page title
230
+ - `content` (string): Full extracted content in the specified format
231
+ - `contentLength` (number): Length of extracted content in characters
232
+
233
+ ### Example 1: Single URL with markdown format (default)
234
+
235
+ **Input:**
236
+
237
+ ```json
238
+ {
239
+ "urls": ["https://example.com"]
240
+ }
241
+ ```
242
+
243
+ **Response:**
244
+
245
+ ```json
246
+ {
247
+ "content": [
248
+ {
249
+ "type": "text",
250
+ "text": "Successfully extracted content from 1 URL(s):\n\n## Example Domain\nURL: https://example.com\nFormat: markdown\nContent Length: 156 characters\n\n---\n\n# Example Domain\n\nThis domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.\n\n[More information...](https://www.iana.org/domains/example)\n\n---\n"
251
+ }
252
+ ],
253
+ "structuredContent": {
254
+ "count": 1,
255
+ "format": "markdown",
256
+ "items": [
257
+ {
258
+ "url": "https://example.com",
259
+ "title": "Example Domain",
260
+ "content": "# Example Domain\n\nThis domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.\n\n[More information...](https://www.iana.org/domains/example)",
261
+ "contentLength": 156
262
+ }
263
+ ]
264
+ }
265
+ }
266
+ ```
267
+
268
+ ### Example 2: Multiple URLs with HTML format
269
+
270
+ **Input:**
271
+
272
+ ```json
273
+ {
274
+ "urls": [
275
+ "https://example.com",
276
+ "https://en.wikipedia.org/wiki/Artificial_intelligence"
277
+ ],
278
+ "format": "html"
279
+ }
280
+ ```
281
+
282
+ **Response:**
283
+
284
+ ```json
285
+ {
286
+ "content": [
287
+ {
288
+ "type": "text",
289
+ "text": "Successfully extracted content from 2 URL(s):\n\n## Example Domain\nURL: https://example.com\nFormat: html\nContent Length: 1234 characters\n\n---\n\n<html><body><h1>Example Domain</h1><p>This domain is for use in illustrative examples...</p></body></html>\n\n---\n\n## Artificial intelligence - Wikipedia\nURL: https://en.wikipedia.org/wiki/Artificial_intelligence\nFormat: html\nContent Length: 45678 characters\n\n---\n\n<html><body><h1>Artificial intelligence</h1><p>Artificial intelligence (AI), in its broadest sense...</p></body></html>\n\n---\n"
290
+ }
291
+ ],
292
+ "structuredContent": {
293
+ "count": 2,
294
+ "format": "html",
295
+ "items": [
296
+ {
297
+ "url": "https://example.com",
298
+ "title": "Example Domain",
299
+ "content": "<html><body><h1>Example Domain</h1><p>This domain is for use in illustrative examples...</p></body></html>",
300
+ "contentLength": 1234
301
+ },
302
+ {
303
+ "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
304
+ "title": "Artificial intelligence - Wikipedia",
305
+ "content": "<html><body><h1>Artificial intelligence</h1><p>Artificial intelligence (AI), in its broadest sense...</p></body></html>",
306
+ "contentLength": 45678
307
+ }
308
+ ]
309
+ }
310
+ }
311
+ ```
312
+
313
+ ### Notes
314
+
315
+ - The API processes all URLs in a single request, making it efficient for batch extraction
316
+ - Full content is returned in both the text representation and structured format
317
+ - You.com URLs may return empty results due to self-scraping prevention
318
+ - For testing, use publicly accessible URLs like example.com, Wikipedia, or documentation sites
319
+ - The tool returns complete content without truncation, suitable for documentation and analysis workflows
package/package.json CHANGED
@@ -1,28 +1,12 @@
1
1
  {
2
2
  "name": "@youdotcom-oss/mcp",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "You.com API Model Context Protocol Server",
5
- "type": "module",
6
- "bin": "bin/stdio.js",
7
- "scripts": {
8
- "build": "bun build ./src/stdio.ts --outfile ./bin/stdio.js --target=node",
9
- "dev": "bun src/stdio.ts",
10
- "inspect": "bash -c 'source .env 2>/dev/null || true; bunx @modelcontextprotocol/inspector -e YDC_API_KEY=$YDC_API_KEY bun dev'",
11
- "start": "bun run bin/http",
12
- "test": "bun test",
13
- "test:coverage": "bun test --coverage",
14
- "test:coverage:watch": "bun test --coverage --watch",
15
- "check": "biome check",
16
- "check:write": "biome check --write",
17
- "prepare": "git config core.hooksPath .hooks"
18
- },
19
- "keywords": [
20
- "mcp",
21
- "web search",
22
- "model context protocol"
23
- ],
24
- "author": "You.com (https://you.com)",
25
5
  "license": "MIT",
6
+ "engines": {
7
+ "node": ">=18",
8
+ "bun": ">= 1.2.21"
9
+ },
26
10
  "repository": {
27
11
  "type": "git",
28
12
  "url": "git+https://github.com/youdotcom-oss/youdotcom-mcp-server.git"
@@ -31,34 +15,70 @@
31
15
  "url": "https://github.com/youdotcom-oss/youdotcom-mcp-server/issues"
32
16
  },
33
17
  "homepage": "https://github.com/youdotcom-oss/youdotcom-mcp-server/tree/main#readme",
18
+ "author": "You.com (https://you.com)",
19
+ "keywords": [
20
+ "mcp",
21
+ "web search",
22
+ "model context protocol"
23
+ ],
24
+ "bin": "bin/stdio.js",
25
+ "type": "module",
34
26
  "files": [
35
- "bin/stdio.js"
27
+ "bin/stdio.js",
28
+ "AGENTS.md",
29
+ "CONTRIBUTING.md",
30
+ "docs/API.md"
36
31
  ],
37
32
  "publishConfig": {
38
33
  "access": "public"
39
34
  },
40
- "engines": {
41
- "node": ">=18",
42
- "bun": ">= 1.2.21"
35
+ "scripts": {
36
+ "build": "bun build ./src/stdio.ts --outfile ./bin/stdio.js --target=node",
37
+ "check": "bun run check:biome && bun run check:types && bun run check:package",
38
+ "check:biome": "biome check",
39
+ "check:package": "format-package --check",
40
+ "check:types": "tsc --noEmit",
41
+ "check:write": "bun run format && bun run lint:fix && bun run format:package",
42
+ "dev": "bun src/stdio.ts",
43
+ "format": "biome format --write",
44
+ "format:check": "biome format",
45
+ "format:package": "format-package --write",
46
+ "inspect": "bash -c 'source .env 2>/dev/null || true; bunx @modelcontextprotocol/inspector -e YDC_API_KEY=$YDC_API_KEY bun dev'",
47
+ "lint": "biome lint",
48
+ "lint:fix": "biome lint --write",
49
+ "prepare": "git config core.hooksPath .hooks",
50
+ "start": "bun run bin/http",
51
+ "test": "bun test",
52
+ "test:coverage": "bun test --coverage",
53
+ "test:coverage:watch": "bun test --coverage --watch",
54
+ "test:watch": "bun test --watch"
55
+ },
56
+ "lint-staged": {
57
+ "*.{ts,tsx}": [
58
+ "biome check --write --no-errors-on-unmatched"
59
+ ],
60
+ "*.{json,md}": [
61
+ "biome format --write --no-errors-on-unmatched"
62
+ ],
63
+ "package.json": [
64
+ "format-package --write"
65
+ ]
43
66
  },
44
67
  "devDependencies": {
45
- "@biomejs/biome": "2.3.2",
68
+ "@biomejs/biome": "2.3.6",
46
69
  "@commitlint/cli": "^20.1.0",
47
70
  "@commitlint/config-conventional": "^20.0.0",
48
- "@eslint/js": "9.38.0",
71
+ "@eslint/js": "9.39.1",
49
72
  "@modelcontextprotocol/inspector": "0.17.2",
50
73
  "@types/bun": "latest",
51
74
  "typescript": "5.9.3",
52
- "lint-staged": "^16.2.6",
75
+ "lint-staged": "^16.2.7",
76
+ "format-package": "^7.0.0",
77
+ "@hono/bun-compress": "0.1.0",
53
78
  "@hono/mcp": "0.1.5",
54
- "@modelcontextprotocol/sdk": "1.20.2",
55
- "hono": "^4.10.4",
79
+ "@modelcontextprotocol/sdk": "1.22.0",
80
+ "hono": "^4.10.6",
56
81
  "neverthrow": "8.2.0",
57
82
  "zod": "3.25.76"
58
- },
59
- "lint-staged": {
60
- "*.{ts,tsx,json}": [
61
- "bunx @biomejs/biome check --write"
62
- ]
63
83
  }
64
84
  }