semcode-mcp 0.1.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.
Files changed (3) hide show
  1. package/README.md +23 -0
  2. package/bin.js +62 -0
  3. package/package.json +31 -0
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # semcode-mcp (npm wrapper)
2
+
3
+ Thin `npx` wrapper for the [semantic-code-mcp](https://github.com/huawang1258/semantic-code-mcp) Python MCP server (published as `semcode-mcp`). It launches the PyPI package via `uvx` (or a `pip`-installed console script).
4
+
5
+ **Prerequisite**: [uv](https://docs.astral.sh/uv/getting-started/installation/) or `pip install semcode-mcp`.
6
+
7
+ ## MCP client config
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "semantic-code": {
13
+ "command": "npx",
14
+ "args": ["-y", "semcode-mcp"],
15
+ "env": {
16
+ "VOYAGE_API_KEY": "your-voyage-key"
17
+ }
18
+ }
19
+ }
20
+ }
21
+ ```
22
+
23
+ Full docs: https://github.com/huawang1258/semantic-code-mcp
package/bin.js ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * semcode-mcp npm 薄壳:把 MCP server 启动透传给 Python 包。
4
+ *
5
+ * 解析顺序:
6
+ * 1. uvx semcode-mcp (推荐:uv 自动管理隔离环境)
7
+ * 2. semcode-mcp (已 pip install 的 console script)
8
+ * 都不可用时打印安装指引退出。
9
+ *
10
+ * stdio 直通(MCP 协议走 stdin/stdout),信号与退出码原样转发。
11
+ */
12
+ "use strict";
13
+
14
+ const { spawnSync, spawn } = require("node:child_process");
15
+
16
+ const PYPI_PACKAGE = "semcode-mcp";
17
+
18
+ function exists(cmd) {
19
+ const probe = process.platform === "win32" ? "where" : "which";
20
+ return spawnSync(probe, [cmd], { stdio: "ignore" }).status === 0;
21
+ }
22
+
23
+ function main() {
24
+ const args = process.argv.slice(2);
25
+ let file = null;
26
+ let fileArgs = [];
27
+
28
+ if (exists("uvx")) {
29
+ file = "uvx";
30
+ fileArgs = [PYPI_PACKAGE, ...args];
31
+ } else if (exists(PYPI_PACKAGE)) {
32
+ file = PYPI_PACKAGE;
33
+ fileArgs = args;
34
+ } else {
35
+ process.stderr.write(
36
+ [
37
+ `semcode-mcp: no Python runtime launcher found.`,
38
+ ``,
39
+ `Install one of:`,
40
+ ` 1. uv (recommended): https://docs.astral.sh/uv/getting-started/installation/`,
41
+ ` then this wrapper runs: uvx ${PYPI_PACKAGE}`,
42
+ ` 2. pip install ${PYPI_PACKAGE}`,
43
+ ``,
44
+ ].join("\n")
45
+ );
46
+ process.exit(1);
47
+ }
48
+
49
+ const child = spawn(file, fileArgs, { stdio: "inherit" });
50
+ for (const sig of ["SIGINT", "SIGTERM"]) {
51
+ process.on(sig, () => child.kill(sig));
52
+ }
53
+ child.on("exit", (code, signal) => {
54
+ process.exit(signal ? 1 : code ?? 0);
55
+ });
56
+ child.on("error", (err) => {
57
+ process.stderr.write(`semcode-mcp: failed to launch ${file}: ${err.message}\n`);
58
+ process.exit(1);
59
+ });
60
+ }
61
+
62
+ main();
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "semcode-mcp",
3
+ "version": "0.1.0",
4
+ "description": "Semantic code search MCP server: Tree-sitter AST chunking + voyage-code-3 embeddings + hybrid retrieval (sqlite-vec + FTS5 + RRF) + Voyage rerank-2.5 + call graph expansion. Thin npx wrapper that launches the Python package via uvx.",
5
+ "bin": {
6
+ "semcode-mcp": "bin.js"
7
+ },
8
+ "files": [
9
+ "bin.js",
10
+ "README.md"
11
+ ],
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "keywords": [
16
+ "mcp",
17
+ "mcp-server",
18
+ "semantic-search",
19
+ "code-search",
20
+ "rag",
21
+ "tree-sitter",
22
+ "embeddings"
23
+ ],
24
+ "author": "huawang1258",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/huawang1258/semantic-code-mcp.git"
29
+ },
30
+ "homepage": "https://github.com/huawang1258/semantic-code-mcp#readme"
31
+ }