midnight-mcp 0.1.41 → 0.2.2

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.
Files changed (103) hide show
  1. package/README.md +32 -1
  2. package/dist/bin.d.ts +1 -0
  3. package/dist/bin.js +60 -0
  4. package/dist/chunk-HOWO4K5A.js +2197 -0
  5. package/dist/chunk-S7G4OHA4.js +8306 -0
  6. package/dist/db-YDGUWI5K.js +7 -0
  7. package/dist/index.d.ts +205 -3
  8. package/dist/index.js +28 -16
  9. package/package.json +16 -6
  10. package/dist/config/compact-version.d.ts +0 -183
  11. package/dist/config/compact-version.js +0 -423
  12. package/dist/db/index.d.ts +0 -3
  13. package/dist/db/index.js +0 -2
  14. package/dist/db/vectorStore.d.ts +0 -69
  15. package/dist/db/vectorStore.js +0 -196
  16. package/dist/pipeline/embeddings.d.ts +0 -25
  17. package/dist/pipeline/embeddings.js +0 -103
  18. package/dist/pipeline/github.d.ts +0 -84
  19. package/dist/pipeline/github.js +0 -399
  20. package/dist/pipeline/index.d.ts +0 -11
  21. package/dist/pipeline/index.js +0 -6
  22. package/dist/pipeline/indexer.d.ts +0 -41
  23. package/dist/pipeline/indexer.js +0 -254
  24. package/dist/pipeline/parser.d.ts +0 -46
  25. package/dist/pipeline/parser.js +0 -436
  26. package/dist/pipeline/releases.d.ts +0 -112
  27. package/dist/pipeline/releases.js +0 -298
  28. package/dist/pipeline/repository.d.ts +0 -372
  29. package/dist/pipeline/repository.js +0 -520
  30. package/dist/prompts/index.d.ts +0 -3
  31. package/dist/prompts/index.js +0 -2
  32. package/dist/prompts/templates.d.ts +0 -26
  33. package/dist/prompts/templates.js +0 -443
  34. package/dist/resources/code.d.ts +0 -15
  35. package/dist/resources/code.js +0 -122
  36. package/dist/resources/content/code-content.d.ts +0 -6
  37. package/dist/resources/content/code-content.js +0 -802
  38. package/dist/resources/content/docs-content.d.ts +0 -14
  39. package/dist/resources/content/docs-content.js +0 -1202
  40. package/dist/resources/content/index.d.ts +0 -6
  41. package/dist/resources/content/index.js +0 -6
  42. package/dist/resources/docs.d.ts +0 -15
  43. package/dist/resources/docs.js +0 -98
  44. package/dist/resources/index.d.ts +0 -6
  45. package/dist/resources/index.js +0 -13
  46. package/dist/resources/schemas.d.ts +0 -16
  47. package/dist/resources/schemas.js +0 -407
  48. package/dist/scripts/index-repos.d.ts +0 -12
  49. package/dist/scripts/index-repos.js +0 -53
  50. package/dist/server.d.ts +0 -43
  51. package/dist/server.js +0 -696
  52. package/dist/services/index.d.ts +0 -6
  53. package/dist/services/index.js +0 -6
  54. package/dist/services/sampling.d.ts +0 -62
  55. package/dist/services/sampling.js +0 -277
  56. package/dist/tools/analyze.d.ts +0 -106
  57. package/dist/tools/analyze.js +0 -431
  58. package/dist/tools/generation.d.ts +0 -9
  59. package/dist/tools/generation.js +0 -285
  60. package/dist/tools/health.d.ts +0 -120
  61. package/dist/tools/health.js +0 -365
  62. package/dist/tools/index.d.ts +0 -14
  63. package/dist/tools/index.js +0 -22
  64. package/dist/tools/meta.d.ts +0 -61
  65. package/dist/tools/meta.js +0 -282
  66. package/dist/tools/repository/constants.d.ts +0 -19
  67. package/dist/tools/repository/constants.js +0 -324
  68. package/dist/tools/repository/handlers.d.ts +0 -373
  69. package/dist/tools/repository/handlers.js +0 -724
  70. package/dist/tools/repository/index.d.ts +0 -9
  71. package/dist/tools/repository/index.js +0 -13
  72. package/dist/tools/repository/schemas.d.ts +0 -153
  73. package/dist/tools/repository/schemas.js +0 -106
  74. package/dist/tools/repository/tools.d.ts +0 -7
  75. package/dist/tools/repository/tools.js +0 -484
  76. package/dist/tools/repository/validation.d.ts +0 -106
  77. package/dist/tools/repository/validation.js +0 -820
  78. package/dist/tools/repository.d.ts +0 -6
  79. package/dist/tools/repository.js +0 -7
  80. package/dist/tools/search.d.ts +0 -76
  81. package/dist/tools/search.js +0 -423
  82. package/dist/types/index.d.ts +0 -2
  83. package/dist/types/index.js +0 -2
  84. package/dist/types/mcp.d.ts +0 -187
  85. package/dist/types/mcp.js +0 -6
  86. package/dist/utils/cache.d.ts +0 -77
  87. package/dist/utils/cache.js +0 -172
  88. package/dist/utils/config.d.ts +0 -70
  89. package/dist/utils/config.js +0 -294
  90. package/dist/utils/errors.d.ts +0 -111
  91. package/dist/utils/errors.js +0 -165
  92. package/dist/utils/health.d.ts +0 -29
  93. package/dist/utils/health.js +0 -132
  94. package/dist/utils/hosted-api.d.ts +0 -67
  95. package/dist/utils/hosted-api.js +0 -119
  96. package/dist/utils/index.d.ts +0 -16
  97. package/dist/utils/index.js +0 -15
  98. package/dist/utils/logger.d.ts +0 -48
  99. package/dist/utils/logger.js +0 -124
  100. package/dist/utils/rate-limit.d.ts +0 -61
  101. package/dist/utils/rate-limit.js +0 -148
  102. package/dist/utils/validation.d.ts +0 -52
  103. package/dist/utils/validation.js +0 -255
package/README.md CHANGED
@@ -176,6 +176,38 @@ The API indexes **39 Midnight repositories**:
176
176
 
177
177
  ## Advanced Configuration
178
178
 
179
+ ### HTTP Mode
180
+
181
+ Run as an HTTP server for web integrations or remote deployment:
182
+
183
+ ```bash
184
+ # Start HTTP server on port 3000
185
+ npx midnight-mcp --http --port 3000
186
+ ```
187
+
188
+ Endpoints:
189
+
190
+ - `/health` - Health check
191
+ - `/mcp` - Streamable HTTP (MCP protocol)
192
+ - `/sse` - Server-Sent Events
193
+
194
+ ### CLI Options
195
+
196
+ ```bash
197
+ npx midnight-mcp --help
198
+
199
+ Options:
200
+ --stdio Use stdio transport (default, for Claude Desktop)
201
+ --http Use HTTP transport with SSE support
202
+ --port <number> HTTP port (default: 3000)
203
+ --json Output in JSON (default: YAML for better LLM efficiency)
204
+ --github-token GitHub token (overrides GITHUB_TOKEN env var)
205
+ -h, --help Show help
206
+ -v, --version Show version
207
+ ```
208
+
209
+ > **Why YAML by default?** YAML is ~20-30% more token-efficient than JSON, which means AI assistants can process more context from tool responses.
210
+
179
211
  ### Local Mode
180
212
 
181
213
  Run everything locally for privacy or offline use:
@@ -225,5 +257,4 @@ The hosted API runs on Cloudflare Workers + Vectorize. See [api/README.md](./api
225
257
 
226
258
  MIT
227
259
 
228
-
229
260
  Thanks to all Stargazers ⭐️
package/dist/bin.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/bin.js ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ startHttpServer,
4
+ startServer
5
+ } from "./chunk-S7G4OHA4.js";
6
+ import {
7
+ setOutputFormat
8
+ } from "./chunk-HOWO4K5A.js";
9
+
10
+ // src/bin.ts
11
+ import { config } from "dotenv";
12
+ import { resolve } from "path";
13
+ import yargs from "yargs";
14
+ import { hideBin } from "yargs/helpers";
15
+ config({ path: resolve(process.cwd(), ".env") });
16
+ var CURRENT_VERSION = "0.2.2";
17
+ process.on("uncaughtException", (error) => {
18
+ console.error("Uncaught exception:", error);
19
+ process.exit(1);
20
+ });
21
+ process.on("unhandledRejection", (reason) => {
22
+ console.error("Unhandled rejection:", reason);
23
+ process.exit(1);
24
+ });
25
+ var argv = yargs(hideBin(process.argv)).scriptName("midnight-mcp").usage("$0 [options]").option("http", {
26
+ type: "boolean",
27
+ description: "Use HTTP transport with SSE support",
28
+ default: false
29
+ }).option("port", {
30
+ type: "number",
31
+ description: "HTTP port (when using --http)",
32
+ default: 3e3
33
+ }).option("github-token", {
34
+ type: "string",
35
+ description: "GitHub token for API access (overrides GITHUB_TOKEN env var)"
36
+ }).option("json", {
37
+ type: "boolean",
38
+ description: "Output results in JSON format (default: YAML for better LLM efficiency)",
39
+ default: false
40
+ }).example(
41
+ "$0 --stdio",
42
+ "Start server with stdio transport (for Claude Desktop)"
43
+ ).example("$0 --http --port 3000", "Start HTTP server on port 3000").help().alias("h", "help").version(CURRENT_VERSION).alias("v", "version").strict().parseSync();
44
+ if (argv["github-token"]) {
45
+ process.env.GITHUB_TOKEN = argv["github-token"];
46
+ }
47
+ setOutputFormat(argv.json);
48
+ var useHttp = argv.http;
49
+ async function main() {
50
+ if (useHttp) {
51
+ await startHttpServer(argv.port);
52
+ } else {
53
+ await startServer();
54
+ }
55
+ }
56
+ main().catch((error) => {
57
+ console.error("Failed to start server:", error);
58
+ process.exit(1);
59
+ });
60
+ //# sourceMappingURL=bin.js.map