@arkheia/mcp-server 0.1.1 → 0.1.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 +10 -4
- package/bin/arkheia-mcp.js +41 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ Free tier included (1,500 detections/month).
|
|
|
10
10
|
```bash
|
|
11
11
|
git clone https://github.com/arkheiaai/arkheia-mcp.git ~/.arkheia-mcp
|
|
12
12
|
cd ~/.arkheia-mcp
|
|
13
|
+
python -m venv .venv
|
|
14
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
13
15
|
pip install -r requirements.txt
|
|
14
16
|
```
|
|
15
17
|
|
|
@@ -31,7 +33,7 @@ Edit your config file:
|
|
|
31
33
|
{
|
|
32
34
|
"mcpServers": {
|
|
33
35
|
"arkheia": {
|
|
34
|
-
"command": "python",
|
|
36
|
+
"command": "~/.arkheia-mcp/.venv/bin/python",
|
|
35
37
|
"args": ["-m", "mcp_server.server"],
|
|
36
38
|
"cwd": "~/.arkheia-mcp",
|
|
37
39
|
"env": {
|
|
@@ -43,11 +45,15 @@ Edit your config file:
|
|
|
43
45
|
}
|
|
44
46
|
```
|
|
45
47
|
|
|
46
|
-
On Windows, replace `~/.arkheia-mcp` with the full path (e.g. `C:/Users/YourName/.arkheia-mcp`)
|
|
48
|
+
On Windows, replace `~/.arkheia-mcp` with the full path using forward slashes (e.g. `C:/Users/YourName/.arkheia-mcp`) and use `.venv/Scripts/python` instead of `.venv/bin/python`.
|
|
47
49
|
|
|
48
|
-
### 4. Restart Claude
|
|
50
|
+
### 4. Restart Claude and verify
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
Restart Claude Desktop (quit and reopen, not just close window). The Arkheia tools will appear automatically.
|
|
53
|
+
|
|
54
|
+
To verify, ask Claude: *"Use arkheia_verify to check this response for fabrication: 'The Eiffel Tower is located in Berlin, Germany.'"*
|
|
55
|
+
|
|
56
|
+
You should see a detection result with a risk level and confidence score.
|
|
51
57
|
|
|
52
58
|
## Tools
|
|
53
59
|
|
package/bin/arkheia-mcp.js
CHANGED
|
@@ -22,13 +22,47 @@ const { spawn, execSync } = require("child_process");
|
|
|
22
22
|
const path = require("path");
|
|
23
23
|
const fs = require("fs");
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
const REQUIREMENTS = path.join(PYTHON_DIR, "requirements.txt");
|
|
27
|
-
const VENV_DIR = path.join(
|
|
25
|
+
const ARKHEIA_HOME = path.join(
|
|
28
26
|
process.env.HOME || process.env.USERPROFILE || "/tmp",
|
|
29
|
-
".arkheia"
|
|
30
|
-
"venv"
|
|
27
|
+
".arkheia"
|
|
31
28
|
);
|
|
29
|
+
const REPO_DIR = path.join(ARKHEIA_HOME, "mcp");
|
|
30
|
+
const BUNDLED_PYTHON_DIR = path.join(__dirname, "..", "python");
|
|
31
|
+
const VENV_DIR = path.join(ARKHEIA_HOME, "venv");
|
|
32
|
+
|
|
33
|
+
// Determine the real Python source: cloned repo > bundled package
|
|
34
|
+
function getServerDir() {
|
|
35
|
+
// If repo already cloned, use it
|
|
36
|
+
if (fs.existsSync(path.join(REPO_DIR, "mcp_server", "server.py"))) {
|
|
37
|
+
return REPO_DIR;
|
|
38
|
+
}
|
|
39
|
+
// If bundled package has the server code, use it
|
|
40
|
+
if (fs.existsSync(path.join(BUNDLED_PYTHON_DIR, "mcp_server", "server.py"))) {
|
|
41
|
+
return BUNDLED_PYTHON_DIR;
|
|
42
|
+
}
|
|
43
|
+
// Neither exists — clone the repo
|
|
44
|
+
process.stderr.write("[arkheia] Server code not found. Cloning from GitHub...\n");
|
|
45
|
+
try {
|
|
46
|
+
if (!fs.existsSync(ARKHEIA_HOME)) fs.mkdirSync(ARKHEIA_HOME, { recursive: true });
|
|
47
|
+
execSync(`git clone --depth 1 https://github.com/arkheiaai/arkheia-mcp.git "${REPO_DIR}"`, {
|
|
48
|
+
stdio: "inherit",
|
|
49
|
+
timeout: 60000,
|
|
50
|
+
});
|
|
51
|
+
process.stderr.write("[arkheia] Repository cloned successfully.\n");
|
|
52
|
+
return REPO_DIR;
|
|
53
|
+
} catch (err) {
|
|
54
|
+
process.stderr.write(
|
|
55
|
+
`[arkheia] Error: Could not clone repository: ${err.message}\n` +
|
|
56
|
+
"Manual install: git clone https://github.com/arkheiaai/arkheia-mcp.git ~/.arkheia/mcp\n"
|
|
57
|
+
);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const PYTHON_DIR = getServerDir();
|
|
63
|
+
const REQUIREMENTS = fs.existsSync(path.join(PYTHON_DIR, "mcp_server", "requirements.txt"))
|
|
64
|
+
? path.join(PYTHON_DIR, "mcp_server", "requirements.txt")
|
|
65
|
+
: path.join(PYTHON_DIR, "requirements.txt");
|
|
32
66
|
|
|
33
67
|
function findPython() {
|
|
34
68
|
const candidates = ["python3", "python"];
|
|
@@ -139,16 +173,15 @@ function main() {
|
|
|
139
173
|
}
|
|
140
174
|
|
|
141
175
|
// Spawn the MCP server with stdio transport
|
|
142
|
-
const serverDir = PYTHON_DIR;
|
|
143
176
|
const child = spawn(
|
|
144
177
|
venvPython,
|
|
145
178
|
["-m", "mcp_server.server"],
|
|
146
179
|
{
|
|
147
|
-
cwd:
|
|
180
|
+
cwd: PYTHON_DIR,
|
|
148
181
|
stdio: ["pipe", "pipe", "inherit"], // stdin/stdout piped, stderr inherited
|
|
149
182
|
env: {
|
|
150
183
|
...process.env,
|
|
151
|
-
PYTHONPATH:
|
|
184
|
+
PYTHONPATH: PYTHON_DIR,
|
|
152
185
|
},
|
|
153
186
|
}
|
|
154
187
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkheia/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"mcpName": "io.github.arkheiaai/mcp-server",
|
|
5
5
|
"description": "Arkheia MCP Server — Fabrication detection for LLM outputs. Detect hallucination in any model's output with a single tool call.",
|
|
6
6
|
"bin": {
|