github-to-mcp-monorepo 1.0.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/.env.example +8 -0
- package/.github/CODEOWNERS +6 -0
- package/.husky/pre-commit +1 -0
- package/.nvmrc +1 -0
- package/.prettierignore +5 -0
- package/.prettierrc +7 -0
- package/.vscode/settings.json +4 -0
- package/ARCHITECTURE.md +1429 -0
- package/CHANGELOG.md +167 -0
- package/CONTRIBUTING.md +327 -0
- package/LICENSE +201 -0
- package/README.md +1028 -0
- package/SECURITY.md +248 -0
- package/VISUAL_GUIDE.md +437 -0
- package/apps/vscode/IMPLEMENTATION.md +480 -0
- package/apps/vscode/README.md +248 -0
- package/apps/vscode/package.json +381 -0
- package/apps/vscode/resources/icon.png +0 -0
- package/apps/vscode/resources/icon.svg +5 -0
- package/apps/vscode/src/commands/browseRegistry.ts +211 -0
- package/apps/vscode/src/commands/configureClaudeDesktop.ts +332 -0
- package/apps/vscode/src/commands/convert.ts +82 -0
- package/apps/vscode/src/commands/convertCurrentRepo.ts +109 -0
- package/apps/vscode/src/commands/convertFromUrl.ts +138 -0
- package/apps/vscode/src/commands/index.ts +121 -0
- package/apps/vscode/src/commands/validate.ts +197 -0
- package/apps/vscode/src/extension.ts +464 -0
- package/apps/vscode/src/global.d.ts +36 -0
- package/apps/vscode/src/test/extension.test.ts +73 -0
- package/apps/vscode/src/utils/file-generator.ts +529 -0
- package/apps/vscode/src/utils/github-api.ts +335 -0
- package/apps/vscode/src/utils/index.ts +29 -0
- package/apps/vscode/src/utils/mcp-config.ts +334 -0
- package/apps/vscode/src/utils/storage.ts +87 -0
- package/apps/vscode/src/views/McpServersTreeView.ts +160 -0
- package/apps/vscode/src/views/OutputChannelView.ts +195 -0
- package/apps/vscode/src/views/StatusBarItem.ts +251 -0
- package/apps/vscode/src/views/ToolsExplorerView.ts +314 -0
- package/apps/vscode/src/views/historyProvider.ts +75 -0
- package/apps/vscode/src/views/index.ts +12 -0
- package/apps/vscode/src/views/resultsPanel.ts +330 -0
- package/apps/vscode/src/webviews/ConversionPanel.ts +350 -0
- package/apps/vscode/src/webviews/ToolDetailsPanel.ts +448 -0
- package/apps/vscode/src/webviews/index.ts +9 -0
- package/apps/vscode/src/webviews/webview-ui/styles.ts +492 -0
- package/apps/vscode/tsconfig.json +20 -0
- package/apps/web/PLAYGROUND_GUIDE.md +499 -0
- package/apps/web/README.md +505 -0
- package/apps/web/app/api/convert/route.ts +100 -0
- package/apps/web/app/api/convert/stream/route.ts +198 -0
- package/apps/web/app/api/deploy/route.ts +157 -0
- package/apps/web/app/api/edge/route.ts +308 -0
- package/apps/web/app/api/export-docker/route.ts +284 -0
- package/apps/web/app/api/generate-openapi/route.ts +119 -0
- package/apps/web/app/api/mcp/[serverId]/route.ts +263 -0
- package/apps/web/app/api/playground/connect/route.ts +143 -0
- package/apps/web/app/api/playground/disconnect/route.ts +78 -0
- package/apps/web/app/api/playground/execute/route.ts +135 -0
- package/apps/web/app/api/playground/sessions/route.ts +103 -0
- package/apps/web/app/api/playground/tools/route.ts +117 -0
- package/apps/web/app/api/playground/v2/connect/route.ts +96 -0
- package/apps/web/app/api/playground/v2/disconnect/route.ts +88 -0
- package/apps/web/app/api/playground/v2/health/route.ts +80 -0
- package/apps/web/app/api/playground/v2/prompts/route.ts +160 -0
- package/apps/web/app/api/playground/v2/resources/route.ts +159 -0
- package/apps/web/app/api/playground/v2/sessions/route.ts +184 -0
- package/apps/web/app/api/playground/v2/tools/route.ts +167 -0
- package/apps/web/app/api/stream/route.ts +232 -0
- package/apps/web/app/batch/BatchConvertClient.tsx +190 -0
- package/apps/web/app/batch/page.tsx +37 -0
- package/apps/web/app/convert/page.tsx +269 -0
- package/apps/web/app/dashboard/page.tsx +380 -0
- package/apps/web/app/globals.css +622 -0
- package/apps/web/app/layout.tsx +120 -0
- package/apps/web/app/manifest.ts +31 -0
- package/apps/web/app/opengraph-image.tsx +112 -0
- package/apps/web/app/page.old.tsx +924 -0
- package/apps/web/app/page.tsx +77 -0
- package/apps/web/app/playground/page.tsx +306 -0
- package/apps/web/app/playground/v2/error.tsx +163 -0
- package/apps/web/app/playground/v2/layout.tsx +58 -0
- package/apps/web/app/playground/v2/loading.tsx +152 -0
- package/apps/web/app/playground/v2/page.tsx +644 -0
- package/apps/web/app/playground/v2/providers.tsx +214 -0
- package/apps/web/app/playground/v2/use-shortcuts.ts +209 -0
- package/apps/web/app/playground/v2/use-url-state.ts +296 -0
- package/apps/web/app/providers.tsx +22 -0
- package/apps/web/app/sitemap.ts +32 -0
- package/apps/web/app/twitter-image.tsx +112 -0
- package/apps/web/components/BranchSelector.tsx +401 -0
- package/apps/web/components/ClaudeConfigExport.tsx +226 -0
- package/apps/web/components/Features.tsx +84 -0
- package/apps/web/components/Footer.tsx +119 -0
- package/apps/web/components/GenerationProgress.tsx +248 -0
- package/apps/web/components/GithubUrlInput.tsx +483 -0
- package/apps/web/components/Header.tsx +175 -0
- package/apps/web/components/Hero.tsx +117 -0
- package/apps/web/components/HowItWorks.tsx +119 -0
- package/apps/web/components/InstallBanner.tsx +158 -0
- package/apps/web/components/Logo.tsx +116 -0
- package/apps/web/components/ParticleBackground.tsx +105 -0
- package/apps/web/components/Playground.tsx +472 -0
- package/apps/web/components/PlaygroundToolTester.tsx +410 -0
- package/apps/web/components/ProductCards.tsx +179 -0
- package/apps/web/components/SplitView.tsx +194 -0
- package/apps/web/components/ToolFilter.tsx +260 -0
- package/apps/web/components/ToolList.tsx +325 -0
- package/apps/web/components/batch/BatchConvert.tsx +785 -0
- package/apps/web/components/batch/index.ts +7 -0
- package/apps/web/components/convert/ConfigTabs.tsx +230 -0
- package/apps/web/components/convert/ConversionResult.tsx +482 -0
- package/apps/web/components/convert/InlinePlayground.tsx +259 -0
- package/apps/web/components/convert/LoadingSteps.tsx +311 -0
- package/apps/web/components/convert/OneClickInstall.tsx +224 -0
- package/apps/web/components/convert/ToolCard.tsx +189 -0
- package/apps/web/components/convert/TryInPlayground.tsx +242 -0
- package/apps/web/components/convert/index.ts +12 -0
- package/apps/web/components/deploy/DeployButton.tsx +369 -0
- package/apps/web/components/deploy/index.ts +7 -0
- package/apps/web/components/docker/DockerExport.tsx +690 -0
- package/apps/web/components/docker/index.ts +7 -0
- package/apps/web/components/install/OneClickInstall.tsx +676 -0
- package/apps/web/components/install/index.ts +7 -0
- package/apps/web/components/playground/CapabilityTabs.tsx +150 -0
- package/apps/web/components/playground/ConnectionStatusV2.tsx +322 -0
- package/apps/web/components/playground/EmptyStates.tsx +305 -0
- package/apps/web/components/playground/ExecutionLog.tsx +260 -0
- package/apps/web/components/playground/ExecutionLogV2.tsx +378 -0
- package/apps/web/components/playground/JsonViewer.tsx +388 -0
- package/apps/web/components/playground/PlaygroundLayout.tsx +244 -0
- package/apps/web/components/playground/PromptsPanel.tsx +385 -0
- package/apps/web/components/playground/ResourcesPanel.tsx +378 -0
- package/apps/web/components/playground/SchemaForm.tsx +477 -0
- package/apps/web/components/playground/ServerStatus.tsx +151 -0
- package/apps/web/components/playground/ShareButton.tsx +239 -0
- package/apps/web/components/playground/ToolsPanel.tsx +309 -0
- package/apps/web/components/playground/TransportConfigurator.tsx +563 -0
- package/apps/web/components/playground/index.ts +74 -0
- package/apps/web/components/playground/types.ts +202 -0
- package/apps/web/components/streaming/StreamingProgress.tsx +441 -0
- package/apps/web/components/streaming/index.ts +7 -0
- package/apps/web/components/ui/badge.tsx +42 -0
- package/apps/web/components/ui/button.tsx +88 -0
- package/apps/web/components/ui/card.tsx +75 -0
- package/apps/web/components/ui/code-block.tsx +122 -0
- package/apps/web/components/ui/index.ts +12 -0
- package/apps/web/components/ui/input.tsx +55 -0
- package/apps/web/components/ui/tabs.tsx +61 -0
- package/apps/web/hooks/index.ts +85 -0
- package/apps/web/hooks/types.ts +1173 -0
- package/apps/web/hooks/use-conversion.ts +133 -0
- package/apps/web/hooks/use-execution-history.ts +376 -0
- package/apps/web/hooks/use-generation-progress.ts +147 -0
- package/apps/web/hooks/use-local-storage.ts +88 -0
- package/apps/web/hooks/use-mcp-client.ts +623 -0
- package/apps/web/hooks/use-mcp-connection.ts +500 -0
- package/apps/web/hooks/use-mcp-execution.ts +282 -0
- package/apps/web/hooks/use-mcp-prompts.ts +441 -0
- package/apps/web/hooks/use-mcp-resources.ts +430 -0
- package/apps/web/hooks/use-mcp-tools.ts +540 -0
- package/apps/web/hooks/use-playground-store.ts +299 -0
- package/apps/web/hooks/use-playground.ts +184 -0
- package/apps/web/hooks/use-streaming-conversion.ts +227 -0
- package/apps/web/hooks/useBatchConversion.ts +271 -0
- package/apps/web/hooks/useDockerConfig.ts +161 -0
- package/apps/web/hooks/usePlatformDetection.ts +80 -0
- package/apps/web/hooks/useStreaming.ts +199 -0
- package/apps/web/lib/api/errors.ts +386 -0
- package/apps/web/lib/api/index.ts +137 -0
- package/apps/web/lib/api/logger.ts +187 -0
- package/apps/web/lib/api/middleware.ts +364 -0
- package/apps/web/lib/api/openapi.ts +977 -0
- package/apps/web/lib/api/session-manager.ts +594 -0
- package/apps/web/lib/api/types.ts +433 -0
- package/apps/web/lib/api/validation.ts +523 -0
- package/apps/web/lib/constants.ts +114 -0
- package/apps/web/lib/mcp/client.ts +1137 -0
- package/apps/web/lib/mcp/events.ts +651 -0
- package/apps/web/lib/mcp/index.ts +347 -0
- package/apps/web/lib/mcp/logger.ts +428 -0
- package/apps/web/lib/mcp/metrics.ts +703 -0
- package/apps/web/lib/mcp/retry.ts +616 -0
- package/apps/web/lib/mcp/session-manager.ts +779 -0
- package/apps/web/lib/mcp/transports.ts +988 -0
- package/apps/web/lib/mcp/types.ts +594 -0
- package/apps/web/lib/mcp-client-enhanced.ts +871 -0
- package/apps/web/lib/mcp-client.ts +778 -0
- package/apps/web/lib/mcp-errors.ts +489 -0
- package/apps/web/lib/mcp-sandbox.ts +593 -0
- package/apps/web/lib/mcp-testing.ts +428 -0
- package/apps/web/lib/mcp-types.ts +448 -0
- package/apps/web/lib/playground-store.tsx +1147 -0
- package/apps/web/lib/utils.ts +439 -0
- package/apps/web/next-env.d.ts +5 -0
- package/apps/web/next.config.js +23 -0
- package/apps/web/package.json +55 -0
- package/apps/web/postcss.config.js +6 -0
- package/apps/web/public/.well-known/ai-plugin.json +17 -0
- package/apps/web/public/logo.svg +6 -0
- package/apps/web/public/robots.txt +22 -0
- package/apps/web/public/schema.json +27 -0
- package/apps/web/tailwind.config.js +26 -0
- package/apps/web/tailwind.config.ts +123 -0
- package/apps/web/tsconfig.json +20 -0
- package/apps/web/types/deploy.ts +139 -0
- package/apps/web/types/index.ts +247 -0
- package/apps/web/vercel.json +39 -0
- package/eslint.config.mjs +23 -0
- package/llms.txt +102 -0
- package/mkdocs/docs/api/core.md +318 -0
- package/mkdocs/docs/api/index.md +128 -0
- package/mkdocs/docs/api/mcp-server.md +301 -0
- package/mkdocs/docs/api/openapi-parser.md +254 -0
- package/mkdocs/docs/assets/logo.svg +7 -0
- package/mkdocs/docs/changelog.md +118 -0
- package/mkdocs/docs/cli/generate.md +148 -0
- package/mkdocs/docs/cli/index.md +52 -0
- package/mkdocs/docs/cli/inspect.md +164 -0
- package/mkdocs/docs/cli/serve.md +136 -0
- package/mkdocs/docs/concepts/classification.md +254 -0
- package/mkdocs/docs/concepts/how-it-works.md +299 -0
- package/mkdocs/docs/concepts/index.md +77 -0
- package/mkdocs/docs/concepts/mcp-protocol.md +362 -0
- package/mkdocs/docs/concepts/tool-types.md +382 -0
- package/mkdocs/docs/contributing/architecture.md +262 -0
- package/mkdocs/docs/contributing/development.md +245 -0
- package/mkdocs/docs/contributing/index.md +73 -0
- package/mkdocs/docs/contributing/testing.md +320 -0
- package/mkdocs/docs/getting-started/configuration.md +235 -0
- package/mkdocs/docs/getting-started/index.md +54 -0
- package/mkdocs/docs/getting-started/installation.md +145 -0
- package/mkdocs/docs/getting-started/quickstart.md +160 -0
- package/mkdocs/docs/guides/batch.md +375 -0
- package/mkdocs/docs/guides/claude-desktop.md +227 -0
- package/mkdocs/docs/guides/cursor.md +188 -0
- package/mkdocs/docs/guides/custom-tools.md +367 -0
- package/mkdocs/docs/guides/index.md +78 -0
- package/mkdocs/docs/guides/private-repos.md +221 -0
- package/mkdocs/docs/guides/vscode.md +247 -0
- package/mkdocs/docs/index.md +175 -0
- package/mkdocs/docs/reference/config.md +223 -0
- package/mkdocs/docs/reference/env.md +192 -0
- package/mkdocs/docs/reference/index.md +102 -0
- package/mkdocs/docs/reference/tools.md +309 -0
- package/mkdocs/docs/stylesheets/extra.css +231 -0
- package/mkdocs/mkdocs.yml +204 -0
- package/mkdocs/overrides/.gitkeep +1 -0
- package/mkdocs/overrides/main.html +7 -0
- package/mkdocs/python-deps.txt +7 -0
- package/mkdocs/vercel.json +11 -0
- package/package.json +63 -0
- package/packages/core/package.json +61 -0
- package/packages/core/src/__tests__/bitbucket-client.test.ts +366 -0
- package/packages/core/src/__tests__/cli.test.ts +235 -0
- package/packages/core/src/__tests__/code-extractor.test.ts +378 -0
- package/packages/core/src/__tests__/docker-generator.test.ts +255 -0
- package/packages/core/src/__tests__/github-client.test.ts +390 -0
- package/packages/core/src/__tests__/gitlab-client.test.ts +319 -0
- package/packages/core/src/__tests__/go-extractor.test.ts +351 -0
- package/packages/core/src/__tests__/graphql-extractor.test.ts +330 -0
- package/packages/core/src/__tests__/java-extractor.test.ts +497 -0
- package/packages/core/src/__tests__/plugins.test.ts +467 -0
- package/packages/core/src/__tests__/readme-extractor.test.ts +258 -0
- package/packages/core/src/__tests__/redis-cache.test.ts +307 -0
- package/packages/core/src/__tests__/rust-extractor.test.ts +252 -0
- package/packages/core/src/__tests__/streaming.test.ts +251 -0
- package/packages/core/src/additional-extractors.ts +333 -0
- package/packages/core/src/cache/cache-interface.ts +179 -0
- package/packages/core/src/cache/index.ts +210 -0
- package/packages/core/src/cache/redis-cache.ts +291 -0
- package/packages/core/src/cache/upstash-cache.ts +379 -0
- package/packages/core/src/cache.ts +251 -0
- package/packages/core/src/cli.ts +822 -0
- package/packages/core/src/code-extractor.ts +696 -0
- package/packages/core/src/docker-generator.ts +470 -0
- package/packages/core/src/edge-compatible.ts +491 -0
- package/packages/core/src/extractors/go-extractor.ts +791 -0
- package/packages/core/src/extractors/index.ts +9 -0
- package/packages/core/src/extractors/java-extractor.ts +937 -0
- package/packages/core/src/extractors/rust-extractor.ts +744 -0
- package/packages/core/src/github-client.ts +319 -0
- package/packages/core/src/go-generator.ts +356 -0
- package/packages/core/src/graphql-extractor.ts +358 -0
- package/packages/core/src/index.ts +797 -0
- package/packages/core/src/langchain-exporter.ts +617 -0
- package/packages/core/src/language-parsers.ts +1114 -0
- package/packages/core/src/mcp-introspector.ts +279 -0
- package/packages/core/src/monorepo-detector.ts +378 -0
- package/packages/core/src/plugins/index.ts +370 -0
- package/packages/core/src/plugins/registry.ts +404 -0
- package/packages/core/src/plugins/types.ts +215 -0
- package/packages/core/src/providers/base-provider.ts +246 -0
- package/packages/core/src/providers/bitbucket-client.ts +464 -0
- package/packages/core/src/providers/gitlab-client.ts +388 -0
- package/packages/core/src/providers/index.ts +176 -0
- package/packages/core/src/python-generator.ts +260 -0
- package/packages/core/src/queue/index.ts +100 -0
- package/packages/core/src/queue/memory-queue.ts +445 -0
- package/packages/core/src/queue/redis-queue.ts +578 -0
- package/packages/core/src/queue/types.ts +251 -0
- package/packages/core/src/readme-extractor.ts +409 -0
- package/packages/core/src/schema-generator.ts +638 -0
- package/packages/core/src/streaming.ts +999 -0
- package/packages/core/src/types.ts +289 -0
- package/packages/core/tsconfig.json +9 -0
- package/packages/core/tsup.config.ts +25 -0
- package/packages/mcp-server/README.md +297 -0
- package/packages/mcp-server/package.json +55 -0
- package/packages/mcp-server/src/__tests__/mcp-server.test.ts +177 -0
- package/packages/mcp-server/src/__tests__/tools.test.ts +217 -0
- package/packages/mcp-server/src/index.ts +1206 -0
- package/packages/mcp-server/src/prompts/index.ts +601 -0
- package/packages/mcp-server/src/tools/export-docker.ts +362 -0
- package/packages/mcp-server/src/tools/generate-openapi.ts +162 -0
- package/packages/mcp-server/src/tools/monitor-mcp-server.ts +448 -0
- package/packages/mcp-server/src/tools/stream-convert.ts +398 -0
- package/packages/mcp-server/src/tools/test-mcp-tool.ts +531 -0
- package/packages/mcp-server/tsconfig.json +12 -0
- package/packages/mcp-server/tsup.config.ts +14 -0
- package/packages/openapi-parser/package-lock.json +3028 -0
- package/packages/openapi-parser/package.json +41 -0
- package/packages/openapi-parser/src/analyzer.ts +700 -0
- package/packages/openapi-parser/src/asyncapi-parser.ts +475 -0
- package/packages/openapi-parser/src/cli.ts +302 -0
- package/packages/openapi-parser/src/generator.ts +570 -0
- package/packages/openapi-parser/src/generators/express-analyzer.ts +649 -0
- package/packages/openapi-parser/src/generators/fastapi-analyzer.ts +960 -0
- package/packages/openapi-parser/src/generators/index.ts +200 -0
- package/packages/openapi-parser/src/generators/nextjs-analyzer.ts +768 -0
- package/packages/openapi-parser/src/generators/openapi-builder.ts +527 -0
- package/packages/openapi-parser/src/generators/types.ts +298 -0
- package/packages/openapi-parser/src/graphql-parser.ts +462 -0
- package/packages/openapi-parser/src/grpc-parser.ts +649 -0
- package/packages/openapi-parser/src/har-parser.ts +723 -0
- package/packages/openapi-parser/src/index.ts +635 -0
- package/packages/openapi-parser/src/insomnia-parser.ts +614 -0
- package/packages/openapi-parser/src/parser.ts +231 -0
- package/packages/openapi-parser/src/postman-parser.ts +611 -0
- package/packages/openapi-parser/src/ref-resolver.ts +313 -0
- package/packages/openapi-parser/src/transformer.ts +459 -0
- package/packages/openapi-parser/tests/generators/express.test.ts +209 -0
- package/packages/openapi-parser/tests/generators/fastapi.test.ts +236 -0
- package/packages/openapi-parser/tests/generators/nextjs.test.ts +273 -0
- package/packages/openapi-parser/tests/parsers.test.ts +847 -0
- package/packages/openapi-parser/tsconfig.json +9 -0
- package/packages/openapi-parser/tsup.config.ts +11 -0
- package/packages/registry/package.json +59 -0
- package/packages/registry/src/cli.ts +456 -0
- package/packages/registry/src/index.ts +44 -0
- package/packages/registry/src/popular/github.json +47 -0
- package/packages/registry/src/popular/index.ts +55 -0
- package/packages/registry/src/popular/linear.json +42 -0
- package/packages/registry/src/popular/notion.json +42 -0
- package/packages/registry/src/popular/openai.json +40 -0
- package/packages/registry/src/popular/resend.json +38 -0
- package/packages/registry/src/popular/slack.json +42 -0
- package/packages/registry/src/popular/stripe.json +163 -0
- package/packages/registry/src/popular/supabase.json +42 -0
- package/packages/registry/src/popular/twilio.json +40 -0
- package/packages/registry/src/popular/vercel.json +40 -0
- package/packages/registry/src/registry.ts +492 -0
- package/packages/registry/src/storage.ts +334 -0
- package/packages/registry/src/types.ts +275 -0
- package/packages/registry/src/updater.ts +208 -0
- package/packages/registry/tsconfig.json +10 -0
- package/packages/registry/tsup.config.ts +11 -0
- package/pnpm-workspace.yaml +3 -0
- package/scripts/build-docs.sh +16 -0
- package/server.json +9 -0
- package/templates/Dockerfile.python.template +60 -0
- package/templates/Dockerfile.typescript.template +60 -0
- package/templates/docker-compose.template.yml +68 -0
- package/tests/fixtures/express-app/index.js +34 -0
- package/tests/fixtures/express-app/routes/posts.js +43 -0
- package/tests/fixtures/express-app/routes/users.js +58 -0
- package/tests/fixtures/fastapi-app/main.py +125 -0
- package/tests/fixtures/fastapi-app/routes/admin.py +42 -0
- package/tests/fixtures/graphql/simple-schema.graphql +65 -0
- package/tests/fixtures/mocks/github-api-responses.json +63 -0
- package/tests/fixtures/nextjs-app/app/api/posts/route.ts +55 -0
- package/tests/fixtures/nextjs-app/app/api/users/[id]/route.ts +63 -0
- package/tests/fixtures/nextjs-app/app/api/users/route.ts +44 -0
- package/tests/fixtures/nextjs-app/pages/api/health.ts +28 -0
- package/tests/fixtures/openapi/petstore.yaml +179 -0
- package/tests/integration/langchain-export.test.ts +405 -0
- package/tests/integration/openapi-conversion.test.ts +221 -0
- package/tsconfig.json +18 -0
- package/vitest.config.ts +32 -0
package/ARCHITECTURE.md
ADDED
|
@@ -0,0 +1,1429 @@
|
|
|
1
|
+
# GitHub to MCP - Complete Architecture Documentation
|
|
2
|
+
|
|
3
|
+
> **Last Updated**: January 17, 2026
|
|
4
|
+
> **Version**: 1.0.0
|
|
5
|
+
> **Maintained by**: nirholas
|
|
6
|
+
|
|
7
|
+
## 📖 Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Overview](#overview)
|
|
10
|
+
- [Project Structure](#project-structure)
|
|
11
|
+
- [Core Architecture](#core-architecture)
|
|
12
|
+
- [Packages](#packages)
|
|
13
|
+
- [Web Application](#web-application)
|
|
14
|
+
- [Data Flow](#data-flow)
|
|
15
|
+
- [API Reference](#api-reference)
|
|
16
|
+
- [Component Reference](#component-reference)
|
|
17
|
+
- [Development Guide](#development-guide)
|
|
18
|
+
- [Deployment](#deployment)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
**GitHub to MCP** is a monorepo project that converts any GitHub repository into a Model Context Protocol (MCP) server. It provides multiple interfaces:
|
|
25
|
+
|
|
26
|
+
- **Web UI**: Next.js application for browser-based conversion
|
|
27
|
+
- **CLI**: Command-line tool for terminal usage
|
|
28
|
+
- **Programmatic API**: TypeScript/JavaScript library
|
|
29
|
+
- **MCP Server**: Exposes conversion as MCP tools
|
|
30
|
+
|
|
31
|
+
### Technology Stack
|
|
32
|
+
|
|
33
|
+
| Layer | Technologies |
|
|
34
|
+
|-------|-------------|
|
|
35
|
+
| **Frontend** | Next.js 14, React 18, TypeScript, Tailwind CSS, Framer Motion |
|
|
36
|
+
| **Backend Core** | Node.js, TypeScript, Octokit (GitHub API) |
|
|
37
|
+
| **Parsers** | OpenAPI Parser, GraphQL Parser, AST Parsers |
|
|
38
|
+
| **Build System** | pnpm workspaces, tsup, Next.js |
|
|
39
|
+
| **Testing** | Vitest, React Testing Library |
|
|
40
|
+
| **Deployment** | Vercel (Web), npm (CLI/Packages) |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Project Structure
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
github-to-mcp/
|
|
48
|
+
├── 📁 apps/ # Applications
|
|
49
|
+
│ ├── web/ # Next.js web application
|
|
50
|
+
│ ├── docs/ # Documentation site
|
|
51
|
+
│ └── vscode/ # VS Code extension
|
|
52
|
+
│
|
|
53
|
+
├── 📁 packages/ # Shared packages
|
|
54
|
+
│ ├── core/ # Core conversion engine
|
|
55
|
+
│ ├── openapi-parser/ # OpenAPI/GraphQL parser
|
|
56
|
+
│ └── mcp-server/ # MCP server implementation
|
|
57
|
+
│
|
|
58
|
+
├── 📁 tests/ # Integration tests
|
|
59
|
+
│ └── fixtures/ # Test fixtures
|
|
60
|
+
│
|
|
61
|
+
├── 📁 templates/ # Code generation templates
|
|
62
|
+
│
|
|
63
|
+
├── 📄 pnpm-workspace.yaml # pnpm workspace configuration
|
|
64
|
+
├── 📄 package.json # Root package.json
|
|
65
|
+
├── 📄 tsconfig.json # TypeScript base config
|
|
66
|
+
└── 📄 vitest.config.ts # Test configuration
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Core Architecture
|
|
72
|
+
|
|
73
|
+
### High-Level Flow
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
77
|
+
│ User Input (GitHub URL) │
|
|
78
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
79
|
+
↓
|
|
80
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
81
|
+
│ GithubToMcpGenerator (packages/core) │
|
|
82
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
83
|
+
│ │ 1. Fetch Repository │ │
|
|
84
|
+
│ │ - GithubClient: Fetch metadata, README, files │ │
|
|
85
|
+
│ │ - Caching: Redis/Upstash for rate limit management │ │
|
|
86
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
87
|
+
│ ↓ │
|
|
88
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
89
|
+
│ │ 2. Classify Repository │ │
|
|
90
|
+
│ │ - Analyze README and package.json │ │
|
|
91
|
+
│ │ - Determine: mcp-server | api-sdk | cli-tool | │ │
|
|
92
|
+
│ │ library | documentation | data | unknown │ │
|
|
93
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
94
|
+
│ ↓ │
|
|
95
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
96
|
+
│ │ 3. Extract Tools from Multiple Sources │ │
|
|
97
|
+
│ │ ┌─────────────────────────────────────────────────┐ │ │
|
|
98
|
+
│ │ │ OpenAPI/Swagger Specs │ │ │
|
|
99
|
+
│ │ │ - Find openapi.json, swagger.yaml │ │ │
|
|
100
|
+
│ │ │ - Parse endpoints → MCP tools │ │ │
|
|
101
|
+
│ │ └─────────────────────────────────────────────────┘ │ │
|
|
102
|
+
│ │ ┌─────────────────────────────────────────────────┐ │ │
|
|
103
|
+
│ │ │ GraphQL Schemas │ │ │
|
|
104
|
+
│ │ │ - Find schema.graphql, .gql files │ │ │
|
|
105
|
+
│ │ │ - Parse queries/mutations → MCP tools │ │ │
|
|
106
|
+
│ │ └─────────────────────────────────────────────────┘ │ │
|
|
107
|
+
│ │ ┌─────────────────────────────────────────────────┐ │ │
|
|
108
|
+
│ │ │ README Documentation │ │ │
|
|
109
|
+
│ │ │ - Extract CLI commands, API examples │ │ │
|
|
110
|
+
│ │ │ - Parse code blocks → MCP tools │ │ │
|
|
111
|
+
│ │ └─────────────────────────────────────────────────┘ │ │
|
|
112
|
+
│ │ ┌─────────────────────────────────────────────────┐ │ │
|
|
113
|
+
│ │ │ Source Code Analysis │ │ │
|
|
114
|
+
│ │ │ - Python: @mcp.tool decorators │ │ │
|
|
115
|
+
│ │ │ - TypeScript: function exports │ │ │
|
|
116
|
+
│ │ │ - Rust/Go/Java: annotated functions │ │ │
|
|
117
|
+
│ │ └─────────────────────────────────────────────────┘ │ │
|
|
118
|
+
│ │ ┌─────────────────────────────────────────────────┐ │ │
|
|
119
|
+
│ │ │ MCP Server Introspection │ │ │
|
|
120
|
+
│ │ │ - Detect existing MCP servers │ │ │
|
|
121
|
+
│ │ │ - Extract tool definitions │ │ │
|
|
122
|
+
│ │ └─────────────────────────────────────────────────┘ │ │
|
|
123
|
+
│ │ ┌─────────────────────────────────────────────────┐ │ │
|
|
124
|
+
│ │ │ Universal Tools (always included) │ │ │
|
|
125
|
+
│ │ │ - read_file, list_files, search_code, get_readme│ │ │
|
|
126
|
+
│ │ └─────────────────────────────────────────────────┘ │ │
|
|
127
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
128
|
+
│ ↓ │
|
|
129
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
130
|
+
│ │ 4. Deduplicate & Validate Tools │ │
|
|
131
|
+
│ │ - Remove duplicate tools by name │ │
|
|
132
|
+
│ │ - Validate input schemas │ │
|
|
133
|
+
│ │ - Calculate confidence scores │ │
|
|
134
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
135
|
+
│ ↓ │
|
|
136
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
137
|
+
│ │ 5. Generate MCP Server Code │ │
|
|
138
|
+
│ │ - TypeScript: Full MCP server with SDK │ │
|
|
139
|
+
│ │ - Python: Flask/FastAPI-based MCP server │ │
|
|
140
|
+
│ │ - Generate configs: Claude, Cursor, OpenAI │ │
|
|
141
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
142
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
143
|
+
↓
|
|
144
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
145
|
+
│ Output (Multiple Formats) │
|
|
146
|
+
│ - TypeScript MCP Server │
|
|
147
|
+
│ - Python MCP Server │
|
|
148
|
+
│ - Configuration files (JSON) │
|
|
149
|
+
│ - Docker deployment files │
|
|
150
|
+
│ - OpenAPI specification │
|
|
151
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Key Design Principles
|
|
155
|
+
|
|
156
|
+
1. **Plugin Architecture**: Extractors are modular and extensible
|
|
157
|
+
2. **Multi-Source**: Extract from docs, specs, and code simultaneously
|
|
158
|
+
3. **Language-Agnostic**: Works with any language GitHub repo
|
|
159
|
+
4. **Caching**: Aggressive caching to respect GitHub rate limits
|
|
160
|
+
5. **Progressive Enhancement**: Universal tools + smart extraction
|
|
161
|
+
6. **Type Safety**: Full TypeScript throughout codebase
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Packages
|
|
166
|
+
|
|
167
|
+
### 1. `@nirholas/github-to-mcp` (packages/core)
|
|
168
|
+
|
|
169
|
+
**Purpose**: Core conversion engine and CLI
|
|
170
|
+
|
|
171
|
+
#### Key Files
|
|
172
|
+
|
|
173
|
+
| File | Purpose |
|
|
174
|
+
|------|---------|
|
|
175
|
+
| `src/index.ts` | Main generator class and exports |
|
|
176
|
+
| `src/github-client.ts` | GitHub API client with caching |
|
|
177
|
+
| `src/readme-extractor.ts` | Extract tools from README |
|
|
178
|
+
| `src/code-extractor.ts` | AST-based code analysis |
|
|
179
|
+
| `src/graphql-extractor.ts` | GraphQL schema parser |
|
|
180
|
+
| `src/mcp-introspector.ts` | MCP server detection |
|
|
181
|
+
| `src/python-generator.ts` | Python code generation |
|
|
182
|
+
| `src/docker-generator.ts` | Dockerfile generation |
|
|
183
|
+
| `src/cli.ts` | Command-line interface |
|
|
184
|
+
| `src/types.ts` | TypeScript type definitions |
|
|
185
|
+
|
|
186
|
+
#### Main Class: `GithubToMcpGenerator`
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
class GithubToMcpGenerator {
|
|
190
|
+
constructor(options: GithubToMcpOptions)
|
|
191
|
+
|
|
192
|
+
async generate(githubUrl: string): Promise<GenerationResult>
|
|
193
|
+
|
|
194
|
+
// Private methods
|
|
195
|
+
private async classifyRepo()
|
|
196
|
+
private async extractFromOpenApi()
|
|
197
|
+
private async extractFromReadme()
|
|
198
|
+
private async extractFromCode()
|
|
199
|
+
private async extractFromGraphQL()
|
|
200
|
+
private async introspectMcpServer()
|
|
201
|
+
private generateUniversalTools()
|
|
202
|
+
private deduplicateTools()
|
|
203
|
+
private async generateCode()
|
|
204
|
+
private async saveToFiles()
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
#### Tool Extraction Pipeline
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
// 1. OpenAPI Extraction
|
|
212
|
+
const openapiTools = await extractFromOpenApi(owner, repo);
|
|
213
|
+
// Finds: openapi.json, swagger.yaml, api-spec.yaml
|
|
214
|
+
// Converts: Each endpoint → MCP tool with typed params
|
|
215
|
+
|
|
216
|
+
// 2. README Extraction
|
|
217
|
+
const readmeTools = await extractFromReadme(owner, repo);
|
|
218
|
+
// Finds: CLI commands, API examples, usage patterns
|
|
219
|
+
// Converts: Code blocks → MCP tools
|
|
220
|
+
|
|
221
|
+
// 3. Code Extraction
|
|
222
|
+
const codeTools = await extractFromCode(owner, repo);
|
|
223
|
+
// Finds: @mcp.tool, exported functions, decorators
|
|
224
|
+
// Supports: Python, TypeScript, Rust, Go, Java
|
|
225
|
+
|
|
226
|
+
// 4. GraphQL Extraction
|
|
227
|
+
const graphqlTools = await extractFromGraphQL(owner, repo);
|
|
228
|
+
// Finds: schema.graphql, .gql files
|
|
229
|
+
// Converts: Queries/Mutations → MCP tools
|
|
230
|
+
|
|
231
|
+
// 5. MCP Introspection
|
|
232
|
+
const mcpTools = await introspectMcpServer(owner, repo);
|
|
233
|
+
// Detects existing MCP servers
|
|
234
|
+
// Extracts registered tools
|
|
235
|
+
|
|
236
|
+
// 6. Universal Tools (Always Added)
|
|
237
|
+
const universalTools = generateUniversalTools();
|
|
238
|
+
// Adds: read_file, list_files, search_code, get_readme
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Configuration Options
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
interface GithubToMcpOptions {
|
|
245
|
+
// Sources to extract from
|
|
246
|
+
sources?: ('readme' | 'openapi' | 'graphql' | 'code')[];
|
|
247
|
+
|
|
248
|
+
// Output language
|
|
249
|
+
outputLanguage?: 'typescript' | 'python';
|
|
250
|
+
|
|
251
|
+
// Naming conventions
|
|
252
|
+
naming?: {
|
|
253
|
+
prefix?: string;
|
|
254
|
+
suffix?: string;
|
|
255
|
+
style?: 'camelCase' | 'snake_case' | 'kebab-case';
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// GitHub authentication
|
|
259
|
+
githubToken?: string;
|
|
260
|
+
|
|
261
|
+
// Caching options
|
|
262
|
+
cache?: boolean;
|
|
263
|
+
cacheDir?: string;
|
|
264
|
+
cacheTTL?: {
|
|
265
|
+
metadata?: number; // Default: 3600s
|
|
266
|
+
files?: number; // Default: 900s
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
// Rate limiting
|
|
270
|
+
rateLimit?: {
|
|
271
|
+
maxRequests: number;
|
|
272
|
+
perSeconds: number;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Generation Result
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
interface GenerationResult {
|
|
281
|
+
repo: string;
|
|
282
|
+
name: string;
|
|
283
|
+
tools: ExtractedTool[];
|
|
284
|
+
sources: SourceBreakdown[];
|
|
285
|
+
classification: RepoClassification;
|
|
286
|
+
metadata: RepositoryMetadata;
|
|
287
|
+
|
|
288
|
+
// Generation methods
|
|
289
|
+
generate(): string; // TypeScript code
|
|
290
|
+
generatePython(): string; // Python code
|
|
291
|
+
save(outputDir: string): Promise<void>;
|
|
292
|
+
download(): Buffer; // Zip file
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### 2. `@github-to-mcp/openapi-parser` (packages/openapi-parser)
|
|
297
|
+
|
|
298
|
+
**Purpose**: Multi-format API specification parser
|
|
299
|
+
|
|
300
|
+
#### Supported Formats
|
|
301
|
+
|
|
302
|
+
- **OpenAPI** 2.0, 3.0, 3.1
|
|
303
|
+
- **AsyncAPI** 2.x, 3.x
|
|
304
|
+
- **GraphQL** Schema Definition Language
|
|
305
|
+
- **Postman** Collections
|
|
306
|
+
- **Insomnia** Workspaces
|
|
307
|
+
- **HAR** (HTTP Archive)
|
|
308
|
+
|
|
309
|
+
#### Key Files
|
|
310
|
+
|
|
311
|
+
| File | Purpose |
|
|
312
|
+
|------|---------|
|
|
313
|
+
| `src/parser.ts` | OpenAPI spec parsing |
|
|
314
|
+
| `src/analyzer.ts` | Endpoint analysis |
|
|
315
|
+
| `src/transformer.ts` | OpenAPI → MCP conversion |
|
|
316
|
+
| `src/generator.ts` | Code generation |
|
|
317
|
+
| `src/ref-resolver.ts` | $ref resolution |
|
|
318
|
+
| `src/graphql-parser.ts` | GraphQL parsing |
|
|
319
|
+
| `src/postman-parser.ts` | Postman parsing |
|
|
320
|
+
| `src/asyncapi-parser.ts` | AsyncAPI parsing |
|
|
321
|
+
| `src/generators/` | Framework-specific generators |
|
|
322
|
+
|
|
323
|
+
#### Main Class: `OpenApiToMcp`
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
class OpenApiToMcp {
|
|
327
|
+
constructor(config: ConverterConfig)
|
|
328
|
+
|
|
329
|
+
async convert(): Promise<ConversionStats>
|
|
330
|
+
async getMcpTools(): Promise<McpToolDefinition[]>
|
|
331
|
+
async generateCode(format: 'typescript' | 'python'): Promise<string>
|
|
332
|
+
async save(): Promise<void>
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### Framework Analyzers
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
// Express.js
|
|
340
|
+
const expressAnalyzer = new ExpressAnalyzer();
|
|
341
|
+
const endpoints = await expressAnalyzer.analyze(['./routes/**/*.js']);
|
|
342
|
+
|
|
343
|
+
// FastAPI
|
|
344
|
+
const fastapiAnalyzer = new FastAPIAnalyzer();
|
|
345
|
+
const endpoints = await fastapiAnalyzer.analyze(['./app/**/*.py']);
|
|
346
|
+
|
|
347
|
+
// Next.js App Router
|
|
348
|
+
const nextAnalyzer = new NextJSAnalyzer();
|
|
349
|
+
const endpoints = await nextAnalyzer.analyze(['./app/**/*.ts']);
|
|
350
|
+
|
|
351
|
+
// Generate OpenAPI from code
|
|
352
|
+
const spec = await generateOpenApiFromCode('./src', {
|
|
353
|
+
framework: 'express',
|
|
354
|
+
title: 'My API',
|
|
355
|
+
version: '1.0.0'
|
|
356
|
+
});
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### 3. `@github-to-mcp/mcp-server` (packages/mcp-server)
|
|
360
|
+
|
|
361
|
+
**Purpose**: MCP server that exposes github-to-mcp as tools
|
|
362
|
+
|
|
363
|
+
#### Exposed Tools
|
|
364
|
+
|
|
365
|
+
| Tool | Description |
|
|
366
|
+
|------|-------------|
|
|
367
|
+
| `convert_repo` | Convert GitHub repo to MCP server |
|
|
368
|
+
| `list_extracted_tools` | Preview extractable tools |
|
|
369
|
+
| `generate_openapi` | Generate OpenAPI from code |
|
|
370
|
+
| `stream_convert` | Server-Sent Events conversion |
|
|
371
|
+
| `export_docker` | Generate Docker deployment |
|
|
372
|
+
| `list_providers` | List supported Git providers |
|
|
373
|
+
|
|
374
|
+
#### Usage
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Start MCP server
|
|
378
|
+
npx @github-to-mcp/mcp-server
|
|
379
|
+
|
|
380
|
+
# Configure in Claude Desktop
|
|
381
|
+
{
|
|
382
|
+
"mcpServers": {
|
|
383
|
+
"github-to-mcp": {
|
|
384
|
+
"command": "npx",
|
|
385
|
+
"args": ["@github-to-mcp/mcp-server"]
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Web Application
|
|
394
|
+
|
|
395
|
+
### Technology Stack
|
|
396
|
+
|
|
397
|
+
- **Framework**: Next.js 14 (App Router)
|
|
398
|
+
- **UI**: React 18, TypeScript
|
|
399
|
+
- **Styling**: Tailwind CSS, Framer Motion
|
|
400
|
+
- **Components**: Radix UI primitives
|
|
401
|
+
- **State**: React hooks, localStorage
|
|
402
|
+
- **Animations**: Framer Motion, CSS animations
|
|
403
|
+
- **Particles**: @tsparticles/react
|
|
404
|
+
|
|
405
|
+
### Directory Structure
|
|
406
|
+
|
|
407
|
+
```
|
|
408
|
+
apps/web/
|
|
409
|
+
├── app/ # Next.js App Router
|
|
410
|
+
│ ├── page.tsx # Landing page
|
|
411
|
+
│ ├── layout.tsx # Root layout
|
|
412
|
+
│ ├── globals.css # Global styles
|
|
413
|
+
│ │
|
|
414
|
+
│ ├── convert/ # Conversion page
|
|
415
|
+
│ │ └── page.tsx
|
|
416
|
+
│ │
|
|
417
|
+
│ ├── batch/ # Batch conversion
|
|
418
|
+
│ │ ├── page.tsx
|
|
419
|
+
│ │ └── BatchConvertClient.tsx
|
|
420
|
+
│ │
|
|
421
|
+
│ ├── playground/ # Tool tester
|
|
422
|
+
│ │ └── page.tsx
|
|
423
|
+
│ │
|
|
424
|
+
│ └── api/ # API routes
|
|
425
|
+
│ ├── convert/route.ts
|
|
426
|
+
│ ├── stream/route.ts
|
|
427
|
+
│ └── generate-openapi/route.ts
|
|
428
|
+
│
|
|
429
|
+
├── components/ # React components
|
|
430
|
+
│ ├── Header.tsx
|
|
431
|
+
│ ├── Footer.tsx
|
|
432
|
+
│ ├── Hero.tsx
|
|
433
|
+
│ ├── Features.tsx
|
|
434
|
+
│ ├── HowItWorks.tsx
|
|
435
|
+
│ ├── ParticleBackground.tsx
|
|
436
|
+
│ ├── GithubUrlInput.tsx
|
|
437
|
+
│ ├── ProductCards.tsx
|
|
438
|
+
│ │
|
|
439
|
+
│ ├── convert/ # Conversion components
|
|
440
|
+
│ │ ├── ConversionResult.tsx
|
|
441
|
+
│ │ ├── ToolCard.tsx
|
|
442
|
+
│ │ ├── ConfigTabs.tsx
|
|
443
|
+
│ │ └── LoadingSteps.tsx
|
|
444
|
+
│ │
|
|
445
|
+
│ ├── streaming/ # Streaming components
|
|
446
|
+
│ │ └── StreamingProgress.tsx
|
|
447
|
+
│ │
|
|
448
|
+
│ ├── docker/ # Docker export
|
|
449
|
+
│ │ └── DockerExport.tsx
|
|
450
|
+
│ │
|
|
451
|
+
│ ├── install/ # Installation
|
|
452
|
+
│ │ └── OneClickInstall.tsx
|
|
453
|
+
│ │
|
|
454
|
+
│ ├── batch/ # Batch conversion
|
|
455
|
+
│ │ └── BatchConvert.tsx
|
|
456
|
+
│ │
|
|
457
|
+
│ └── ui/ # UI primitives
|
|
458
|
+
│ ├── button.tsx
|
|
459
|
+
│ ├── card.tsx
|
|
460
|
+
│ ├── badge.tsx
|
|
461
|
+
│ ├── input.tsx
|
|
462
|
+
│ └── tabs.tsx
|
|
463
|
+
│
|
|
464
|
+
├── hooks/ # Custom React hooks
|
|
465
|
+
│ ├── useStreaming.ts
|
|
466
|
+
│ ├── useBatchConversion.ts
|
|
467
|
+
│ ├── usePlatformDetection.ts
|
|
468
|
+
│ └── useDockerConfig.ts
|
|
469
|
+
│
|
|
470
|
+
├── lib/ # Utilities
|
|
471
|
+
│ ├── utils.ts
|
|
472
|
+
│ └── constants.ts
|
|
473
|
+
│
|
|
474
|
+
└── types/ # TypeScript types
|
|
475
|
+
└── index.ts
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### Key Pages
|
|
479
|
+
|
|
480
|
+
#### 1. Landing Page (`app/page.tsx`)
|
|
481
|
+
|
|
482
|
+
Features:
|
|
483
|
+
- Hero section with particle background
|
|
484
|
+
- Feature showcase
|
|
485
|
+
- "How It Works" diagram
|
|
486
|
+
- Product cards (Web, CLI, API, Docs)
|
|
487
|
+
- GitHub URL input for quick conversion
|
|
488
|
+
|
|
489
|
+
#### 2. Convert Page (`app/convert/page.tsx`)
|
|
490
|
+
|
|
491
|
+
Features:
|
|
492
|
+
- URL parameter support (`?url=...`)
|
|
493
|
+
- Loading states with animated steps
|
|
494
|
+
- Conversion result display
|
|
495
|
+
- Tool list with expandable cards
|
|
496
|
+
- Configuration tabs (Claude, Cursor, OpenAI)
|
|
497
|
+
- Download options (Code, Config, Docker)
|
|
498
|
+
- Conversion history (localStorage)
|
|
499
|
+
|
|
500
|
+
#### 3. Batch Convert Page (`app/batch/`)
|
|
501
|
+
|
|
502
|
+
Features:
|
|
503
|
+
- Multi-URL input (paste, file import, drag-to-reorder)
|
|
504
|
+
- Parallel conversion (configurable concurrency)
|
|
505
|
+
- Real-time progress per repo
|
|
506
|
+
- Bulk operations (retry, clear, download all)
|
|
507
|
+
- Status tracking (pending, converting, success, error)
|
|
508
|
+
|
|
509
|
+
#### 4. Playground Page (`app/playground/`)
|
|
510
|
+
|
|
511
|
+
Features:
|
|
512
|
+
- Interactive tool tester
|
|
513
|
+
- Execute tools with custom inputs
|
|
514
|
+
- JSON schema validation
|
|
515
|
+
- Response visualization
|
|
516
|
+
- History tracking
|
|
517
|
+
|
|
518
|
+
### Core Components
|
|
519
|
+
|
|
520
|
+
#### StreamingProgress Component
|
|
521
|
+
|
|
522
|
+
**File**: `components/streaming/StreamingProgress.tsx`
|
|
523
|
+
|
|
524
|
+
**Purpose**: Real-time conversion progress via Server-Sent Events
|
|
525
|
+
|
|
526
|
+
**Features**:
|
|
527
|
+
- SSE connection to `/api/stream`
|
|
528
|
+
- Animated progress bar (0-100%)
|
|
529
|
+
- Step indicators (fetch → analyze → extract → generate)
|
|
530
|
+
- Live tool discovery with framer-motion
|
|
531
|
+
- Elapsed time tracking
|
|
532
|
+
- Live log viewer (50-message history)
|
|
533
|
+
- Connection status (connecting, streaming, complete, error)
|
|
534
|
+
- Pause/cancel/retry controls
|
|
535
|
+
|
|
536
|
+
**Props**:
|
|
537
|
+
```typescript
|
|
538
|
+
interface StreamingProgressProps {
|
|
539
|
+
url: string;
|
|
540
|
+
onComplete: (result: ConversionResult) => void;
|
|
541
|
+
onError: (error: string) => void;
|
|
542
|
+
onCancel?: () => void;
|
|
543
|
+
autoStart?: boolean;
|
|
544
|
+
}
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
**Usage**:
|
|
548
|
+
```tsx
|
|
549
|
+
<StreamingProgress
|
|
550
|
+
url="https://github.com/owner/repo"
|
|
551
|
+
onComplete={(result) => console.log(result)}
|
|
552
|
+
onError={(error) => console.error(error)}
|
|
553
|
+
autoStart={true}
|
|
554
|
+
/>
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
#### DockerExport Component
|
|
558
|
+
|
|
559
|
+
**File**: `components/docker/DockerExport.tsx`
|
|
560
|
+
|
|
561
|
+
**Purpose**: Generate Dockerfile and docker-compose for MCP servers
|
|
562
|
+
|
|
563
|
+
**Features**:
|
|
564
|
+
- Interactive Dockerfile generator
|
|
565
|
+
- Multi-stage build support
|
|
566
|
+
- Base image selection (Node, Python variants)
|
|
567
|
+
- Health check configuration
|
|
568
|
+
- Non-root user execution
|
|
569
|
+
- OCI labels
|
|
570
|
+
- Preview tabs (Dockerfile, Compose, Env, Commands)
|
|
571
|
+
- Copy to clipboard & download
|
|
572
|
+
- Quick start guide
|
|
573
|
+
|
|
574
|
+
**Configuration Options**:
|
|
575
|
+
```typescript
|
|
576
|
+
interface DockerExportOptions {
|
|
577
|
+
baseImage: string;
|
|
578
|
+
port: number;
|
|
579
|
+
exposePorts: number[];
|
|
580
|
+
envVars: Record<string, string>;
|
|
581
|
+
volumes: string[];
|
|
582
|
+
healthCheck: boolean;
|
|
583
|
+
multiStage: boolean;
|
|
584
|
+
runAsNonRoot: boolean;
|
|
585
|
+
labels: boolean;
|
|
586
|
+
}
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
**Generated Files**:
|
|
590
|
+
- `Dockerfile` - Multi-stage optimized Dockerfile
|
|
591
|
+
- `docker-compose.yml` - Complete compose configuration
|
|
592
|
+
- `.env.example` - Environment variables template
|
|
593
|
+
- Build/run commands
|
|
594
|
+
|
|
595
|
+
#### OneClickInstall Component
|
|
596
|
+
|
|
597
|
+
**File**: `components/install/OneClickInstall.tsx`
|
|
598
|
+
|
|
599
|
+
**Purpose**: Platform-specific installation instructions
|
|
600
|
+
|
|
601
|
+
**Features**:
|
|
602
|
+
- Platform auto-detection (macOS, Windows, Linux, Docker)
|
|
603
|
+
- Step-by-step guided installation
|
|
604
|
+
- Prerequisites checklist
|
|
605
|
+
- Command snippets with copy buttons
|
|
606
|
+
- Progress tracking (mark steps complete)
|
|
607
|
+
- Optional vs required steps
|
|
608
|
+
- Warning/info notes
|
|
609
|
+
- Integration guides (Claude Desktop, Cursor, systemd)
|
|
610
|
+
|
|
611
|
+
**Supported Platforms**:
|
|
612
|
+
- macOS (Homebrew, npm)
|
|
613
|
+
- Windows (npm, chocolatey)
|
|
614
|
+
- Linux (npm, source build, systemd)
|
|
615
|
+
- Docker (container deployment)
|
|
616
|
+
|
|
617
|
+
#### BatchConvert Component
|
|
618
|
+
|
|
619
|
+
**File**: `components/batch/BatchConvert.tsx`
|
|
620
|
+
|
|
621
|
+
**Purpose**: Convert multiple repositories in parallel
|
|
622
|
+
|
|
623
|
+
**Features**:
|
|
624
|
+
- Multi-URL input (paste, file import, CSV)
|
|
625
|
+
- Drag-to-reorder repos
|
|
626
|
+
- Configurable concurrency (1-10 parallel)
|
|
627
|
+
- Real-time progress tracking per repo
|
|
628
|
+
- Bulk operations:
|
|
629
|
+
- Retry failed conversions
|
|
630
|
+
- Clear completed items
|
|
631
|
+
- Download all results as JSON
|
|
632
|
+
- Expandable result cards showing:
|
|
633
|
+
- Tool count, language, stars
|
|
634
|
+
- Individual tool names
|
|
635
|
+
- Error messages
|
|
636
|
+
- Status indicators (pending, converting, success, error)
|
|
637
|
+
- Pause/resume functionality
|
|
638
|
+
|
|
639
|
+
**Props**:
|
|
640
|
+
```typescript
|
|
641
|
+
interface BatchConvertProps {
|
|
642
|
+
onBatchComplete?: (results: Array<{
|
|
643
|
+
url: string;
|
|
644
|
+
result?: ConversionResult;
|
|
645
|
+
error?: string;
|
|
646
|
+
}>) => void;
|
|
647
|
+
maxConcurrent?: number; // Default: 3
|
|
648
|
+
}
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
### Custom Hooks
|
|
652
|
+
|
|
653
|
+
#### useStreaming
|
|
654
|
+
|
|
655
|
+
**File**: `hooks/useStreaming.ts`
|
|
656
|
+
|
|
657
|
+
**Purpose**: Manage SSE streaming connections
|
|
658
|
+
|
|
659
|
+
```typescript
|
|
660
|
+
const {
|
|
661
|
+
status, // 'idle' | 'connecting' | 'streaming' | 'complete' | 'error'
|
|
662
|
+
progress, // 0-100
|
|
663
|
+
currentStep, // Current progress data
|
|
664
|
+
discoveredTools,
|
|
665
|
+
error,
|
|
666
|
+
elapsedTime,
|
|
667
|
+
start,
|
|
668
|
+
stop,
|
|
669
|
+
reset
|
|
670
|
+
} = useStreaming(url, {
|
|
671
|
+
autoStart: true,
|
|
672
|
+
onProgress: (data) => {},
|
|
673
|
+
onTool: (tool, index, total) => {},
|
|
674
|
+
onComplete: (result) => {},
|
|
675
|
+
onError: (error) => {}
|
|
676
|
+
});
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
#### useBatchConversion
|
|
680
|
+
|
|
681
|
+
**File**: `hooks/useBatchConversion.ts`
|
|
682
|
+
|
|
683
|
+
**Purpose**: Manage batch conversion state
|
|
684
|
+
|
|
685
|
+
```typescript
|
|
686
|
+
const {
|
|
687
|
+
items, // Array of BatchConversionItem
|
|
688
|
+
state, // 'idle' | 'running' | 'paused' | 'complete'
|
|
689
|
+
stats, // { total, pending, converting, success, error, progress }
|
|
690
|
+
addUrl,
|
|
691
|
+
addUrls,
|
|
692
|
+
removeItem,
|
|
693
|
+
clearAll,
|
|
694
|
+
clearCompleted,
|
|
695
|
+
retryFailed,
|
|
696
|
+
start,
|
|
697
|
+
pause,
|
|
698
|
+
resume
|
|
699
|
+
} = useBatchConversion({
|
|
700
|
+
maxConcurrent: 3,
|
|
701
|
+
onItemComplete: (item) => {},
|
|
702
|
+
onItemError: (item, error) => {},
|
|
703
|
+
onBatchComplete: (items) => {}
|
|
704
|
+
});
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
#### usePlatformDetection
|
|
708
|
+
|
|
709
|
+
**File**: `hooks/usePlatformDetection.ts`
|
|
710
|
+
|
|
711
|
+
**Purpose**: Detect user's platform and environment
|
|
712
|
+
|
|
713
|
+
```typescript
|
|
714
|
+
const {
|
|
715
|
+
detection, // { os, arch, nodeVersion, npmVersion, hasDocker, hasPython }
|
|
716
|
+
isDetecting, // boolean
|
|
717
|
+
platform, // 'macos' | 'windows' | 'linux' | 'docker'
|
|
718
|
+
refresh
|
|
719
|
+
} = usePlatformDetection();
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
#### useDockerConfig
|
|
723
|
+
|
|
724
|
+
**File**: `hooks/useDockerConfig.ts`
|
|
725
|
+
|
|
726
|
+
**Purpose**: Generate Docker configuration
|
|
727
|
+
|
|
728
|
+
```typescript
|
|
729
|
+
const {
|
|
730
|
+
options, // DockerExportOptions
|
|
731
|
+
config, // { dockerfile, dockerCompose, envExample, buildCommand, runCommand }
|
|
732
|
+
setOptions,
|
|
733
|
+
resetOptions,
|
|
734
|
+
downloadAll
|
|
735
|
+
} = useDockerConfig(result, serverName);
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
### API Routes
|
|
739
|
+
|
|
740
|
+
#### POST /api/convert
|
|
741
|
+
|
|
742
|
+
**Purpose**: Convert GitHub repository
|
|
743
|
+
|
|
744
|
+
**Request**:
|
|
745
|
+
```typescript
|
|
746
|
+
{
|
|
747
|
+
url: string;
|
|
748
|
+
options?: {
|
|
749
|
+
outputLanguage?: 'typescript' | 'python';
|
|
750
|
+
sources?: string[];
|
|
751
|
+
githubToken?: string;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
**Response**:
|
|
757
|
+
```typescript
|
|
758
|
+
{
|
|
759
|
+
name: string;
|
|
760
|
+
tools: Tool[];
|
|
761
|
+
code: string;
|
|
762
|
+
pythonCode?: string;
|
|
763
|
+
claudeConfig: string;
|
|
764
|
+
cursorConfig: string;
|
|
765
|
+
// ... full ConversionResult
|
|
766
|
+
}
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
#### GET /api/stream
|
|
770
|
+
|
|
771
|
+
**Purpose**: Server-Sent Events streaming conversion
|
|
772
|
+
|
|
773
|
+
**Query Params**:
|
|
774
|
+
- `url`: GitHub repository URL
|
|
775
|
+
|
|
776
|
+
**Events**:
|
|
777
|
+
```typescript
|
|
778
|
+
// progress event
|
|
779
|
+
{
|
|
780
|
+
type: 'progress',
|
|
781
|
+
data: {
|
|
782
|
+
step: string,
|
|
783
|
+
description: string,
|
|
784
|
+
progress: number,
|
|
785
|
+
details?: string
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// tool event
|
|
790
|
+
{
|
|
791
|
+
type: 'tool',
|
|
792
|
+
data: {
|
|
793
|
+
tool: Tool,
|
|
794
|
+
index: number,
|
|
795
|
+
total: number
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// complete event
|
|
800
|
+
{
|
|
801
|
+
type: 'complete',
|
|
802
|
+
data: {
|
|
803
|
+
result: ConversionResult,
|
|
804
|
+
totalTime: number
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// error event
|
|
809
|
+
{
|
|
810
|
+
type: 'error',
|
|
811
|
+
data: {
|
|
812
|
+
error: string,
|
|
813
|
+
code: string
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
#### POST /api/generate-openapi
|
|
819
|
+
|
|
820
|
+
**Purpose**: Generate OpenAPI from code repository
|
|
821
|
+
|
|
822
|
+
**Request**:
|
|
823
|
+
```typescript
|
|
824
|
+
{
|
|
825
|
+
githubUrl: string;
|
|
826
|
+
framework?: 'express' | 'fastapi' | 'nextjs' | 'auto';
|
|
827
|
+
includeExamples?: boolean;
|
|
828
|
+
includeSchemas?: boolean;
|
|
829
|
+
}
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
**Response**:
|
|
833
|
+
```typescript
|
|
834
|
+
{
|
|
835
|
+
openapi: string; // "3.1.0"
|
|
836
|
+
info: { ... };
|
|
837
|
+
paths: { ... };
|
|
838
|
+
components: { ... };
|
|
839
|
+
}
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
### Design System
|
|
843
|
+
|
|
844
|
+
#### Colors
|
|
845
|
+
|
|
846
|
+
```css
|
|
847
|
+
/* Black/White monochrome palette */
|
|
848
|
+
--background: #000000;
|
|
849
|
+
--foreground: #ffffff;
|
|
850
|
+
--neutral-50: #fafafa;
|
|
851
|
+
--neutral-100: #f5f5f5;
|
|
852
|
+
--neutral-200: #e5e5e5;
|
|
853
|
+
--neutral-300: #d4d4d4;
|
|
854
|
+
--neutral-400: #a3a3a3;
|
|
855
|
+
--neutral-500: #737373;
|
|
856
|
+
--neutral-600: #525252;
|
|
857
|
+
--neutral-700: #404040;
|
|
858
|
+
--neutral-800: #262626;
|
|
859
|
+
--neutral-900: #171717;
|
|
860
|
+
--neutral-950: #0a0a0a;
|
|
861
|
+
```
|
|
862
|
+
|
|
863
|
+
#### Typography
|
|
864
|
+
|
|
865
|
+
```css
|
|
866
|
+
/* Font family */
|
|
867
|
+
font-family: Inter, system-ui, sans-serif;
|
|
868
|
+
|
|
869
|
+
/* Scale */
|
|
870
|
+
text-xs: 0.75rem; /* 12px */
|
|
871
|
+
text-sm: 0.875rem; /* 14px */
|
|
872
|
+
text-base: 1rem; /* 16px */
|
|
873
|
+
text-lg: 1.125rem; /* 18px */
|
|
874
|
+
text-xl: 1.25rem; /* 20px */
|
|
875
|
+
text-2xl: 1.5rem; /* 24px */
|
|
876
|
+
text-3xl: 1.875rem; /* 30px */
|
|
877
|
+
text-4xl: 2.25rem; /* 36px */
|
|
878
|
+
text-5xl: 3rem; /* 48px */
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
#### Spacing
|
|
882
|
+
|
|
883
|
+
```css
|
|
884
|
+
/* Scale */
|
|
885
|
+
0.5: 0.125rem; /* 2px */
|
|
886
|
+
1: 0.25rem; /* 4px */
|
|
887
|
+
2: 0.5rem; /* 8px */
|
|
888
|
+
3: 0.75rem; /* 12px */
|
|
889
|
+
4: 1rem; /* 16px */
|
|
890
|
+
6: 1.5rem; /* 24px */
|
|
891
|
+
8: 2rem; /* 32px */
|
|
892
|
+
12: 3rem; /* 48px */
|
|
893
|
+
16: 4rem; /* 64px */
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
#### Components
|
|
897
|
+
|
|
898
|
+
```css
|
|
899
|
+
/* Glass-morphism cards */
|
|
900
|
+
.card {
|
|
901
|
+
background: rgba(0, 0, 0, 0.5);
|
|
902
|
+
backdrop-filter: blur(12px);
|
|
903
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
904
|
+
border-radius: 1rem;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/* Buttons */
|
|
908
|
+
.button-primary {
|
|
909
|
+
background: white;
|
|
910
|
+
color: black;
|
|
911
|
+
border-radius: 0.75rem;
|
|
912
|
+
transition: all 0.2s;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.button-primary:hover {
|
|
916
|
+
background: #e5e5e5;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/* Badges */
|
|
920
|
+
.badge {
|
|
921
|
+
border-radius: 9999px;
|
|
922
|
+
padding: 0.25rem 0.75rem;
|
|
923
|
+
font-size: 0.75rem;
|
|
924
|
+
border: 1px solid;
|
|
925
|
+
}
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
---
|
|
929
|
+
|
|
930
|
+
## Data Flow
|
|
931
|
+
|
|
932
|
+
### Conversion Flow
|
|
933
|
+
|
|
934
|
+
```
|
|
935
|
+
User Input (GitHub URL)
|
|
936
|
+
↓
|
|
937
|
+
Web UI / CLI / API
|
|
938
|
+
↓
|
|
939
|
+
GithubToMcpGenerator.generate()
|
|
940
|
+
↓
|
|
941
|
+
┌────────────────────────────┐
|
|
942
|
+
│ 1. Fetch Repository │
|
|
943
|
+
│ - GitHub API (Octokit) │
|
|
944
|
+
│ - Cache (Redis/Memory) │
|
|
945
|
+
└────────────────────────────┘
|
|
946
|
+
↓
|
|
947
|
+
┌────────────────────────────┐
|
|
948
|
+
│ 2. Classify Repository │
|
|
949
|
+
│ - Parse README │
|
|
950
|
+
│ - Analyze package.json │
|
|
951
|
+
│ - Detect frameworks │
|
|
952
|
+
└────────────────────────────┘
|
|
953
|
+
↓
|
|
954
|
+
┌────────────────────────────┐
|
|
955
|
+
│ 3. Extract Tools │
|
|
956
|
+
│ - OpenAPI Parser │
|
|
957
|
+
│ - GraphQL Parser │
|
|
958
|
+
│ - README Extractor │
|
|
959
|
+
│ - Code Extractor │
|
|
960
|
+
│ - MCP Introspector │
|
|
961
|
+
└────────────────────────────┘
|
|
962
|
+
↓
|
|
963
|
+
┌────────────────────────────┐
|
|
964
|
+
│ 4. Deduplicate Tools │
|
|
965
|
+
│ - Merge by name │
|
|
966
|
+
│ - Prefer higher conf. │
|
|
967
|
+
└────────────────────────────┘
|
|
968
|
+
↓
|
|
969
|
+
┌────────────────────────────┐
|
|
970
|
+
│ 5. Generate Code │
|
|
971
|
+
│ - TypeScript template │
|
|
972
|
+
│ - Python template │
|
|
973
|
+
│ - Config files │
|
|
974
|
+
└────────────────────────────┘
|
|
975
|
+
↓
|
|
976
|
+
ConversionResult
|
|
977
|
+
↓
|
|
978
|
+
Output (Code, Configs, Docker)
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
### Streaming Flow
|
|
982
|
+
|
|
983
|
+
```
|
|
984
|
+
Client Request (GET /api/stream?url=...)
|
|
985
|
+
↓
|
|
986
|
+
Server (Next.js API Route)
|
|
987
|
+
↓
|
|
988
|
+
Create EventSource Stream
|
|
989
|
+
↓
|
|
990
|
+
GithubToMcpGenerator with Progress Callbacks
|
|
991
|
+
↓
|
|
992
|
+
┌────────────────────────────┐
|
|
993
|
+
│ Progress Event │
|
|
994
|
+
│ { type: 'progress', ... } │
|
|
995
|
+
└────────────────────────────┘
|
|
996
|
+
↓ (sent to client)
|
|
997
|
+
Client: StreamingProgress Component
|
|
998
|
+
↓ (update UI)
|
|
999
|
+
Progress Bar, Step Indicator
|
|
1000
|
+
↓
|
|
1001
|
+
┌────────────────────────────┐
|
|
1002
|
+
│ Tool Event │
|
|
1003
|
+
│ { type: 'tool', ... } │
|
|
1004
|
+
└────────────────────────────┘
|
|
1005
|
+
↓ (sent to client)
|
|
1006
|
+
Client: Add to discoveredTools[]
|
|
1007
|
+
↓ (animate)
|
|
1008
|
+
Tool Card Appears
|
|
1009
|
+
↓
|
|
1010
|
+
┌────────────────────────────┐
|
|
1011
|
+
│ Complete Event │
|
|
1012
|
+
│ { type: 'complete', ... } │
|
|
1013
|
+
└────────────────────────────┘
|
|
1014
|
+
↓ (sent to client)
|
|
1015
|
+
Client: Display ConversionResult
|
|
1016
|
+
↓
|
|
1017
|
+
Show Tools, Download Options
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
---
|
|
1021
|
+
|
|
1022
|
+
## API Reference
|
|
1023
|
+
|
|
1024
|
+
### Core API
|
|
1025
|
+
|
|
1026
|
+
#### `GithubToMcpGenerator`
|
|
1027
|
+
|
|
1028
|
+
```typescript
|
|
1029
|
+
import { GithubToMcpGenerator } from '@nirholas/github-to-mcp';
|
|
1030
|
+
|
|
1031
|
+
const generator = new GithubToMcpGenerator({
|
|
1032
|
+
githubToken: process.env.GITHUB_TOKEN,
|
|
1033
|
+
outputLanguage: 'typescript',
|
|
1034
|
+
cache: true
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1037
|
+
const result = await generator.generate('https://github.com/owner/repo');
|
|
1038
|
+
|
|
1039
|
+
console.log(`Generated ${result.tools.length} tools`);
|
|
1040
|
+
console.log(result.generate()); // TypeScript code
|
|
1041
|
+
console.log(result.generatePython()); // Python code
|
|
1042
|
+
|
|
1043
|
+
await result.save('./output'); // Save to directory
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
#### `convertOpenApiToMcp`
|
|
1047
|
+
|
|
1048
|
+
```typescript
|
|
1049
|
+
import { convertOpenApiToMcp } from '@github-to-mcp/openapi-parser';
|
|
1050
|
+
|
|
1051
|
+
const converter = new convertOpenApiToMcp({
|
|
1052
|
+
spec: './openapi.json',
|
|
1053
|
+
outputDir: './mcp-server',
|
|
1054
|
+
baseUrl: 'https://api.example.com'
|
|
1055
|
+
});
|
|
1056
|
+
|
|
1057
|
+
const stats = await converter.convert();
|
|
1058
|
+
const tools = await converter.getMcpTools();
|
|
1059
|
+
const code = await converter.generateCode('typescript');
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
#### `generateOpenApiFromCode`
|
|
1063
|
+
|
|
1064
|
+
```typescript
|
|
1065
|
+
import { generateOpenApiFromCode } from '@github-to-mcp/openapi-parser';
|
|
1066
|
+
|
|
1067
|
+
const spec = await generateOpenApiFromCode('./src', {
|
|
1068
|
+
framework: 'express',
|
|
1069
|
+
title: 'My API',
|
|
1070
|
+
version: '1.0.0',
|
|
1071
|
+
includeExamples: true
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1074
|
+
console.log(JSON.stringify(spec, null, 2));
|
|
1075
|
+
```
|
|
1076
|
+
|
|
1077
|
+
### CLI API
|
|
1078
|
+
|
|
1079
|
+
```bash
|
|
1080
|
+
# Convert repository
|
|
1081
|
+
npx @nirholas/github-to-mcp convert https://github.com/owner/repo
|
|
1082
|
+
|
|
1083
|
+
# With options
|
|
1084
|
+
npx @nirholas/github-to-mcp convert \
|
|
1085
|
+
https://github.com/owner/repo \
|
|
1086
|
+
--output-language python \
|
|
1087
|
+
--sources readme openapi code \
|
|
1088
|
+
--output ./my-mcp-server
|
|
1089
|
+
|
|
1090
|
+
# Generate OpenAPI from code
|
|
1091
|
+
npx @github-to-mcp/openapi-parser generate \
|
|
1092
|
+
./src \
|
|
1093
|
+
--framework express \
|
|
1094
|
+
--output openapi.json
|
|
1095
|
+
|
|
1096
|
+
# Start MCP server
|
|
1097
|
+
npx @github-to-mcp/mcp-server
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
---
|
|
1101
|
+
|
|
1102
|
+
## Component Reference
|
|
1103
|
+
|
|
1104
|
+
### UI Components (apps/web/components/ui/)
|
|
1105
|
+
|
|
1106
|
+
#### Button
|
|
1107
|
+
|
|
1108
|
+
```tsx
|
|
1109
|
+
import { Button } from '@/components/ui/button';
|
|
1110
|
+
|
|
1111
|
+
<Button variant="default" size="lg">
|
|
1112
|
+
Click Me
|
|
1113
|
+
</Button>
|
|
1114
|
+
|
|
1115
|
+
// Variants: default, secondary, outline, ghost
|
|
1116
|
+
// Sizes: sm, default, lg
|
|
1117
|
+
```
|
|
1118
|
+
|
|
1119
|
+
#### Card
|
|
1120
|
+
|
|
1121
|
+
```tsx
|
|
1122
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/components/ui/card';
|
|
1123
|
+
|
|
1124
|
+
<Card>
|
|
1125
|
+
<CardHeader>
|
|
1126
|
+
<CardTitle>Title</CardTitle>
|
|
1127
|
+
<CardDescription>Description</CardDescription>
|
|
1128
|
+
</CardHeader>
|
|
1129
|
+
<CardContent>Content</CardContent>
|
|
1130
|
+
</Card>
|
|
1131
|
+
```
|
|
1132
|
+
|
|
1133
|
+
#### Badge
|
|
1134
|
+
|
|
1135
|
+
```tsx
|
|
1136
|
+
import { Badge } from '@/components/ui/badge';
|
|
1137
|
+
|
|
1138
|
+
<Badge variant="default">New</Badge>
|
|
1139
|
+
|
|
1140
|
+
// Variants: default, secondary, success, warning, error
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
#### Tabs
|
|
1144
|
+
|
|
1145
|
+
```tsx
|
|
1146
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
|
|
1147
|
+
|
|
1148
|
+
<Tabs defaultValue="typescript">
|
|
1149
|
+
<TabsList>
|
|
1150
|
+
<TabsTrigger value="typescript">TypeScript</TabsTrigger>
|
|
1151
|
+
<TabsTrigger value="python">Python</TabsTrigger>
|
|
1152
|
+
</TabsList>
|
|
1153
|
+
<TabsContent value="typescript">TS Code</TabsContent>
|
|
1154
|
+
<TabsContent value="python">Python Code</TabsContent>
|
|
1155
|
+
</Tabs>
|
|
1156
|
+
```
|
|
1157
|
+
|
|
1158
|
+
---
|
|
1159
|
+
|
|
1160
|
+
## Development Guide
|
|
1161
|
+
|
|
1162
|
+
### Setup
|
|
1163
|
+
|
|
1164
|
+
```bash
|
|
1165
|
+
# Clone repository
|
|
1166
|
+
git clone https://github.com/nirholas/github-to-mcp.git
|
|
1167
|
+
cd github-to-mcp
|
|
1168
|
+
|
|
1169
|
+
# Install dependencies
|
|
1170
|
+
pnpm install
|
|
1171
|
+
|
|
1172
|
+
# Build all packages
|
|
1173
|
+
pnpm build
|
|
1174
|
+
|
|
1175
|
+
# Start development server
|
|
1176
|
+
pnpm dev
|
|
1177
|
+
```
|
|
1178
|
+
|
|
1179
|
+
### Scripts
|
|
1180
|
+
|
|
1181
|
+
```bash
|
|
1182
|
+
# Development
|
|
1183
|
+
pnpm dev # Start web dev server
|
|
1184
|
+
pnpm dev:core # Watch core package
|
|
1185
|
+
|
|
1186
|
+
# Build
|
|
1187
|
+
pnpm build # Build all packages
|
|
1188
|
+
pnpm build:core # Build core only
|
|
1189
|
+
pnpm build:web # Build web only
|
|
1190
|
+
|
|
1191
|
+
# Testing
|
|
1192
|
+
pnpm test # Run all tests
|
|
1193
|
+
pnpm test:watch # Watch mode
|
|
1194
|
+
pnpm test:coverage # With coverage
|
|
1195
|
+
pnpm test:ui # Vitest UI
|
|
1196
|
+
|
|
1197
|
+
# Linting
|
|
1198
|
+
pnpm lint # Lint all packages
|
|
1199
|
+
pnpm typecheck # TypeScript check
|
|
1200
|
+
|
|
1201
|
+
# Release
|
|
1202
|
+
pnpm changeset # Create changeset
|
|
1203
|
+
pnpm version-packages # Bump versions
|
|
1204
|
+
pnpm release # Publish to npm
|
|
1205
|
+
```
|
|
1206
|
+
|
|
1207
|
+
### Adding a New Extractor
|
|
1208
|
+
|
|
1209
|
+
1. Create extractor file in `packages/core/src/extractors/`
|
|
1210
|
+
2. Implement `Extractor` interface
|
|
1211
|
+
3. Register in `packages/core/src/extractors/index.ts`
|
|
1212
|
+
4. Add tests in `packages/core/src/__tests__/`
|
|
1213
|
+
5. Update documentation
|
|
1214
|
+
|
|
1215
|
+
Example:
|
|
1216
|
+
|
|
1217
|
+
```typescript
|
|
1218
|
+
// packages/core/src/extractors/my-extractor.ts
|
|
1219
|
+
export class MyExtractor {
|
|
1220
|
+
async extract(files: FileContent[]): Promise<ExtractedTool[]> {
|
|
1221
|
+
const tools: ExtractedTool[] = [];
|
|
1222
|
+
|
|
1223
|
+
for (const file of files) {
|
|
1224
|
+
// Parse file and extract tools
|
|
1225
|
+
const extracted = this.parseFile(file);
|
|
1226
|
+
tools.push(...extracted);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
return tools;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
private parseFile(file: FileContent): ExtractedTool[] {
|
|
1233
|
+
// Implementation
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
```
|
|
1237
|
+
|
|
1238
|
+
### Adding a New Component
|
|
1239
|
+
|
|
1240
|
+
1. Create component in `apps/web/components/`
|
|
1241
|
+
2. Add TypeScript types in `apps/web/types/index.ts`
|
|
1242
|
+
3. Create tests (if applicable)
|
|
1243
|
+
4. Export from barrel file
|
|
1244
|
+
5. Add to Storybook (if applicable)
|
|
1245
|
+
|
|
1246
|
+
Example:
|
|
1247
|
+
|
|
1248
|
+
```tsx
|
|
1249
|
+
// apps/web/components/MyComponent.tsx
|
|
1250
|
+
'use client';
|
|
1251
|
+
|
|
1252
|
+
import { useState } from 'react';
|
|
1253
|
+
import { motion } from 'framer-motion';
|
|
1254
|
+
|
|
1255
|
+
interface MyComponentProps {
|
|
1256
|
+
title: string;
|
|
1257
|
+
onAction?: () => void;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
export default function MyComponent({ title, onAction }: MyComponentProps) {
|
|
1261
|
+
const [state, setState] = useState(false);
|
|
1262
|
+
|
|
1263
|
+
return (
|
|
1264
|
+
<motion.div
|
|
1265
|
+
initial={{ opacity: 0 }}
|
|
1266
|
+
animate={{ opacity: 1 }}
|
|
1267
|
+
className="rounded-xl border border-neutral-800 p-4"
|
|
1268
|
+
>
|
|
1269
|
+
<h2 className="text-lg font-semibold">{title}</h2>
|
|
1270
|
+
<button onClick={onAction}>Action</button>
|
|
1271
|
+
</motion.div>
|
|
1272
|
+
);
|
|
1273
|
+
}
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
---
|
|
1277
|
+
|
|
1278
|
+
## Deployment
|
|
1279
|
+
|
|
1280
|
+
### Vercel (Web App)
|
|
1281
|
+
|
|
1282
|
+
```bash
|
|
1283
|
+
# Install Vercel CLI
|
|
1284
|
+
npm i -g vercel
|
|
1285
|
+
|
|
1286
|
+
# Deploy
|
|
1287
|
+
vercel
|
|
1288
|
+
|
|
1289
|
+
# Production
|
|
1290
|
+
vercel --prod
|
|
1291
|
+
```
|
|
1292
|
+
|
|
1293
|
+
Environment Variables:
|
|
1294
|
+
```
|
|
1295
|
+
GITHUB_TOKEN=ghp_xxxxxxxxxxxxx
|
|
1296
|
+
NEXT_PUBLIC_API_URL=https://your-domain.com
|
|
1297
|
+
```
|
|
1298
|
+
|
|
1299
|
+
### npm (Packages)
|
|
1300
|
+
|
|
1301
|
+
```bash
|
|
1302
|
+
# Login to npm
|
|
1303
|
+
npm login
|
|
1304
|
+
|
|
1305
|
+
# Publish all packages
|
|
1306
|
+
pnpm release
|
|
1307
|
+
|
|
1308
|
+
# Publish single package
|
|
1309
|
+
cd packages/core
|
|
1310
|
+
npm publish --access public
|
|
1311
|
+
```
|
|
1312
|
+
|
|
1313
|
+
### Docker
|
|
1314
|
+
|
|
1315
|
+
```bash
|
|
1316
|
+
# Build image
|
|
1317
|
+
docker build -t github-to-mcp-web .
|
|
1318
|
+
|
|
1319
|
+
# Run container
|
|
1320
|
+
docker run -p 3000:3000 github-to-mcp-web
|
|
1321
|
+
|
|
1322
|
+
# Docker Compose
|
|
1323
|
+
docker-compose up
|
|
1324
|
+
```
|
|
1325
|
+
|
|
1326
|
+
---
|
|
1327
|
+
|
|
1328
|
+
## Performance Considerations
|
|
1329
|
+
|
|
1330
|
+
### Caching Strategy
|
|
1331
|
+
|
|
1332
|
+
1. **GitHub API Responses**: 1 hour TTL for metadata, 15 minutes for files
|
|
1333
|
+
2. **Generated Code**: Cache by repo URL + commit SHA
|
|
1334
|
+
3. **OpenAPI Parsing**: Cache parsed specs by content hash
|
|
1335
|
+
4. **Redis/Upstash**: Production caching with TTL
|
|
1336
|
+
|
|
1337
|
+
### Rate Limiting
|
|
1338
|
+
|
|
1339
|
+
- GitHub API: 5,000 requests/hour (authenticated), 60/hour (unauthenticated)
|
|
1340
|
+
- Implement exponential backoff
|
|
1341
|
+
- Use conditional requests (ETags, If-Modified-Since)
|
|
1342
|
+
- Batch requests where possible
|
|
1343
|
+
|
|
1344
|
+
### Optimization
|
|
1345
|
+
|
|
1346
|
+
- Lazy load components with React.lazy
|
|
1347
|
+
- Code splitting per route
|
|
1348
|
+
- Image optimization with Next.js Image
|
|
1349
|
+
- Bundle analysis with `@next/bundle-analyzer`
|
|
1350
|
+
- Tree shaking via ESM
|
|
1351
|
+
|
|
1352
|
+
---
|
|
1353
|
+
|
|
1354
|
+
## Security
|
|
1355
|
+
|
|
1356
|
+
### Best Practices
|
|
1357
|
+
|
|
1358
|
+
1. **API Keys**: Never commit tokens, use environment variables
|
|
1359
|
+
2. **Input Validation**: Validate GitHub URLs, sanitize user input
|
|
1360
|
+
3. **Rate Limiting**: Implement per-user rate limits
|
|
1361
|
+
4. **CORS**: Restrict origins in production
|
|
1362
|
+
5. **CSP**: Content Security Policy headers
|
|
1363
|
+
6. **Dependency Scanning**: Use `npm audit`, Dependabot
|
|
1364
|
+
|
|
1365
|
+
### Secrets Management
|
|
1366
|
+
|
|
1367
|
+
```bash
|
|
1368
|
+
# Development
|
|
1369
|
+
cp .env.example .env
|
|
1370
|
+
# Add secrets to .env
|
|
1371
|
+
|
|
1372
|
+
# Production (Vercel)
|
|
1373
|
+
vercel env add GITHUB_TOKEN
|
|
1374
|
+
vercel env add UPSTASH_REDIS_URL
|
|
1375
|
+
```
|
|
1376
|
+
|
|
1377
|
+
---
|
|
1378
|
+
|
|
1379
|
+
## Monitoring & Logging
|
|
1380
|
+
|
|
1381
|
+
### Web Vitals
|
|
1382
|
+
|
|
1383
|
+
- Largest Contentful Paint (LCP) < 2.5s
|
|
1384
|
+
- First Input Delay (FID) < 100ms
|
|
1385
|
+
- Cumulative Layout Shift (CLS) < 0.1
|
|
1386
|
+
|
|
1387
|
+
### Error Tracking
|
|
1388
|
+
|
|
1389
|
+
- Client errors: window.onerror, unhandledrejection
|
|
1390
|
+
- Server errors: try/catch in API routes
|
|
1391
|
+
- Integration: Sentry, LogRocket (optional)
|
|
1392
|
+
|
|
1393
|
+
### Analytics
|
|
1394
|
+
|
|
1395
|
+
- Page views, conversions
|
|
1396
|
+
- Tool usage statistics
|
|
1397
|
+
- Error rates
|
|
1398
|
+
- Performance metrics
|
|
1399
|
+
|
|
1400
|
+
---
|
|
1401
|
+
|
|
1402
|
+
## Contributing
|
|
1403
|
+
|
|
1404
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
|
|
1405
|
+
|
|
1406
|
+
Quick start:
|
|
1407
|
+
1. Fork the repository
|
|
1408
|
+
2. Create a feature branch
|
|
1409
|
+
3. Make your changes
|
|
1410
|
+
4. Add tests
|
|
1411
|
+
5. Submit a pull request
|
|
1412
|
+
|
|
1413
|
+
---
|
|
1414
|
+
|
|
1415
|
+
## License
|
|
1416
|
+
|
|
1417
|
+
MIT License - see [LICENSE](./LICENSE) for details.
|
|
1418
|
+
|
|
1419
|
+
---
|
|
1420
|
+
|
|
1421
|
+
## Changelog
|
|
1422
|
+
|
|
1423
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history.
|
|
1424
|
+
|
|
1425
|
+
---
|
|
1426
|
+
|
|
1427
|
+
**Last Updated**: January 17, 2026
|
|
1428
|
+
**Version**: 1.0.0
|
|
1429
|
+
**Maintained by**: [nirholas](https://github.com/nirholas)
|