Skip to content

Conversation

@timjonaswechler
Copy link

@timjonaswechler timjonaswechler commented Jul 4, 2025

Summary

This PR migrates the project from Bun to npm for better compatibility and fixes all 4 open issues.

Migration Changes

  • Replace Bun build system with standard TypeScript compilation
  • Update package.json scripts to use npm and tsc instead of bun
  • Add Jest configuration for testing with ESM support
  • Update all ESM imports to use .js extensions for Node.js compatibility
  • Remove Bun-specific dependencies and add npm equivalents
  • Update README.md with npm-based installation and usage instructions
  • Add TypeScript test configuration for Jest
  • Maintain full functionality while using standard Node.js tooling

Issue Fixes

✅ Issue #1: Make version parameter explicitly required for search_symbols function

  • Problem: Function marked version as optional but failed without it
  • Fix: Made version parameter default "latest"
  • Benefit: Eliminates confusing 404 errors

✅ Issue #2: get_source_code function consistently returns 404 errors

  • Problem: Function used incorrect URL patterns for docs.rs source access
  • Fix: Implemented multiple URL pattern attempts with fallback logic
  • Benefit: Source code access now works with better error reporting

✅ Issue #3: get_crate_documentation returns "Documentation content not found"

  • Problem: Used wrong URL path and CSS selectors for docs.rs documentation
  • Fix: Corrected URL pattern and updated CSS selectors for docs.rs structure
  • Benefit: Documentation retrieval now works correctly

✅ Issue #4: Improve error messages and API consistency

  • Problem: Generic error messages made debugging difficult
  • Fix: Added comprehensive parameter validation and specific error messages
  • Benefit: Much better developer experience with clear, actionable error messages

Testing

  • ✅ Build process works with npm run build
  • ✅ Server starts correctly with npm run start
  • ✅ Development mode works with npm run dev
  • ✅ All 9 tests pass with npm test
  • ✅ All MCP functions now work as expected

Benefits

  • Better compatibility with standard Node.js tooling
  • Easier for contributors who may not be familiar with Bun
  • Uses widely adopted npm ecosystem
  • Resolves all open functionality issues
  • Maintains exact same functionality while fixing bugs

- Replace Bun build system with standard TypeScript compilation
- Update package.json scripts to use npm and tsc
- Add Jest configuration for testing with ESM support
- Update all ESM imports to use .js extensions for Node.js compatibility
- Remove Bun-specific dependencies and add npm equivalents
- Update README.md with npm-based installation and usage instructions
- Add TypeScript test configuration for Jest
- Maintain full functionality while using standard Node.js tooling
- Make version parameter required for search_symbols function
- Fix get_source_code 404 errors by trying multiple URL patterns
- Fix get_crate_documentation by using correct docs.rs selectors
- Add comprehensive parameter validation and better error messages
- Update tests to use working Tokio version
- Improve API consistency across all MCP functions

Resolves issues johnkferguson#1, johnkferguson#2, johnkferguson#3, and johnkferguson#4
- Update search_symbols tool to accept optional version parameter
- Adjust service logic to handle optional version in symbol search
- Apply consistent code formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant