jishie-gate 0.0.0-stage → 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.
- package/README.md +60 -2
- package/action.yml +33 -0
- package/index.mjs +128 -0
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -1,3 +1,61 @@
|
|
|
1
|
-
#
|
|
1
|
+
# jishie-gate
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Check the MCP servers your project uses before your agents do.
|
|
4
|
+
|
|
5
|
+
`jishie-gate` reads the remote servers from your MCP client config (`.mcp.json`, `mcp.json`,
|
|
6
|
+
`.cursor/mcp.json`, `.vscode/mcp.json`), asks the [jishie](https://jishie.com) index about each one, and
|
|
7
|
+
exits non-zero if any fails your rules. Put it in CI and a pull request that adds an unknown, dead or
|
|
8
|
+
flagged server fails its check.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx jishie-gate
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
PASS search https://search.example.dev/mcp
|
|
16
|
+
FAIL notes https://notes.example.dev/mcp
|
|
17
|
+
- flagged: tool_text_model_instruction
|
|
18
|
+
FAIL internal https://mcp.internal.example/mcp
|
|
19
|
+
- not in the jishie index — nothing is known about it
|
|
20
|
+
skipped (local, no network endpoint to measure): filesystem (.mcp.json)
|
|
21
|
+
|
|
22
|
+
1/3 pass · policy: tier ≥ T2, flags ≤ minor
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## What is checked
|
|
26
|
+
|
|
27
|
+
For each server, from what jishie measured by connecting to it (re-probed hourly):
|
|
28
|
+
|
|
29
|
+
- **reachable** — did it answer its last probe
|
|
30
|
+
- **tier** — indexed (T0), reachable and profiled (T1), probed over time and scored (T2), verified (T3)
|
|
31
|
+
- **flags** — including the tool-description scan: invisible characters, instructions aimed at the calling
|
|
32
|
+
model ("ignore previous instructions", "do not tell the user"), credential paths
|
|
33
|
+
- **identity** — optional: the operator proved control of the domain
|
|
34
|
+
|
|
35
|
+
A server jishie does not know **fails** — unknown is never a pass. Local (command-based) servers are
|
|
36
|
+
listed as skipped: there is no network endpoint to measure.
|
|
37
|
+
|
|
38
|
+
## Options
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
jishie-gate [files…] [--min-tier 0-3] [--min-score 0-100] [--max-flag none|minor|major|critical]
|
|
42
|
+
[--require-identity] [--allow-unreachable] [--json]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Free for up to 10 servers per run. For more, set `JISHIE_TOKEN` to a plan token
|
|
46
|
+
(<https://jishie.com/pricing.html>). Team and Business plans also *monitor* a saved list continuously and
|
|
47
|
+
send a webhook when a server stops passing.
|
|
48
|
+
|
|
49
|
+
## GitHub Actions
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- uses: actions/setup-node@v4
|
|
54
|
+
with: { node-version: 20 }
|
|
55
|
+
- run: npx jishie-gate --max-flag none
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## What it is not
|
|
59
|
+
|
|
60
|
+
A pass means nothing measured counts against your policy. It is not a security audit of the server's
|
|
61
|
+
code, and the tool-description scan is a pattern match with quoted evidence, not a verdict.
|
package/action.yml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: jishie MCP gate
|
|
2
|
+
description: Fail the check when an MCP server in your repo's client config is unknown, down, or flagged (hidden instructions in tool descriptions).
|
|
3
|
+
branding:
|
|
4
|
+
icon: shield
|
|
5
|
+
color: blue
|
|
6
|
+
inputs:
|
|
7
|
+
files:
|
|
8
|
+
description: MCP config files to check, space-separated. Default - .mcp.json, mcp.json, .cursor/mcp.json, .vscode/mcp.json
|
|
9
|
+
required: false
|
|
10
|
+
default: ''
|
|
11
|
+
min-tier:
|
|
12
|
+
description: Minimum jishie tier (0 indexed, 1 reachable, 2 probed and scored, 3 verified)
|
|
13
|
+
required: false
|
|
14
|
+
default: '2'
|
|
15
|
+
max-flag:
|
|
16
|
+
description: Worst flag severity allowed - none, minor, major or critical
|
|
17
|
+
required: false
|
|
18
|
+
default: minor
|
|
19
|
+
token:
|
|
20
|
+
description: A jishie plan token, needed only for more than 10 servers
|
|
21
|
+
required: false
|
|
22
|
+
default: ''
|
|
23
|
+
runs:
|
|
24
|
+
using: composite
|
|
25
|
+
steps:
|
|
26
|
+
- shell: bash
|
|
27
|
+
env:
|
|
28
|
+
JISHIE_TOKEN: ${{ inputs.token }}
|
|
29
|
+
GATE_FILES: ${{ inputs.files }}
|
|
30
|
+
GATE_MIN_TIER: ${{ inputs.min-tier }}
|
|
31
|
+
GATE_MAX_FLAG: ${{ inputs.max-flag }}
|
|
32
|
+
# inputs reach the script only through the environment (never interpolated into the command line)
|
|
33
|
+
run: node "${{ github.action_path }}/index.mjs" $GATE_FILES --min-tier "$GATE_MIN_TIER" --max-flag "$GATE_MAX_FLAG"
|
package/index.mjs
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// jishie-gate — check the MCP servers in your project against the jishie index, in CI or locally.
|
|
3
|
+
//
|
|
4
|
+
// npx jishie-gate # finds .mcp.json, .cursor/mcp.json, .vscode/mcp.json, mcp.json
|
|
5
|
+
// npx jishie-gate path/to/mcp.json # or name the files
|
|
6
|
+
// npx jishie-gate --min-tier 2 --max-flag none --require-identity
|
|
7
|
+
//
|
|
8
|
+
// It reads the REMOTE servers (entries with a url) from your MCP client config, asks jishie whether each
|
|
9
|
+
// one passes your rules, prints why not, and exits 1 if any fail — so a pull request that adds an
|
|
10
|
+
// unknown, dead or flagged server fails its check. Local (command-based) servers are listed as skipped:
|
|
11
|
+
// jishie can only measure what has a network endpoint. Zero dependencies. Free for up to 10 servers.
|
|
12
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs'
|
|
13
|
+
import path from 'node:path'
|
|
14
|
+
import { fileURLToPath } from 'node:url'
|
|
15
|
+
|
|
16
|
+
const DEFAULT_FILES = ['.mcp.json', 'mcp.json', '.cursor/mcp.json', '.vscode/mcp.json']
|
|
17
|
+
const API = (process.env.JISHIE_API ?? 'https://jishie.com').replace(/\/$/, '')
|
|
18
|
+
|
|
19
|
+
function parseArgs(argv) {
|
|
20
|
+
const files = []
|
|
21
|
+
const policy = {}
|
|
22
|
+
let json = false
|
|
23
|
+
for (let i = 0; i < argv.length; i++) {
|
|
24
|
+
const a = argv[i]
|
|
25
|
+
if (a === '--json') json = true
|
|
26
|
+
else if (a === '--min-tier') policy.min_tier = Number(argv[++i])
|
|
27
|
+
else if (a === '--min-score') policy.min_score = Number(argv[++i])
|
|
28
|
+
else if (a === '--max-flag') policy.max_flag_severity = String(argv[++i])
|
|
29
|
+
else if (a === '--require-identity') policy.require_identity_verified = true
|
|
30
|
+
else if (a === '--allow-unreachable') policy.require_reachable = false
|
|
31
|
+
else if (a === '-h' || a === '--help') return { help: true }
|
|
32
|
+
else if (a.startsWith('--')) return { error: `unknown option ${a}` }
|
|
33
|
+
else files.push(a)
|
|
34
|
+
}
|
|
35
|
+
return { files, policy, json }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Remote servers from one MCP config file: { name, url } for every entry that has a url. */
|
|
39
|
+
export function serversFromConfig(text) {
|
|
40
|
+
const doc = JSON.parse(text)
|
|
41
|
+
const out = { remote: [], local: [] }
|
|
42
|
+
for (const key of ['mcpServers', 'servers']) {
|
|
43
|
+
const block = doc?.[key]
|
|
44
|
+
if (!block || typeof block !== 'object') continue
|
|
45
|
+
for (const [name, v] of Object.entries(block)) {
|
|
46
|
+
const url = v && typeof v === 'object' ? (v.url ?? v.serverUrl) : undefined
|
|
47
|
+
if (typeof url === 'string' && /^https?:\/\//i.test(url)) out.remote.push({ name, url })
|
|
48
|
+
else out.local.push(name)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return out
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function main() {
|
|
55
|
+
const args = parseArgs(process.argv.slice(2))
|
|
56
|
+
if (args.help || args.error) {
|
|
57
|
+
if (args.error) console.error(`jishie-gate: ${args.error}`)
|
|
58
|
+
console.log(
|
|
59
|
+
'usage: jishie-gate [files…] [--min-tier 0-3] [--min-score 0-100] [--max-flag none|minor|major|critical]\n' +
|
|
60
|
+
' [--require-identity] [--allow-unreachable] [--json]',
|
|
61
|
+
)
|
|
62
|
+
process.exit(args.error ? 2 : 0)
|
|
63
|
+
}
|
|
64
|
+
const files = (args.files.length ? args.files : DEFAULT_FILES).filter((f) => existsSync(f))
|
|
65
|
+
if (!files.length) {
|
|
66
|
+
console.log('jishie-gate: no MCP config found (.mcp.json, mcp.json, .cursor/mcp.json, .vscode/mcp.json) — nothing to check')
|
|
67
|
+
process.exit(0)
|
|
68
|
+
}
|
|
69
|
+
const remote = []
|
|
70
|
+
const local = []
|
|
71
|
+
for (const f of files) {
|
|
72
|
+
try {
|
|
73
|
+
const s = serversFromConfig(readFileSync(f, 'utf8'))
|
|
74
|
+
for (const r of s.remote) remote.push({ ...r, file: f })
|
|
75
|
+
for (const n of s.local) local.push(`${n} (${path.basename(f)})`)
|
|
76
|
+
} catch (e) {
|
|
77
|
+
console.error(`jishie-gate: cannot read ${f}: ${e.message}`)
|
|
78
|
+
process.exit(2)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!remote.length) {
|
|
82
|
+
console.log(`jishie-gate: no remote servers in ${files.join(', ')} — nothing to check`)
|
|
83
|
+
if (local.length) console.log(` skipped (local, no network endpoint to measure): ${local.join(', ')}`)
|
|
84
|
+
process.exit(0)
|
|
85
|
+
}
|
|
86
|
+
const urls = [...new Set(remote.map((r) => r.url))]
|
|
87
|
+
const headers = { 'content-type': 'application/json' }
|
|
88
|
+
if (process.env.JISHIE_TOKEN) headers.authorization = `Bearer ${process.env.JISHIE_TOKEN}`
|
|
89
|
+
let res
|
|
90
|
+
try {
|
|
91
|
+
res = await fetch(`${API}/v1/gate`, {
|
|
92
|
+
method: 'POST',
|
|
93
|
+
headers,
|
|
94
|
+
body: JSON.stringify({ agents: urls, policy: args.policy }),
|
|
95
|
+
signal: AbortSignal.timeout(30_000),
|
|
96
|
+
})
|
|
97
|
+
} catch (e) {
|
|
98
|
+
console.error(`jishie-gate: could not reach ${API}: ${e.message}`)
|
|
99
|
+
process.exit(2)
|
|
100
|
+
}
|
|
101
|
+
if (res.status === 402) {
|
|
102
|
+
console.error(
|
|
103
|
+
`jishie-gate: ${urls.length} servers is over the free size (10 per call). Set JISHIE_TOKEN to a plan token — see ${API}/pricing.html`,
|
|
104
|
+
)
|
|
105
|
+
process.exit(2)
|
|
106
|
+
}
|
|
107
|
+
if (!res.ok) {
|
|
108
|
+
console.error(`jishie-gate: ${API}/v1/gate answered ${res.status}`)
|
|
109
|
+
process.exit(2)
|
|
110
|
+
}
|
|
111
|
+
const out = await res.json()
|
|
112
|
+
if (args.json) {
|
|
113
|
+
console.log(JSON.stringify(out, null, 2))
|
|
114
|
+
process.exit(out.all_pass ? 0 : 1)
|
|
115
|
+
}
|
|
116
|
+
const nameOf = (url) => remote.filter((r) => r.url === url).map((r) => r.name).join(', ')
|
|
117
|
+
for (const r of out.results) {
|
|
118
|
+
console.log(`${r.pass ? 'PASS' : 'FAIL'} ${nameOf(r.ref)} ${r.ref}`)
|
|
119
|
+
for (const why of r.reasons) console.log(` - ${why}`)
|
|
120
|
+
}
|
|
121
|
+
if (local.length) console.log(`skipped (local, no network endpoint to measure): ${local.join(', ')}`)
|
|
122
|
+
console.log(`\n${out.passed}/${out.checked} pass · policy: tier ≥ T${out.policy.min_tier}, flags ≤ ${out.policy.max_flag_severity}`)
|
|
123
|
+
process.exit(out.all_pass ? 0 : 1)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// run only as a CLI (serversFromConfig is imported by tests); realpath because npx runs the bin through a symlink
|
|
127
|
+
const invoked = process.argv[1] ? realpathSync(process.argv[1]) : ''
|
|
128
|
+
if (invoked === realpathSync(fileURLToPath(import.meta.url))) await main()
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jishie-gate",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Check the MCP servers in your project (.mcp.json, .cursor/mcp.json, .vscode/mcp.json) against the jishie index: fail CI when one is unknown, down, or flagged for hidden instructions in its tool descriptions.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": { "jishie-gate": "index.mjs" },
|
|
7
|
+
"files": ["index.mjs", "README.md", "action.yml"],
|
|
8
|
+
"keywords": ["mcp", "model-context-protocol", "security", "ci", "tool-poisoning", "ai-agents", "jishie", "cursor", "claude"],
|
|
9
|
+
"engines": { "node": ">=18" },
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "https://jishie.com/pricing.html"
|
|
12
|
+
}
|