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
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions and interfaces
|
|
3
|
+
* @copyright Copyright (c) 2024-2026 nirholas
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Types for GitHub to MCP Generator
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type SourceType = 'readme' | 'openapi' | 'graphql' | 'grpc' | 'code' | 'mcp-introspect' | 'tests' | 'docs' | 'examples' | 'universal';
|
|
12
|
+
|
|
13
|
+
export type NamingStyle = 'camelCase' | 'snake_case' | 'kebab-case' | 'PascalCase';
|
|
14
|
+
|
|
15
|
+
export type OutputLanguage = 'typescript' | 'python' | 'go';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Classification of repository type
|
|
19
|
+
*/
|
|
20
|
+
export type RepoType =
|
|
21
|
+
| 'api-sdk' // API client/SDK with extractable endpoints
|
|
22
|
+
| 'mcp-server' // Already an MCP server
|
|
23
|
+
| 'cli-tool' // Command-line tool
|
|
24
|
+
| 'library' // Code library/package
|
|
25
|
+
| 'documentation' // Docs, tutorials, guides
|
|
26
|
+
| 'data' // Datasets, configs
|
|
27
|
+
| 'unknown'; // Fallback
|
|
28
|
+
|
|
29
|
+
export interface RepoClassification {
|
|
30
|
+
type: RepoType;
|
|
31
|
+
confidence: number; // 0-1
|
|
32
|
+
indicators: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface GithubToMcpOptions {
|
|
36
|
+
// Sources to extract from
|
|
37
|
+
sources?: SourceType[];
|
|
38
|
+
|
|
39
|
+
// Follow documentation links
|
|
40
|
+
followDocs?: boolean;
|
|
41
|
+
depth?: number;
|
|
42
|
+
|
|
43
|
+
// Include code examples
|
|
44
|
+
includeExamples?: boolean;
|
|
45
|
+
|
|
46
|
+
// Generate tests
|
|
47
|
+
generateTests?: boolean;
|
|
48
|
+
|
|
49
|
+
// Output format
|
|
50
|
+
outputFormat?: 'typescript' | 'javascript';
|
|
51
|
+
|
|
52
|
+
// Output language (typescript or python)
|
|
53
|
+
outputLanguage?: OutputLanguage;
|
|
54
|
+
|
|
55
|
+
// Naming convention
|
|
56
|
+
naming?: {
|
|
57
|
+
prefix?: string;
|
|
58
|
+
suffix?: string;
|
|
59
|
+
style?: NamingStyle;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// Authentication
|
|
63
|
+
githubToken?: string;
|
|
64
|
+
|
|
65
|
+
// Caching
|
|
66
|
+
cache?: boolean;
|
|
67
|
+
cacheDir?: string;
|
|
68
|
+
cacheTTL?: {
|
|
69
|
+
metadata?: number; // TTL for repo metadata in seconds (default: 3600)
|
|
70
|
+
files?: number; // TTL for file contents in seconds (default: 900)
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Rate limiting
|
|
74
|
+
rateLimit?: {
|
|
75
|
+
maxRequests: number;
|
|
76
|
+
perSeconds: number;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Output directory
|
|
80
|
+
outputDir?: string;
|
|
81
|
+
|
|
82
|
+
// Verbose logging
|
|
83
|
+
verbose?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Confidence factors for tool extraction
|
|
88
|
+
*/
|
|
89
|
+
export interface ConfidenceFactors {
|
|
90
|
+
documentation: number; // 0-1: completeness of description, params, returns
|
|
91
|
+
types: number; // 0-1: type information availability
|
|
92
|
+
examples: number; // 0-1: presence of examples
|
|
93
|
+
source: number; // 0-1: reliability of source (README vs code comments)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface ExtractedTool {
|
|
97
|
+
name: string;
|
|
98
|
+
description: string;
|
|
99
|
+
inputSchema: any;
|
|
100
|
+
implementation?: string;
|
|
101
|
+
examples?: string[];
|
|
102
|
+
source: {
|
|
103
|
+
type: SourceType;
|
|
104
|
+
file: string;
|
|
105
|
+
line?: number;
|
|
106
|
+
};
|
|
107
|
+
confidence?: number; // 0-1 overall confidence score
|
|
108
|
+
confidenceFactors?: ConfidenceFactors;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface SourceBreakdown {
|
|
112
|
+
type: SourceType;
|
|
113
|
+
count: number;
|
|
114
|
+
files: string[];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface GenerationResult {
|
|
118
|
+
repo: string;
|
|
119
|
+
name: string;
|
|
120
|
+
tools: ExtractedTool[];
|
|
121
|
+
sources: SourceBreakdown[];
|
|
122
|
+
classification: RepoClassification;
|
|
123
|
+
metadata: {
|
|
124
|
+
stars: number;
|
|
125
|
+
language: string;
|
|
126
|
+
license?: string;
|
|
127
|
+
description?: string;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// Methods
|
|
131
|
+
generate(): string;
|
|
132
|
+
generatePython?(): string;
|
|
133
|
+
save(outputDir: string): Promise<void>;
|
|
134
|
+
download(): void;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface RepoMetadata {
|
|
138
|
+
owner: string;
|
|
139
|
+
repo: string;
|
|
140
|
+
branch?: string;
|
|
141
|
+
path?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface FileContent {
|
|
145
|
+
path: string;
|
|
146
|
+
content: string;
|
|
147
|
+
type: 'file' | 'dir';
|
|
148
|
+
sha: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface ApiSpec {
|
|
152
|
+
type: 'openapi' | 'swagger' | 'postman' | 'graphql';
|
|
153
|
+
version: string;
|
|
154
|
+
spec: any;
|
|
155
|
+
path: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface GraphQLSchema {
|
|
159
|
+
queries: GraphQLOperation[];
|
|
160
|
+
mutations: GraphQLOperation[];
|
|
161
|
+
subscriptions: GraphQLOperation[];
|
|
162
|
+
types: Record<string, GraphQLType>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface GraphQLOperation {
|
|
166
|
+
name: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
args: GraphQLArg[];
|
|
169
|
+
returnType: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface GraphQLArg {
|
|
173
|
+
name: string;
|
|
174
|
+
type: string;
|
|
175
|
+
required: boolean;
|
|
176
|
+
description?: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface GraphQLType {
|
|
180
|
+
name: string;
|
|
181
|
+
kind: 'object' | 'enum' | 'scalar' | 'input';
|
|
182
|
+
fields?: Array<{ name: string; type: string; description?: string }>;
|
|
183
|
+
values?: string[];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface McpToolDefinition {
|
|
187
|
+
name: string;
|
|
188
|
+
description: string;
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: 'object';
|
|
191
|
+
properties: Record<string, any>;
|
|
192
|
+
required: string[];
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface CodeExample {
|
|
197
|
+
code: string;
|
|
198
|
+
language: string;
|
|
199
|
+
description?: string;
|
|
200
|
+
file: string;
|
|
201
|
+
line: number;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface DocumentationLink {
|
|
205
|
+
url: string;
|
|
206
|
+
title?: string;
|
|
207
|
+
source: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface SdkMethod {
|
|
211
|
+
name: string;
|
|
212
|
+
parameters: Array<{
|
|
213
|
+
name: string;
|
|
214
|
+
type: string;
|
|
215
|
+
required: boolean;
|
|
216
|
+
description?: string;
|
|
217
|
+
}>;
|
|
218
|
+
returnType: string;
|
|
219
|
+
description?: string;
|
|
220
|
+
file: string;
|
|
221
|
+
line: number;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Monorepo detection types
|
|
226
|
+
*/
|
|
227
|
+
export type MonorepoType =
|
|
228
|
+
| 'lerna' // lerna.json
|
|
229
|
+
| 'nx' // nx.json
|
|
230
|
+
| 'turborepo' // turbo.json
|
|
231
|
+
| 'pnpm' // pnpm-workspace.yaml
|
|
232
|
+
| 'yarn' // workspaces in package.json
|
|
233
|
+
| 'npm' // workspaces in package.json
|
|
234
|
+
| 'custom' // packages/*, apps/*, libs/*
|
|
235
|
+
| 'none'; // Not a monorepo
|
|
236
|
+
|
|
237
|
+
export interface MonorepoInfo {
|
|
238
|
+
type: MonorepoType;
|
|
239
|
+
packages: MonorepoPackage[];
|
|
240
|
+
rootPath: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface MonorepoPackage {
|
|
244
|
+
name: string;
|
|
245
|
+
path: string;
|
|
246
|
+
language?: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Cache entry for GitHub API responses
|
|
251
|
+
*/
|
|
252
|
+
export interface CacheEntry<T> {
|
|
253
|
+
data: T;
|
|
254
|
+
timestamp: number;
|
|
255
|
+
ttl: number;
|
|
256
|
+
etag?: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Cache adapter interface for pluggable storage
|
|
261
|
+
*/
|
|
262
|
+
export interface CacheAdapter {
|
|
263
|
+
get<T>(key: string): Promise<CacheEntry<T> | null>;
|
|
264
|
+
set<T>(key: string, entry: CacheEntry<T>): Promise<void>;
|
|
265
|
+
delete(key: string): Promise<void>;
|
|
266
|
+
clear(): Promise<void>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Parsed documentation from various languages
|
|
271
|
+
*/
|
|
272
|
+
export interface ParsedDocumentation {
|
|
273
|
+
description?: string;
|
|
274
|
+
params: Array<{
|
|
275
|
+
name: string;
|
|
276
|
+
type?: string;
|
|
277
|
+
description?: string;
|
|
278
|
+
required?: boolean;
|
|
279
|
+
defaultValue?: any;
|
|
280
|
+
}>;
|
|
281
|
+
returns?: {
|
|
282
|
+
type?: string;
|
|
283
|
+
description?: string;
|
|
284
|
+
};
|
|
285
|
+
examples?: string[];
|
|
286
|
+
throws?: string[];
|
|
287
|
+
deprecated?: boolean;
|
|
288
|
+
since?: string;
|
|
289
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
// Library build
|
|
5
|
+
defineConfig({
|
|
6
|
+
entry: ['src/index.ts'],
|
|
7
|
+
format: ['esm'],
|
|
8
|
+
dts: false, // Disabled due to openapi-parser type conflicts
|
|
9
|
+
sourcemap: true,
|
|
10
|
+
clean: true,
|
|
11
|
+
target: 'es2022',
|
|
12
|
+
outExtension: () => ({ js: '.mjs' }),
|
|
13
|
+
}),
|
|
14
|
+
// CLI build
|
|
15
|
+
defineConfig({
|
|
16
|
+
entry: ['src/cli.ts'],
|
|
17
|
+
format: ['esm'],
|
|
18
|
+
sourcemap: true,
|
|
19
|
+
target: 'es2022',
|
|
20
|
+
outExtension: () => ({ js: '.mjs' }),
|
|
21
|
+
banner: {
|
|
22
|
+
js: '#!/usr/bin/env node',
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
];
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# @github-to-mcp/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP server that exposes github-to-mcp functionality for AI assistants like Claude Desktop and Cursor.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This MCP server allows AI assistants to convert GitHub repositories into MCP servers on demand. It's the meta layer - using MCP to create MCP servers!
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install globally
|
|
13
|
+
npm install -g @github-to-mcp/mcp-server
|
|
14
|
+
|
|
15
|
+
# Or use npx
|
|
16
|
+
npx @github-to-mcp/mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
### Claude Desktop
|
|
22
|
+
|
|
23
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"github-to-mcp": {
|
|
29
|
+
"command": "npx",
|
|
30
|
+
"args": ["-y", "@github-to-mcp/mcp-server"],
|
|
31
|
+
"env": {
|
|
32
|
+
"GITHUB_TOKEN": "your-github-token"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Cursor
|
|
40
|
+
|
|
41
|
+
Add to `.cursor/mcp.json`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"github-to-mcp": {
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["-y", "@github-to-mcp/mcp-server"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Available Tools
|
|
55
|
+
|
|
56
|
+
### `convert_repo`
|
|
57
|
+
|
|
58
|
+
Convert a GitHub repository into a complete MCP server implementation.
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Arguments:
|
|
62
|
+
- github_url (required): The GitHub repository URL
|
|
63
|
+
- output_language: "typescript" or "python" (default: typescript)
|
|
64
|
+
- sources: Array of extraction sources to use
|
|
65
|
+
- github_token: GitHub token for private repos
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### `list_extracted_tools`
|
|
69
|
+
|
|
70
|
+
Preview what tools would be extracted from a repository without generating the full server.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Arguments:
|
|
74
|
+
- github_url (required): The GitHub repository URL
|
|
75
|
+
- sources: Array of extraction sources
|
|
76
|
+
- github_token: GitHub token (optional)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### `validate_mcp_server`
|
|
80
|
+
|
|
81
|
+
Validate MCP server code for correctness and best practices.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Arguments:
|
|
85
|
+
- code (required): The MCP server code to validate
|
|
86
|
+
- language (required): "typescript" or "python"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### `generate_claude_config`
|
|
90
|
+
|
|
91
|
+
Generate Claude Desktop configuration for an MCP server.
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Arguments:
|
|
95
|
+
- server_name (required): Name for the server
|
|
96
|
+
- server_path (required): Path to the server file
|
|
97
|
+
- language (required): "typescript" or "python"
|
|
98
|
+
- env_vars: Environment variables to pass
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `generate_cursor_config`
|
|
102
|
+
|
|
103
|
+
Generate Cursor IDE configuration for an MCP server.
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Arguments:
|
|
107
|
+
- server_name (required): Name for the server
|
|
108
|
+
- server_path (required): Path to the server file
|
|
109
|
+
- language (required): "typescript" or "python"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### `analyze_repo_structure`
|
|
113
|
+
|
|
114
|
+
Analyze a repository to identify extraction sources and capabilities.
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Arguments:
|
|
118
|
+
- github_url (required): The GitHub repository URL
|
|
119
|
+
- github_token: GitHub token (optional)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### `convert_openapi_to_mcp`
|
|
123
|
+
|
|
124
|
+
Convert an OpenAPI/Swagger specification directly to MCP tools.
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
Arguments:
|
|
128
|
+
- spec (required): The OpenAPI spec content (JSON or YAML)
|
|
129
|
+
- format: openapi, swagger, postman, insomnia, har, asyncapi, graphql
|
|
130
|
+
- base_url: Override base URL for API calls
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `get_tool_template`
|
|
134
|
+
|
|
135
|
+
Get a starter template for creating a new MCP tool.
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Arguments:
|
|
139
|
+
- tool_name (required): Name for the tool
|
|
140
|
+
- description (required): What the tool does
|
|
141
|
+
- parameters: Array of parameter definitions
|
|
142
|
+
- language: "typescript" or "python"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### `generate_openapi_spec`
|
|
146
|
+
|
|
147
|
+
Generate OpenAPI 3.1 specification from source code (reverse engineering).
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
Arguments:
|
|
151
|
+
- files (required): Array of source files to analyze
|
|
152
|
+
- path: File path
|
|
153
|
+
- content: File content
|
|
154
|
+
- format: Output format ("json", "yaml", or "both")
|
|
155
|
+
- options: Generation options
|
|
156
|
+
- title: API title
|
|
157
|
+
- version: API version
|
|
158
|
+
- baseUrl: Base URL for the API
|
|
159
|
+
- servers: Array of server configurations
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Example:**
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"files": [
|
|
166
|
+
{
|
|
167
|
+
"path": "routes/users.js",
|
|
168
|
+
"content": "app.get('/users', (req, res) => { ... })"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"format": "both",
|
|
172
|
+
"options": {
|
|
173
|
+
"title": "My API",
|
|
174
|
+
"version": "1.0.0"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### `export_docker`
|
|
180
|
+
|
|
181
|
+
Generate Docker configuration files for deploying an MCP server.
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
Arguments:
|
|
185
|
+
- language (required): "typescript" or "python"
|
|
186
|
+
- server_name: Custom name for the server (default: "mcp-server")
|
|
187
|
+
- port: Port number for the server
|
|
188
|
+
- include_healthcheck: Include Docker healthcheck (default: false)
|
|
189
|
+
- env_vars: Environment variables as key-value pairs
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Example:**
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"language": "typescript",
|
|
196
|
+
"server_name": "my-mcp-server",
|
|
197
|
+
"port": 3000,
|
|
198
|
+
"include_healthcheck": true,
|
|
199
|
+
"env_vars": {
|
|
200
|
+
"API_KEY": "secret",
|
|
201
|
+
"DEBUG": "true"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Returns Dockerfile, docker-compose.yml, and .dockerignore files.
|
|
207
|
+
|
|
208
|
+
### `stream_convert`
|
|
209
|
+
|
|
210
|
+
Convert a GitHub repository with real-time progress updates (streaming).
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
Arguments:
|
|
214
|
+
- github_url (required): GitHub repository URL
|
|
215
|
+
- output_language: "typescript" or "python"
|
|
216
|
+
- sources: Array of extraction sources
|
|
217
|
+
- github_token: GitHub token for private repos
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Returns a stream of progress events showing:
|
|
221
|
+
- Repository cloning
|
|
222
|
+
- File analysis
|
|
223
|
+
- Tool extraction
|
|
224
|
+
- Code generation
|
|
225
|
+
|
|
226
|
+
### `list_providers`
|
|
227
|
+
|
|
228
|
+
List all supported AI providers and their MCP configuration formats.
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
Arguments:
|
|
232
|
+
- include_examples: Include example configurations (default: true)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Returns information about:
|
|
236
|
+
- Claude Desktop
|
|
237
|
+
- Cursor
|
|
238
|
+
- VS Code Copilot
|
|
239
|
+
- Continue
|
|
240
|
+
- Cline
|
|
241
|
+
- Windsurf
|
|
242
|
+
- And more...
|
|
243
|
+
|
|
244
|
+
Each provider includes configuration path, format, and example setup.
|
|
245
|
+
|
|
246
|
+
## Available Resources
|
|
247
|
+
|
|
248
|
+
The server also provides documentation resources:
|
|
249
|
+
|
|
250
|
+
- `github-to-mcp://docs/quick-start` - Quick start guide
|
|
251
|
+
- `github-to-mcp://docs/extraction-sources` - Extraction source documentation
|
|
252
|
+
- `github-to-mcp://examples/typescript` - TypeScript MCP server example
|
|
253
|
+
- `github-to-mcp://examples/python` - Python MCP server example
|
|
254
|
+
|
|
255
|
+
## Example Usage
|
|
256
|
+
|
|
257
|
+
### With Claude Desktop
|
|
258
|
+
|
|
259
|
+
Once configured, you can ask Claude:
|
|
260
|
+
|
|
261
|
+
> "Convert the microsoft/playwright GitHub repo into an MCP server"
|
|
262
|
+
|
|
263
|
+
Claude will use the `convert_repo` tool to generate a complete MCP server implementation.
|
|
264
|
+
|
|
265
|
+
> "What tools can be extracted from the fastapi/fastapi repository?"
|
|
266
|
+
|
|
267
|
+
Claude will use `list_extracted_tools` to show you the available tools.
|
|
268
|
+
|
|
269
|
+
### Direct Execution
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# Run the MCP server
|
|
273
|
+
github-to-mcp-server
|
|
274
|
+
|
|
275
|
+
# With environment variables
|
|
276
|
+
GITHUB_TOKEN=your-token github-to-mcp-server
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Development
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Install dependencies
|
|
283
|
+
pnpm install
|
|
284
|
+
|
|
285
|
+
# Build
|
|
286
|
+
pnpm build
|
|
287
|
+
|
|
288
|
+
# Run in development
|
|
289
|
+
pnpm dev
|
|
290
|
+
|
|
291
|
+
# Run tests
|
|
292
|
+
pnpm test
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## License
|
|
296
|
+
|
|
297
|
+
MIT - See [LICENSE](../../LICENSE) for details.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@github-to-mcp/mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server exposing github-to-mcp functionality for AI assistants",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.mjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.mts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"github-to-mcp-server": "./dist/index.mjs"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"types": "./dist/index.d.mts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup",
|
|
23
|
+
"dev": "tsup --watch",
|
|
24
|
+
"start": "node dist/index.mjs",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"mcp",
|
|
31
|
+
"model-context-protocol",
|
|
32
|
+
"github",
|
|
33
|
+
"ai",
|
|
34
|
+
"tools",
|
|
35
|
+
"server"
|
|
36
|
+
],
|
|
37
|
+
"author": "nirholas",
|
|
38
|
+
"license": "Apache-2.0",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/nirholas/github-to-mcp"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@nirholas/github-to-mcp": "workspace:*",
|
|
45
|
+
"@github-to-mcp/openapi-parser": "workspace:*",
|
|
46
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
47
|
+
"zod": "^3.23.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^20.10.0",
|
|
51
|
+
"tsup": "^8.0.0",
|
|
52
|
+
"typescript": "^5.3.0",
|
|
53
|
+
"vitest": "^1.0.0"
|
|
54
|
+
}
|
|
55
|
+
}
|