@houtini/seo-crawler-mcp 2.0.1 → 2.1.0
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/CROSS_PLATFORM_FIX.md +102 -0
- package/ISSUE_hardcoded_output_path.md +69 -0
- package/README.md +694 -694
- package/README_UPDATE.md +66 -0
- package/build/cli.d.ts +2 -1
- package/build/cli.d.ts.map +1 -1
- package/build/cli.js +39 -33
- package/build/cli.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/tools/run-seo-audit.d.ts.map +1 -1
- package/build/tools/run-seo-audit.js +5 -1
- package/build/tools/run-seo-audit.js.map +1 -1
- package/commit-msg.txt +9 -0
- package/package.json +49 -49
- package/server.json +36 -31
- package/src/cli.ts +228 -224
- package/src/index.ts +261 -259
- package/src/tools/run-seo-audit.ts +91 -83
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Cross-Platform Output Path Fix - v2.1.0
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Fixed hardcoded Windows-only output path that prevented the MCP server from working on macOS and Linux.
|
|
6
|
+
|
|
7
|
+
## Changes Made
|
|
8
|
+
|
|
9
|
+
### 1. `src/tools/run-seo-audit.ts`
|
|
10
|
+
**Before:**
|
|
11
|
+
```typescript
|
|
12
|
+
const outputPath = `C:\\seo-audits\\${folderName}`;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**After:**
|
|
16
|
+
```typescript
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import os from 'os';
|
|
19
|
+
|
|
20
|
+
// Cross-platform output directory resolution
|
|
21
|
+
// Priority: OUTPUT_DIR env var > home directory fallback
|
|
22
|
+
const baseDir = process.env.OUTPUT_DIR || path.join(os.homedir(), 'seo-audits');
|
|
23
|
+
const outputPath = path.join(baseDir, folderName);
|
|
24
|
+
|
|
25
|
+
debug('[MCP] Output path resolved:', outputPath);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**What this fixes:**
|
|
29
|
+
- Uses `OUTPUT_DIR` environment variable if set
|
|
30
|
+
- Falls back to user's home directory (`~/seo-audits`) on all platforms
|
|
31
|
+
- Uses Node.js `path.join()` for platform-agnostic path construction
|
|
32
|
+
- Uses `os.homedir()` to get correct home directory on any OS
|
|
33
|
+
|
|
34
|
+
### 2. `package.json`
|
|
35
|
+
- Bumped version from `2.0.2` to `2.1.0`
|
|
36
|
+
|
|
37
|
+
### 3. `src/index.ts`
|
|
38
|
+
- Updated `SERVER_VERSION` from `'2.0.1'` to `'2.1.0'`
|
|
39
|
+
- Updated startup message to include Phase 5 confirmation
|
|
40
|
+
|
|
41
|
+
### 4. `CHANGELOG.md`
|
|
42
|
+
- Added comprehensive v2.1.0 release notes
|
|
43
|
+
- Documented the cross-platform fix with examples
|
|
44
|
+
|
|
45
|
+
### 5. `README_UPDATE.md` (Created)
|
|
46
|
+
- New documentation section explaining cross-platform configuration
|
|
47
|
+
- Examples for Windows, macOS, and Linux
|
|
48
|
+
- Explains default behaviour when `OUTPUT_DIR` is not set
|
|
49
|
+
|
|
50
|
+
## Platform-Specific Defaults
|
|
51
|
+
|
|
52
|
+
**When `OUTPUT_DIR` is NOT set:**
|
|
53
|
+
- Windows: `C:\Users\YourName\seo-audits`
|
|
54
|
+
- macOS: `/Users/YourName/seo-audits`
|
|
55
|
+
- Linux: `/home/YourName/seo-audits`
|
|
56
|
+
|
|
57
|
+
**When `OUTPUT_DIR` IS set:**
|
|
58
|
+
- Uses the specified path on any platform
|
|
59
|
+
- Windows example: `C:\\custom\\path`
|
|
60
|
+
- Unix example: `/var/www/seo-audits`
|
|
61
|
+
|
|
62
|
+
## Testing
|
|
63
|
+
|
|
64
|
+
Build completed successfully:
|
|
65
|
+
```
|
|
66
|
+
> @houtini/seo-crawler-mcp@2.1.0 build
|
|
67
|
+
> tsc
|
|
68
|
+
|
|
69
|
+
✅ Process completed with exit code 0
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Next Steps
|
|
73
|
+
|
|
74
|
+
1. Update README.md with the new environment variable documentation from `README_UPDATE.md`
|
|
75
|
+
2. Test on Windows to ensure existing config still works
|
|
76
|
+
3. Test on macOS/Linux to verify cross-platform compatibility
|
|
77
|
+
4. Commit and tag as v2.1.0
|
|
78
|
+
5. Publish to npm
|
|
79
|
+
|
|
80
|
+
## Implementation Notes
|
|
81
|
+
|
|
82
|
+
- Uses standard Node.js modules (`path`, `os`)
|
|
83
|
+
- No breaking changes to existing configurations
|
|
84
|
+
- Backwards compatible - existing Windows users unaffected if they set `OUTPUT_DIR`
|
|
85
|
+
- More flexible - users can now specify any output directory
|
|
86
|
+
- Better default behaviour - uses home directory instead of hardcoded path
|
|
87
|
+
|
|
88
|
+
## Files Modified
|
|
89
|
+
|
|
90
|
+
- `src/tools/run-seo-audit.ts` - Core fix
|
|
91
|
+
- `package.json` - Version bump
|
|
92
|
+
- `src/index.ts` - Version constant update
|
|
93
|
+
- `CHANGELOG.md` - Release notes
|
|
94
|
+
- `README_UPDATE.md` - New documentation (created)
|
|
95
|
+
- `ISSUE_hardcoded_output_path.md` - Issue documentation (already existed)
|
|
96
|
+
|
|
97
|
+
## Resolves
|
|
98
|
+
|
|
99
|
+
- Cross-platform compatibility (Windows, macOS, Linux)
|
|
100
|
+
- User-configurable output directories
|
|
101
|
+
- Sensible defaults using home directory
|
|
102
|
+
- Environment variable support as documented
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Hardcoded Windows-only output path breaks cross-platform compatibility
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
The output path for SEO audit crawls is currently hardcoded to `C:\\seo-audits` in `src/tools/run-seo-audit.ts` (line 31). This causes several issues:
|
|
6
|
+
|
|
7
|
+
1. **Platform-specific**: Only works on Windows, will fail on macOS and Linux
|
|
8
|
+
2. **Not configurable**: Users cannot specify their own output directory
|
|
9
|
+
3. **No environment variable support**: Can't be overridden via configuration
|
|
10
|
+
|
|
11
|
+
## Current Code
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
const outputPath = `C:\\seo-audits\\${folderName}`;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Proposed Solution
|
|
18
|
+
|
|
19
|
+
Make the output directory cross-platform and configurable:
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import path from 'path';
|
|
23
|
+
import os from 'os';
|
|
24
|
+
|
|
25
|
+
// Option 1: Environment variable with sensible fallback
|
|
26
|
+
const baseDir = process.env.SEO_AUDIT_DIR || path.join(os.homedir(), 'seo-audits');
|
|
27
|
+
const outputPath = path.join(baseDir, folderName);
|
|
28
|
+
|
|
29
|
+
// Option 2: Add optional parameter to MCP tool
|
|
30
|
+
const outputPath = validated.outputDir
|
|
31
|
+
? path.join(validated.outputDir, folderName)
|
|
32
|
+
: path.join(os.homedir(), 'seo-audits', folderName);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Benefits
|
|
36
|
+
|
|
37
|
+
- **Cross-platform**: Works on Windows, macOS, and Linux automatically
|
|
38
|
+
- Windows: `C:\Users\username\seo-audits`
|
|
39
|
+
- macOS: `/Users/username/seo-audits`
|
|
40
|
+
- Linux: `/home/username/seo-audits`
|
|
41
|
+
- **User configurable**: Via environment variable or tool parameter
|
|
42
|
+
- **Professional**: Better production-ready behavior
|
|
43
|
+
|
|
44
|
+
## Implementation Options
|
|
45
|
+
|
|
46
|
+
**Option A (Minimal)**: Use `os.homedir()` with `path.join()`
|
|
47
|
+
- Pros: Simple, cross-platform, no config needed
|
|
48
|
+
- Cons: Still fixed to home directory
|
|
49
|
+
|
|
50
|
+
**Option B (Environment Variable)**: Add `SEO_AUDIT_DIR` env var support
|
|
51
|
+
- Pros: User configurable without code changes
|
|
52
|
+
- Cons: Requires documentation update
|
|
53
|
+
|
|
54
|
+
**Option C (Tool Parameter)**: Add `outputDir` parameter to MCP tool
|
|
55
|
+
- Pros: Most flexible, can be set per-call
|
|
56
|
+
- Cons: Breaking change to API, requires schema update
|
|
57
|
+
|
|
58
|
+
## Recommendation
|
|
59
|
+
|
|
60
|
+
Implement Option B with fallback to Option A:
|
|
61
|
+
1. Check for `SEO_AUDIT_DIR` environment variable
|
|
62
|
+
2. Fall back to `path.join(os.homedir(), 'seo-audits')`
|
|
63
|
+
3. Document the environment variable in README
|
|
64
|
+
|
|
65
|
+
This provides flexibility while maintaining backward compatibility (just changes the default location to be cross-platform).
|
|
66
|
+
|
|
67
|
+
## Additional Context
|
|
68
|
+
|
|
69
|
+
Discovered during testing on Windows when comparing CLI vs MCP tool usage. The hardcoded path works for now but limits portability and user configuration options.
|