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.
- package/README.md +32 -1
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +60 -0
- package/dist/chunk-HOWO4K5A.js +2197 -0
- package/dist/chunk-S7G4OHA4.js +8306 -0
- package/dist/db-YDGUWI5K.js +7 -0
- package/dist/index.d.ts +205 -3
- package/dist/index.js +28 -16
- package/package.json +16 -6
- package/dist/config/compact-version.d.ts +0 -183
- package/dist/config/compact-version.js +0 -423
- package/dist/db/index.d.ts +0 -3
- package/dist/db/index.js +0 -2
- package/dist/db/vectorStore.d.ts +0 -69
- package/dist/db/vectorStore.js +0 -196
- package/dist/pipeline/embeddings.d.ts +0 -25
- package/dist/pipeline/embeddings.js +0 -103
- package/dist/pipeline/github.d.ts +0 -84
- package/dist/pipeline/github.js +0 -399
- package/dist/pipeline/index.d.ts +0 -11
- package/dist/pipeline/index.js +0 -6
- package/dist/pipeline/indexer.d.ts +0 -41
- package/dist/pipeline/indexer.js +0 -254
- package/dist/pipeline/parser.d.ts +0 -46
- package/dist/pipeline/parser.js +0 -436
- package/dist/pipeline/releases.d.ts +0 -112
- package/dist/pipeline/releases.js +0 -298
- package/dist/pipeline/repository.d.ts +0 -372
- package/dist/pipeline/repository.js +0 -520
- package/dist/prompts/index.d.ts +0 -3
- package/dist/prompts/index.js +0 -2
- package/dist/prompts/templates.d.ts +0 -26
- package/dist/prompts/templates.js +0 -443
- package/dist/resources/code.d.ts +0 -15
- package/dist/resources/code.js +0 -122
- package/dist/resources/content/code-content.d.ts +0 -6
- package/dist/resources/content/code-content.js +0 -802
- package/dist/resources/content/docs-content.d.ts +0 -14
- package/dist/resources/content/docs-content.js +0 -1202
- package/dist/resources/content/index.d.ts +0 -6
- package/dist/resources/content/index.js +0 -6
- package/dist/resources/docs.d.ts +0 -15
- package/dist/resources/docs.js +0 -98
- package/dist/resources/index.d.ts +0 -6
- package/dist/resources/index.js +0 -13
- package/dist/resources/schemas.d.ts +0 -16
- package/dist/resources/schemas.js +0 -407
- package/dist/scripts/index-repos.d.ts +0 -12
- package/dist/scripts/index-repos.js +0 -53
- package/dist/server.d.ts +0 -43
- package/dist/server.js +0 -696
- package/dist/services/index.d.ts +0 -6
- package/dist/services/index.js +0 -6
- package/dist/services/sampling.d.ts +0 -62
- package/dist/services/sampling.js +0 -277
- package/dist/tools/analyze.d.ts +0 -106
- package/dist/tools/analyze.js +0 -431
- package/dist/tools/generation.d.ts +0 -9
- package/dist/tools/generation.js +0 -285
- package/dist/tools/health.d.ts +0 -120
- package/dist/tools/health.js +0 -365
- package/dist/tools/index.d.ts +0 -14
- package/dist/tools/index.js +0 -22
- package/dist/tools/meta.d.ts +0 -61
- package/dist/tools/meta.js +0 -282
- package/dist/tools/repository/constants.d.ts +0 -19
- package/dist/tools/repository/constants.js +0 -324
- package/dist/tools/repository/handlers.d.ts +0 -373
- package/dist/tools/repository/handlers.js +0 -724
- package/dist/tools/repository/index.d.ts +0 -9
- package/dist/tools/repository/index.js +0 -13
- package/dist/tools/repository/schemas.d.ts +0 -153
- package/dist/tools/repository/schemas.js +0 -106
- package/dist/tools/repository/tools.d.ts +0 -7
- package/dist/tools/repository/tools.js +0 -484
- package/dist/tools/repository/validation.d.ts +0 -106
- package/dist/tools/repository/validation.js +0 -820
- package/dist/tools/repository.d.ts +0 -6
- package/dist/tools/repository.js +0 -7
- package/dist/tools/search.d.ts +0 -76
- package/dist/tools/search.js +0 -423
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.js +0 -2
- package/dist/types/mcp.d.ts +0 -187
- package/dist/types/mcp.js +0 -6
- package/dist/utils/cache.d.ts +0 -77
- package/dist/utils/cache.js +0 -172
- package/dist/utils/config.d.ts +0 -70
- package/dist/utils/config.js +0 -294
- package/dist/utils/errors.d.ts +0 -111
- package/dist/utils/errors.js +0 -165
- package/dist/utils/health.d.ts +0 -29
- package/dist/utils/health.js +0 -132
- package/dist/utils/hosted-api.d.ts +0 -67
- package/dist/utils/hosted-api.js +0 -119
- package/dist/utils/index.d.ts +0 -16
- package/dist/utils/index.js +0 -15
- package/dist/utils/logger.d.ts +0 -48
- package/dist/utils/logger.js +0 -124
- package/dist/utils/rate-limit.d.ts +0 -61
- package/dist/utils/rate-limit.js +0 -148
- package/dist/utils/validation.d.ts +0 -52
- 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
|