mcp-authscan-verify 0.1.0__tar.gz
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.
- mcp_authscan_verify-0.1.0/PKG-INFO +5 -0
- mcp_authscan_verify-0.1.0/mcp_authscan_verify.egg-info/PKG-INFO +5 -0
- mcp_authscan_verify-0.1.0/mcp_authscan_verify.egg-info/SOURCES.txt +8 -0
- mcp_authscan_verify-0.1.0/mcp_authscan_verify.egg-info/dependency_links.txt +1 -0
- mcp_authscan_verify-0.1.0/mcp_authscan_verify.egg-info/entry_points.txt +2 -0
- mcp_authscan_verify-0.1.0/mcp_authscan_verify.egg-info/requires.txt +1 -0
- mcp_authscan_verify-0.1.0/mcp_authscan_verify.egg-info/top_level.txt +1 -0
- mcp_authscan_verify-0.1.0/pyproject.toml +15 -0
- mcp_authscan_verify-0.1.0/setup.cfg +4 -0
- mcp_authscan_verify-0.1.0/verify_server.py +34 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pyproject.toml
|
|
2
|
+
verify_server.py
|
|
3
|
+
mcp_authscan_verify.egg-info/PKG-INFO
|
|
4
|
+
mcp_authscan_verify.egg-info/SOURCES.txt
|
|
5
|
+
mcp_authscan_verify.egg-info/dependency_links.txt
|
|
6
|
+
mcp_authscan_verify.egg-info/entry_points.txt
|
|
7
|
+
mcp_authscan_verify.egg-info/requires.txt
|
|
8
|
+
mcp_authscan_verify.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mcp-authscan
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
verify_server
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mcp-authscan-verify"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Stdio MCP server exposing one tool: recompute an mcp-authscan report hash and check its signature."
|
|
9
|
+
dependencies = ["mcp-authscan"]
|
|
10
|
+
|
|
11
|
+
[project.scripts]
|
|
12
|
+
mcp-authscan-verify = "verify_server:serve"
|
|
13
|
+
|
|
14
|
+
[tool.setuptools]
|
|
15
|
+
py-modules = ["verify_server"]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import json,sys
|
|
2
|
+
from mcp_authscan.report_verify import verify,authenticity
|
|
3
|
+
|
|
4
|
+
TOOL={"name":"verify","description":"Recompute the hash of an mcp-authscan report and check its signature.","inputSchema":{"type":"object","properties":{"path":{"type":"string","description":"Path to the report JSON"},"keys":{"type":"string","description":"Optional path to keys.json"}},"required":["path"]}}
|
|
5
|
+
|
|
6
|
+
def out(obj):
|
|
7
|
+
sys.stdout.write(json.dumps(obj,separators=(",",":"))+"\n")
|
|
8
|
+
sys.stdout.flush()
|
|
9
|
+
|
|
10
|
+
def serve():
|
|
11
|
+
for line in sys.stdin:
|
|
12
|
+
line=line.strip()
|
|
13
|
+
if not line: continue
|
|
14
|
+
req=json.loads(line)
|
|
15
|
+
mid=req.get("id")
|
|
16
|
+
method=req.get("method")
|
|
17
|
+
params=req.get("params") or {}
|
|
18
|
+
if method=="initialize":
|
|
19
|
+
out({"jsonrpc":"2.0","id":mid,"result":{"protocolVersion":params.get("protocolVersion") or "2024-11-05","capabilities":{"tools":{}},"serverInfo":{"name":"mcp-authscan-verify","version":"0.1.0"}}})
|
|
20
|
+
elif method=="tools/list":
|
|
21
|
+
out({"jsonrpc":"2.0","id":mid,"result":{"tools":[TOOL]}})
|
|
22
|
+
elif method=="tools/call":
|
|
23
|
+
args=params.get("arguments") or {}
|
|
24
|
+
path=args.get("path") or ""
|
|
25
|
+
try:
|
|
26
|
+
verdict,detail=verify(path)
|
|
27
|
+
payload=json.load(open(path,encoding="utf-8"))
|
|
28
|
+
keys=json.load(open(args["keys"],encoding="utf-8")) if args.get("keys") else None
|
|
29
|
+
text="VERDICT "+verdict+"\nDETAIL "+str(detail)+"\nSIGNATURE "+authenticity(payload,keys)
|
|
30
|
+
except Exception as error:
|
|
31
|
+
text="ERROR "+str(error)
|
|
32
|
+
out({"jsonrpc":"2.0","id":mid,"result":{"content":[{"type":"text","text":text}]}})
|
|
33
|
+
elif mid is not None:
|
|
34
|
+
out({"jsonrpc":"2.0","id":mid,"error":{"code":-32601,"message":"unknown method "+str(method)}})
|