Development Setup¶
Set up your local development environment for contributing to GitHub to MCP.
Prerequisites¶
Clone and Install¶
# Clone the repository
git clone https://github.com/nirholas/github-to-mcp
cd github-to-mcp
# Install dependencies
pnpm install
Project Structure¶
github-to-mcp/
├── apps/
│ ├── web/ # Next.js web application
│ ├── docs/ # Documentation (Nextra)
│ └── vscode/ # VS Code extension
├── packages/
│ ├── core/ # Core conversion library
│ ├── openapi-parser/ # OpenAPI/GraphQL parser
│ └── mcp-server/ # MCP server implementation
├── mkdocs/ # MkDocs documentation
├── tests/ # Integration tests
└── templates/ # Code generation templates
Development Commands¶
Build All Packages¶
Build Specific Package¶
Run Development Server¶
Run Tests¶
Lint and Format¶
Package Development¶
Core Package¶
The main conversion library:
Key files: - src/index.ts - Public API - src/generator.ts - Main generator - src/extractors/ - Tool extraction - src/github/ - GitHub API client
OpenAPI Parser¶
Parse OpenAPI and GraphQL specs:
Key files: - src/openapi.ts - OpenAPI parser - src/graphql.ts - GraphQL parser - src/utils.ts - Shared utilities
MCP Server¶
MCP server implementation:
Key files: - src/server.ts - Server class - src/transport/ - Transport implementations - src/tools/ - Tool registration
Web App Development¶
Key directories: - app/ - Next.js app router pages - components/ - React components - lib/ - Utilities and helpers
Environment Setup¶
Create .env.local in the root:
# Optional: For testing with private repos
GITHUB_TOKEN=ghp_xxxxx
# Optional: For enhanced extraction
OPENAI_API_KEY=sk-xxxxx
IDE Setup¶
VS Code¶
Install recommended extensions: - ESLint - Prettier - TypeScript
The project includes .vscode/settings.json for automatic formatting.
Debugging¶
Launch configurations are provided in .vscode/launch.json:
- Open VS Code
- Go to Run and Debug (Cmd+Shift+D)
- Select a configuration
- Press F5
Common Tasks¶
Add a New Dependency¶
# Root workspace
pnpm add -w <package>
# Specific package
pnpm --filter @nirholas/github-to-mcp add <package>
Create a Changeset¶
For version management:
Link Local Packages¶
For testing locally:
Troubleshooting¶
Build Errors¶
Test Failures¶
Type Errors¶
Next Steps¶
- Architecture - Understand the codebase
- Testing - Write tests
- Contributing Guide - Contribution guidelines