@youdotcom-oss/mcp 1.3.3 → 1.3.5-next.11

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/AGENTS.md DELETED
@@ -1,702 +0,0 @@
1
- ---
2
- description: Development guidelines for You.com MCP Server using Bun runtime.
3
- globs: "*.ts, *.tsx, *.js, *.jsx, package.json"
4
- alwaysApply: false
5
- ---
6
-
7
- # You.com MCP Server Development Guide
8
-
9
- A Model Context Protocol (MCP) server that provides web search, AI agent, and content extraction capabilities through You.com's APIs.
10
-
11
- ---
12
-
13
- > **Note for end users**: If you want to use this MCP server (not develop or contribute), see [README.md](./README.md) for setup instructions, getting started guides, and usage examples.
14
-
15
- **This guide (AGENTS.md) is for developers, contributors, and AI coding agents** who want to:
16
- - Set up a local development environment
17
- - Understand the codebase architecture
18
- - Contribute code or bug fixes
19
- - Run tests and quality checks
20
- - Review pull requests
21
-
22
- ---
23
-
24
- ## Tech Stack
25
-
26
- - **Runtime**: Bun >= 1.2.21 (not Node.js)
27
- - **Framework**: Model Context Protocol SDK v1.22.0
28
- - **HTTP Server**: Hono v4.10.6 with @hono/mcp for HTTP transport (SSE protocol support)
29
- - **Validation**: Zod 3.25.76 for schema validation
30
- - **Testing**: Bun test (built-in test runner)
31
- - **Code Quality**: Biome 2.3.7 (linter + formatter)
32
- - **Type Checking**: TypeScript 5.9.3
33
- - **Git Hooks**: lint-staged 16.2.7
34
-
35
- ## Quick Start
36
-
37
- ### Setup Environment
38
-
39
- ```bash
40
- echo "export YDC_API_KEY=your-actual-api-key-here" > .env
41
- source .env
42
- ```
43
-
44
- ### Development Commands
45
-
46
- ```bash
47
- bun install # Install dependencies
48
- bun run dev # Start stdio server
49
- bun start # Start HTTP server on port 4000
50
- bun test # Run tests
51
- bun test:coverage # Run tests with coverage report
52
- bun test:watch # Run tests in watch mode
53
- bun run check # Run all checks (biome + types + package format)
54
- bun run check:write # Auto-fix all issues
55
- ```
56
-
57
- ## Code Style
58
-
59
- This project uses [Biome](https://biomejs.dev/) for automated code formatting and linting. Most style rules are enforced automatically via git hooks.
60
-
61
- ### Manual Adherence Required
62
-
63
- **Arrow Functions**: Always use arrow functions for declarations (not enforced by Biome)
64
- ```ts
65
- // ✅ Preferred
66
- export const fetchData = async (params: Params) => { ... };
67
-
68
- // ❌ Avoid
69
- export async function fetchData(params: Params) { ... }
70
- ```
71
-
72
- **No Unused Exports**: All exports must be actively used (Biome detects unused variables/imports, but NOT unused exports)
73
- ```bash
74
- # Before adding exports, verify usage:
75
- grep -r "ExportName" src/
76
- ```
77
-
78
- ### MCP-Specific Patterns
79
-
80
- **Schema Design**: Always use Zod for input/output validation
81
- ```ts
82
- export const MyToolInputSchema = z.object({
83
- query: z.string().min(1).describe('Search query'),
84
- limit: z.number().optional().describe('Max results'),
85
- });
86
- ```
87
-
88
- **Error Handling**: Always use try/catch with typed error handling
89
- ```ts
90
- try {
91
- const response = await apiCall();
92
- return formatResponse(response);
93
- } catch (err: unknown) {
94
- const errorMessage = err instanceof Error ? err.message : String(err);
95
- await logger({ level: 'error', data: `API call failed: ${errorMessage}` });
96
- return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
97
- }
98
- ```
99
-
100
- **Logging**: Use `getLogger(mcp)` helper, never console.log
101
- ```ts
102
- import { getLogger } from '../shared/get-logger.ts';
103
-
104
- const logger = getLogger(mcp);
105
- await logger({ level: 'info', data: `Operation successful: ${result}` });
106
- await logger({ level: 'error', data: `Operation failed: ${errorMessage}` });
107
- ```
108
-
109
- **Response Format**: Return both `content` and `structuredContent`
110
- ```ts
111
- return {
112
- content: [{ type: 'text', text: formattedText }],
113
- structuredContent: responseData,
114
- };
115
- ```
116
-
117
- ## Development Workflow
118
-
119
- ### Git Hooks
120
-
121
- Git hooks are automatically configured after `bun install`:
122
-
123
- - **Pre-commit**: Runs Biome check and format-package on staged files
124
- - **Setup**: `bun run prepare` (runs automatically with install)
125
- - Git hooks enforce code quality standards and should never be bypassed
126
-
127
- ### MCP Inspector
128
-
129
- Test and debug MCP tools interactively:
130
-
131
- ```bash
132
- bun run inspect # Automatically loads .env variables
133
- ```
134
-
135
- - Opens interactive UI to test MCP tools
136
- - Requires `YDC_API_KEY` in `.env` file
137
- - See [MCP Inspector docs](https://modelcontextprotocol.io/docs/tools/inspector)
138
-
139
- ### Code Quality Commands
140
-
141
- ```bash
142
- # Check everything (CI command)
143
- bun run check # Runs biome + types + package format
144
-
145
- # Individual checks
146
- bun run check:biome # Lint and format check
147
- bun run check:types # TypeScript type check
148
- bun run check:package # package.json format check
149
-
150
- # Auto-fix
151
- bun run check:write # Fix all auto-fixable issues
152
- bun run lint:fix # Fix lint issues only
153
- bun run format # Format code only
154
- bun run format:package # Format package.json only
155
- ```
156
-
157
- ## Contributing
158
-
159
- For detailed contribution guidelines, including:
160
- - Bug reporting
161
- - Feature requests
162
- - Pull request workflow
163
- - Commit message conventions (Conventional Commits)
164
- - Code review process
165
-
166
- See [CONTRIBUTING.md](./CONTRIBUTING.md)
167
-
168
- ## MCP Server Patterns
169
-
170
- ### Tool Registration
171
-
172
- Use Zod schemas for tool parameter validation. See examples:
173
- - Search tool: `src/search/register-search-tool.ts:7-86`
174
- - Express tool: `src/express/register-express-tool.ts:7-66`
175
- - Contents tool: `src/contents/register-contents-tool.ts:7-89`
176
-
177
- ### Error Handling
178
-
179
- Always use try/catch with typed error handling (`err: unknown`). See tool registration files for standard pattern.
180
-
181
- ### Logging
182
-
183
- Use `getLogger(mcp)` helper, never console.log. See `src/shared/get-logger.ts:8-11` for implementation.
184
-
185
- ### Error Reporting
186
-
187
- Include mailto links in error logs using `generateErrorReportLink()` helper (`src/shared/generate-error-report-link.ts:6-37`). This creates one-click error reporting with full diagnostic context.
188
-
189
-
190
- ## Testing
191
-
192
- ### Test Organization
193
-
194
- - **Unit Tests**: `src/*/tests/*.spec.ts` - Test individual utilities
195
- - **Integration Tests**: `src/tests/*.spec.ts` - Test MCP tools end-to-end
196
- - **Coverage Target**: >80% for core utilities
197
-
198
- For test patterns, see:
199
- - Unit tests: `src/search/tests/search.utils.spec.ts`
200
- - Integration tests: `src/tests/tool.spec.ts`
201
-
202
- ### Test Assertion Anti-Patterns
203
-
204
- **IMPORTANT: Avoid patterns that silently skip assertions** - they hide failures.
205
-
206
- ❌ **Early Returns** - Silently exits test, skips remaining assertions
207
- ```ts
208
- if (!item) return; // Bad: test passes even if item is undefined
209
- ```
210
-
211
- ❌ **Redundant Conditionals** - Asserts defined, then conditionally checks type
212
- ```ts
213
- expect(item?.markdown).toBeDefined();
214
- if (item?.markdown) {
215
- expect(typeof item.markdown).toBe('string'); // Redundant!
216
- }
217
- ```
218
-
219
- ✅ **Let tests fail naturally** - Use optional chaining and direct assertions:
220
- ```ts
221
- expect(item).toBeDefined();
222
- expect(item).toHaveProperty('url'); // Fails with clear error if undefined
223
- ```
224
-
225
- ### Running Tests
226
-
227
- ```bash
228
- bun test # All tests
229
- bun test:coverage # With coverage report
230
- bun test:watch # Run tests in watch mode
231
- bun test:coverage:watch # Coverage with watch mode
232
- bun test src/search/tests/ # Specific directory
233
- ```
234
-
235
- Requires `YDC_API_KEY` environment variable for API tests.
236
-
237
- ## Troubleshooting
238
-
239
- ### Common Issues
240
-
241
- #### YDC_API_KEY not found
242
-
243
- **Symptom**: Error message "YDC_API_KEY environment variable is required"
244
-
245
- **Solution**:
246
- ```bash
247
- # Set up .env file
248
- echo "export YDC_API_KEY=your-actual-api-key-here" > .env
249
- source .env
250
-
251
- # Or export directly
252
- export YDC_API_KEY="your-actual-api-key-here"
253
-
254
- # Verify it's set
255
- echo $YDC_API_KEY
256
- ```
257
-
258
- #### Build Failures
259
-
260
- **Symptom**: `bun run build` fails with TypeScript errors
261
-
262
- **Solution**:
263
- ```bash
264
- # Check TypeScript errors
265
- bun run check:types
266
-
267
- # Fix code quality issues
268
- bun run check:write
269
-
270
- # Clean and rebuild
271
- rm -rf bin/
272
- bun run build
273
- ```
274
-
275
- #### Test Failures with API Rate Limits
276
-
277
- **Symptom**: Tests fail with 429 (Too Many Requests) errors
278
-
279
- **Solution**:
280
- - Wait a few minutes before re-running tests
281
- - Run specific test suites instead of all tests at once
282
- - Use `bun test --bail` to stop after first failure
283
- - Check your API key rate limits at [api.you.com](https://api.you.com)
284
-
285
- #### Docker Permission Issues
286
-
287
- **Symptom**: Docker build fails with permission errors
288
-
289
- **Solution**:
290
- ```bash
291
- # Ensure Docker daemon is running
292
- docker info
293
-
294
- # Build with sudo if needed (Linux)
295
- sudo docker build -t youdotcom-mcp-server .
296
-
297
- # Check Docker group membership (Linux)
298
- groups $USER
299
- ```
300
-
301
- #### Biome/TypeScript Errors
302
-
303
- **Symptom**: Pre-commit hook fails or `bun run check` shows errors
304
-
305
- **Solution**:
306
- ```bash
307
- # Auto-fix most issues
308
- bun run check:write
309
-
310
- # Check specific issues
311
- bun run check:biome # Linting and formatting
312
- bun run check:types # TypeScript type errors
313
- bun run check:package # package.json formatting
314
-
315
- # Format code manually
316
- bun run format
317
-
318
- # Fix lint issues manually
319
- bun run lint:fix
320
- ```
321
-
322
- #### Import Resolution Errors
323
-
324
- **Symptom**: "Cannot find module" errors in TypeScript
325
-
326
- **Solution**:
327
- - Always use `.js` extensions in imports (even for `.ts` files)
328
- - Check that the file exists at the specified path
329
- - Use relative paths correctly (`./` for same directory, `../` for parent)
330
- - Example: `import { foo } from './utils.js'` (not `./utils`)
331
-
332
- #### MCP Client Connection Issues
333
-
334
- **Symptom**: MCP client can't connect to server
335
-
336
- **Solution for Stdio mode**:
337
- - Verify the path to `stdio.ts` or `stdio.js` is correct and absolute
338
- - Check that Bun is installed and in PATH
339
- - Test manually: `bun src/stdio.ts`
340
-
341
- **Solution for HTTP mode**:
342
- - Verify server is running: `curl http://localhost:4000/mcp-health`
343
- - Check port isn't in use: `lsof -i :4000` (macOS/Linux)
344
- - Verify Bearer token matches your API key
345
- - Check firewall settings
346
-
347
- ## API Integration
348
-
349
- ### You.com API Key
350
-
351
- This server uses a single `YDC_API_KEY` for all APIs, but they use different authentication methods:
352
-
353
- - **Search API** (`you-search`): Uses `X-API-Key` header
354
- - **Contents API** (`you-contents`): Uses `X-API-Key` header
355
- - **Agent API** (`you-express`): Uses `Authorization: Bearer` header
356
-
357
- **Important**: If you receive 401 Unauthorized errors when using the `you-express` tool, ensure your API key has permissions for agent endpoints.
358
-
359
- ### API Response Validation
360
-
361
- Always validate API responses and handle errors:
362
-
363
- ```ts
364
- // Check for error field even with 200 status
365
- checkResponseForErrors(jsonResponse);
366
-
367
- // Validate with Zod
368
- const validatedResponse = ResponseSchema.parse(jsonResponse);
369
-
370
- // Handle specific status codes
371
- if (response.status === 401) {
372
- throw new Error('Invalid or expired API key');
373
- }
374
- if (response.status === 403) {
375
- throw new Error('API key lacks permissions for this endpoint');
376
- }
377
- if (response.status === 429) {
378
- throw new Error('Rate limit exceeded');
379
- }
380
- ```
381
-
382
- ## Available MCP Tools
383
-
384
- ### 1. `you-search`
385
-
386
- Web and news search using You.com Search API
387
-
388
- - Returns web results with snippets and news articles
389
- - Supports filters: freshness, country, safesearch, file types
390
- - Authentication: `X-API-Key` header
391
-
392
- ### 2. `you-express`
393
-
394
- Fast AI responses with optional web search
395
-
396
- - Best for straightforward queries
397
- - Fast responses with real-time web information
398
- - Returns AI-synthesized answer + optional web search results
399
- - Uses non-streaming JSON responses (`stream: false`)
400
- - Authentication: `Authorization: Bearer` header
401
-
402
- ### 3. `you-contents`
403
-
404
- Content extraction from web pages
405
-
406
- - Extracts full page content in markdown or HTML format
407
- - Processes multiple URLs in a single API request
408
- - Returns both text and structured content formats
409
- - Markdown recommended for text extraction
410
- - HTML recommended for layout preservation
411
- - Authentication: `X-API-Key` header
412
-
413
- ## Architecture
414
-
415
- ### System Overview
416
-
417
- ```mermaid
418
- graph TD
419
- Clients["MCP Clients
420
- (Claude Desktop, Claude Code, Custom Clients)"]
421
-
422
- Clients -->|"Stdio (Local)"| Stdio["src/stdio.ts
423
- - Process I/O
424
- - JSON-RPC"]
425
- Clients -->|"HTTP/SSE (Remote)"| HTTP["src/http.ts (Hono + SSE)
426
- - /mcp
427
- - /mcp-health
428
- - Bearer Auth"]
429
-
430
- Stdio --> Server["src/get-mcp-server.ts
431
- MCP Server Factory
432
- - registerTool()
433
- - Tool Handlers
434
- - Logging"]
435
- HTTP --> Server
436
-
437
- Server --> Search["you-search
438
- - Validation
439
- - Query Build
440
- - Formatting"]
441
- Server --> Express["you-express
442
- - Validation
443
- - Transform
444
- - Formatting"]
445
- Server --> Contents["you-contents
446
- - Validation
447
- - Multi-URL
448
- - Formatting"]
449
-
450
- Search -->|X-API-Key| APIs["You.com APIs
451
- - Search API (ydc-index.io)
452
- - Agent API (api.you.com)
453
- - Contents API (ydc-index.io)"]
454
- Express -->|Bearer| APIs
455
- Contents -->|X-API-Key| APIs
456
- ```
457
-
458
- ### Request Flow
459
-
460
- **Stdio Transport (Local Development)**:
461
- 1. MCP Client sends JSON-RPC request via stdin
462
- 2. `stdio.ts` receives and parses request
463
- 3. Calls MCP Server with tool name + parameters
464
- 4. MCP Server validates input with Zod schemas
465
- 5. Tool handler calls You.com API
466
- 6. Response formatted for MCP
467
- 7. JSON-RPC response sent via stdout
468
-
469
- **HTTP Transport (Remote Deployment)**:
470
- 1. MCP Client connects via SSE to `/mcp`
471
- 2. Client sends tool request over SSE connection
472
- 3. `http.ts` authenticates Bearer token
473
- 4. Calls MCP Server with tool name + parameters
474
- 5. MCP Server validates input with Zod schemas
475
- 6. Tool handler calls You.com API
476
- 7. Response formatted for MCP
477
- 8. SSE event sent back to client
478
-
479
- ### Core Server Files
480
-
481
- - `src/stdio.ts` - Stdio transport entry point (used by `bun run dev`)
482
- - `src/http.ts` - HTTP transport with Bearer token auth (Hono app)
483
- - `/mcp` - Main MCP endpoint (SSE streaming)
484
- - `/mcp-health` - Health check endpoint
485
- - Bearer token authentication via `Authorization` header
486
- - `Content-Encoding: identity` header handling for compatibility
487
- - `src/get-mcp-server.ts` - MCP server factory function
488
-
489
- ### Search Tool (`you-search`)
490
-
491
- - `src/search/register-search-tool.ts` - Tool registration with validation
492
- - `src/search/search.schemas.ts` - Zod schemas for validation
493
- - `src/search/search.utils.ts` - API calls, query building, formatting
494
- - `src/search/tests/search.utils.spec.ts` - Unit tests
495
-
496
- ### Express Agent Tool (`you-express`)
497
-
498
- - `src/express/register-express-tool.ts` - Tool registration and request handling
499
- - `src/express/express.schemas.ts` - Dual schema architecture
500
- - API response validation (ExpressAgentApiResponseSchema)
501
- - Token-efficient MCP output (ExpressAgentMcpResponseSchema)
502
- - API validates full You.com response
503
- - MCP output returns only essential fields
504
- - `src/express/express.utils.ts` - API calls and response transformation
505
- - `callExpressAgent()` - Calls You.com Express API (`stream: false`)
506
- - Transforms API response to MCP format
507
- - `formatExpressAgentResponse()` - Formats MCP response
508
- - `agentThrowOnFailedStatus()` - Handles API errors
509
- - `src/express/tests/express.utils.spec.ts` - Unit tests
510
-
511
- ### Contents Tool (`you-contents`)
512
-
513
- - `src/contents/register-contents-tool.ts` - Tool registration
514
- - Calls `fetchContents()` with all URLs in single request
515
- - Formats response for text and structured output
516
- - Comprehensive error handling (401, 403, 429, 5xx)
517
- - `src/contents/contents.schemas.ts` - Zod schemas
518
- - `ContentsQuerySchema` - Input validation
519
- - `ContentsApiResponseSchema` - API response validation
520
- - `ContentsStructuredContentSchema` - MCP output format
521
- - `src/contents/contents.utils.ts` - API calls and formatting
522
- - `fetchContents()` - Single API call with all URLs
523
- - Uses `X-API-Key` header
524
- - Validates response schema
525
- - `formatContentsResponse()` - Formats for MCP output
526
- - `src/contents/tests/contents.utils.spec.ts` - Unit tests
527
-
528
- ### Shared Utilities
529
-
530
- - `src/shared/use-client-version.ts` - User-Agent generation with MCP client version info
531
- - `useGetClientVersion(mcp)` - Returns a `getUserAgent` function for creating User-Agent strings
532
- - `src/shared/get-logger.ts` - MCP server logging
533
- - `getLogger(mcp)` - Returns a logging function for MCP server notifications
534
- - `src/shared/check-response-for-errors.ts` - API response validation
535
- - `checkResponseForErrors()` - Validates API responses for error fields
536
- - `src/shared/generate-error-report-link.ts` - Error reporting utilities
537
- - `generateErrorReportLink()` - Creates mailto links for one-click error reporting
538
- - `src/shared/format-search-results-text.ts` - Search result formatting
539
- - `formatSearchResultsText()` - Formats search results for text display
540
-
541
- ### Library Export
542
-
543
- - `src/main.ts` - Public API export file for library consumers
544
- - Exports all schemas from contents, express, and search tools
545
- - Exports utility functions from contents, express, and search
546
- - Exports shared utilities (checkResponseForErrors, formatSearchResultsText)
547
- - Used when consuming this package as a library (not as MCP server)
548
-
549
- ### Integration Tests
550
-
551
- - `src/tests/http.spec.ts` - HTTP server endpoint tests
552
- - `src/tests/tool.spec.ts` - End-to-end MCP tool tests
553
-
554
- ## Deployment
555
-
556
- This section covers local development setup, self-hosting options, and production deployment strategies.
557
-
558
- ### Local development setup
559
-
560
- **Prerequisites:**
561
- - Bun >= 1.2.21 installed
562
- - You.com API key from [you.com/platform/api-keys](https://you.com/platform/api-keys)
563
-
564
- **Quick start:**
565
-
566
- ```bash
567
- # Clone repository
568
- git clone https://github.com/youdotcom-oss/youdotcom-mcp-server.git
569
- cd youdotcom-mcp-server
570
-
571
- # Install dependencies
572
- bun install
573
-
574
- # Set up environment
575
- echo "export YDC_API_KEY=your-actual-api-key-here" > .env
576
- source .env
577
-
578
- # Start development server (STDIO mode)
579
- bun run dev
580
-
581
- # Or start HTTP server on port 4000
582
- bun start
583
- ```
584
-
585
- **Verify setup:**
586
- ```bash
587
- # Test STDIO mode
588
- echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | bun src/stdio.ts
589
-
590
- # Test HTTP mode (in separate terminal)
591
- curl http://localhost:4000/mcp-health
592
- ```
593
-
594
- ### Self-hosting with Docker
595
-
596
- **Build and run:**
597
-
598
- ```bash
599
- # Build Docker image
600
- docker build -t youdotcom-mcp-server .
601
-
602
- # Run container with API key
603
- docker run -d \
604
- -p 4000:4000 \
605
- --name youdotcom-mcp \
606
- -e YDC_API_KEY=your-actual-api-key-here \
607
- youdotcom-mcp-server
608
-
609
- # Check health
610
- curl http://localhost:4000/mcp-health
611
- ```
612
-
613
- **Docker Compose:**
614
-
615
- ```yaml
616
- version: '3.8'
617
- services:
618
- youdotcom-mcp:
619
- build: .
620
- ports:
621
- - "4000:4000"
622
- environment:
623
- - YDC_API_KEY=${YDC_API_KEY}
624
- restart: unless-stopped
625
- ```
626
-
627
- ### Deployment modes
628
-
629
- | Mode | Use Case | Transport | Command |
630
- |------|----------|-----------|---------|
631
- | **STDIO Dev** | Local development and testing | STDIO | `bun run dev` |
632
- | **STDIO Prod** | MCP client integration (local) | STDIO | `./bin/stdio.js` |
633
- | **HTTP Dev** | Local HTTP server testing | HTTP/SSE | `bun start` |
634
- | **HTTP Prod** | Remote clients, web apps, production | HTTP/SSE | `bun run build && bun bin/http` |
635
- | **Docker** | Containerized deployment | HTTP/SSE | `docker run ...` |
636
-
637
- ### Production deployment
638
-
639
- **Building for production:**
640
-
641
- ```bash
642
- # Build optimized STDIO bundle
643
- bun run build
644
-
645
- # Outputs:
646
- # - bin/stdio.js (compiled STDIO transport)
647
- # Note: bin/http is an executable script, not compiled
648
- ```
649
-
650
- **Running in production:**
651
-
652
- ```bash
653
- # Set API key
654
- export YDC_API_KEY=your-actual-api-key-here
655
-
656
- # STDIO mode (for MCP clients)
657
- node bin/stdio.js
658
-
659
- # HTTP mode (for remote access)
660
- PORT=4000 bun bin/http
661
- ```
662
-
663
- **Environment variables:**
664
-
665
- | Variable | Required | Default | Description |
666
- |----------|----------|---------|-------------|
667
- | `YDC_API_KEY` | Yes | - | You.com API key |
668
- | `PORT` | No | 4000 | HTTP server port (HTTP mode only) |
669
-
670
- **Production considerations:**
671
-
672
- - **Security**: Never expose STDIO mode to external networks
673
- - **HTTP mode**: Use reverse proxy (nginx, Caddy) with HTTPS in production
674
- - **Rate limiting**: Consider implementing rate limiting for HTTP endpoints
675
- - **Monitoring**: Set up health check monitoring on `/mcp-health`
676
- - **Logging**: MCP server logs to stderr; configure log aggregation as needed
677
- - **API key rotation**: Restart server after rotating API keys
678
-
679
- ### MCP client configuration
680
-
681
- For connecting MCP clients to your self-hosted server, see the "Adding to your MCP client" section in [README.md](./README.md).
682
-
683
- For complete API reference documentation including parameters, response formats, and examples, see [API.md](./docs/API.md).
684
-
685
- ## Bun Runtime
686
-
687
- This project uses Bun (>= 1.2.21) instead of Node.js:
688
-
689
- ```bash
690
- bun <file> # Run TypeScript directly
691
- bun install # Install dependencies
692
- bun test # Built-in test runner
693
- ```
694
-
695
- **Import Extensions** (enforced by Biome):
696
- - Local files: `.ts` extension
697
- - NPM packages: `.js` extension
698
- - JSON files: `.json` with import assertion
699
-
700
- See `src/contents/register-contents-tool.ts:1-5` for import examples.
701
-
702
- **Build**: Build configuration is defined in `package.json` scripts. The `bun run build` command compiles `src/stdio.ts` to `bin/stdio.js` for production use.