midnight-mcp 0.0.7 → 0.0.9
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 +15 -1
- package/dist/tools/repository.js +5 -3
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Midnight MCP Server
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/midnight-mcp)
|
|
4
|
-
[](https://www.npmjs.com/package/midnight-mcp)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
5
7
|
[](https://github.com/Olanetsoft/midnight-mcp/actions/workflows/ci.yml)
|
|
6
8
|
|
|
7
9
|
MCP server that gives AI assistants access to Midnight blockchain—search contracts, analyze code, and explore documentation.
|
|
@@ -89,6 +91,8 @@ By default, the MCP uses a **hosted API** for semantic search:
|
|
|
89
91
|
- ✅ **Semantic search** works immediately
|
|
90
92
|
- ✅ **No API keys** needed
|
|
91
93
|
|
|
94
|
+
> **📊 Quality Metrics**: To ensure the MCP stays accurate as Midnight's codebase evolves rapidly, we collect anonymous usage metrics (query counts, relevance scores) to monitor search quality. No query content or personal data is stored. This helps us identify when re-indexing is needed and improve results over time.
|
|
95
|
+
|
|
92
96
|
### Local Mode (Optional)
|
|
93
97
|
|
|
94
98
|
Run everything locally for privacy or offline use:
|
|
@@ -186,6 +190,16 @@ MIDNIGHT_API_URL=http://localhost:8787 npm start
|
|
|
186
190
|
|
|
187
191
|
The hosted API runs on Cloudflare Workers + Vectorize. See [api/README.md](./api/README.md) for deployment and development instructions.
|
|
188
192
|
|
|
193
|
+
### Search Quality
|
|
194
|
+
|
|
195
|
+
The API uses several techniques to improve search relevance:
|
|
196
|
+
|
|
197
|
+
- **Optimized chunking** — 1000-char chunks with 200-char overlap for precise, contextual results
|
|
198
|
+
- **Hybrid search** — Combines vector similarity with keyword boosting (up to 20% boost for exact matches)
|
|
199
|
+
- **Incremental indexing** — Daily updates via tarball download + batch embeddings (~5 min)
|
|
200
|
+
|
|
201
|
+
View live metrics at the [Dashboard](https://midnight-mcp-api.midnightmcp.workers.dev/dashboard).
|
|
202
|
+
|
|
189
203
|
## License
|
|
190
204
|
|
|
191
205
|
MIT
|
package/dist/tools/repository.js
CHANGED
|
@@ -171,7 +171,9 @@ const EXAMPLES = [
|
|
|
171
171
|
* Resolve repository name alias to owner/repo
|
|
172
172
|
*/
|
|
173
173
|
function resolveRepo(repoName) {
|
|
174
|
-
|
|
174
|
+
// Default to compact if not provided
|
|
175
|
+
const name = repoName || "compact";
|
|
176
|
+
const normalized = name.toLowerCase().replace(/^midnightntwrk\//, "");
|
|
175
177
|
const alias = REPO_ALIASES[normalized];
|
|
176
178
|
if (alias)
|
|
177
179
|
return alias;
|
|
@@ -182,8 +184,8 @@ function resolveRepo(repoName) {
|
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
// Assume it's a full org/repo name
|
|
185
|
-
if (
|
|
186
|
-
const [owner, repo] =
|
|
187
|
+
if (name.includes("/")) {
|
|
188
|
+
const [owner, repo] = name.split("/");
|
|
187
189
|
return { owner, repo };
|
|
188
190
|
}
|
|
189
191
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "midnight-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Model Context Protocol Server for Midnight Blockchain Development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^20.10.0",
|
|
41
|
+
"@types/tar": "^6.1.13",
|
|
41
42
|
"prettier": "^3.1.0",
|
|
43
|
+
"tar": "^7.5.2",
|
|
42
44
|
"tsx": "^4.6.2",
|
|
43
45
|
"typescript": "^5.3.2",
|
|
44
46
|
"vitest": "^1.0.0"
|