Skip to content

Conversation

@prosdev
Copy link
Collaborator

@prosdev prosdev commented Nov 25, 2025

Problem

The dev_gh MCP tool was failing with error:

MCP error -32001: GitHubIndexerClass is not a constructor

Root Cause

The dynamic import in github-adapter.ts was not correctly importing the GitHubIndexer class:

const { GitHubIndexer: GitHubIndexerClass } = await import('@lytics/dev-agent-subagents');

Solution

Changed to static import to match the pattern used in status-adapter.ts:

import {
  GitHubIndexer,
  type GitHubDocument,
  type GitHubSearchOptions,
  type GitHubSearchResult,
} from '@lytics/dev-agent-subagents';

Changes

  • ✅ Replaced dynamic import() with static named import
  • ✅ Now uses direct instantiation with new GitHubIndexer()
  • ✅ Consistent with status-adapter.ts implementation

Testing

  • ✅ Build successful
  • ✅ Manual testing confirmed dev_gh tool works correctly
  • ✅ Both search and context actions verified

Impact

  • Fixes dev_gh tool functionality in MCP server
  • Users can now search GitHub issues/PRs via MCP

The dynamic import was causing 'GitHubIndexerClass is not a constructor'
error in the MCP dev_gh tool. Changed to static import to match the
pattern used in status-adapter.ts.

Fixes the error:
  MCP error -32001: GitHubIndexerClass is not a constructor

Changes:
- Changed from 'import type' to named import for GitHubIndexer class
- Removed dynamic import() call
- Now uses direct instantiation with 'new GitHubIndexer()'
- Consistent with status-adapter.ts implementation
@prosdev prosdev merged commit a904a0f into main Nov 25, 2025
1 check passed
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