-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdev.py
More file actions
50 lines (41 loc) · 1.28 KB
/
Copy pathdev.py
File metadata and controls
50 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
"""Development script runner for knowledge-mcp."""
import sys
import subprocess
import argparse
def run_shell():
"""Run knowledge-mcp shell with config."""
cmd = [
sys.executable, "-m", "knowledge_mcp.cli",
"--config", "./kbs/config.yaml",
"shell"
]
subprocess.run(cmd)
def run_inspector():
"""Run MCP inspector with knowledge-mcp server."""
cmd = [
"npx", "@modelcontextprotocol/inspector",
"uv", "run", "knowledge-mcp", "--config", "./kbs/config.yaml", "mcp"
]
subprocess.run(cmd)
def run_tests():
"""Run pytest tests."""
subprocess.run([sys.executable, "-m", "pytest"])
def run_main():
"""Run knowledge-mcp CLI directly."""
subprocess.run([sys.executable, "-m", "knowledge_mcp.cli"])
def main():
parser = argparse.ArgumentParser(description="Development script runner")
parser.add_argument("command", choices=["shell", "insp", "test", "main"],
help="Command to run")
args = parser.parse_args()
if args.command == "shell":
run_shell()
elif args.command == "insp":
run_inspector()
elif args.command == "test":
run_tests()
elif args.command == "main":
run_main()
if __name__ == "__main__":
main()