Repository navigation
42 lines (40 loc) · 1.55 KB
/
Copy pathci.yml
File metadata and controls
42 lines (40 loc) · 1.55 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
- name: Install
run: uv sync
- name: Compile
run: uv run python -m compileall -q substack_api_mcp
- name: MCP server starts and lists its tools
run: |
uv run python - <<'PY'
import json, subprocess, sys
proc = subprocess.Popen([".venv/bin/substack-mcp", "mcp"], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True)
def ask(msg, want=None):
proc.stdin.write(json.dumps(msg) + "\n")
proc.stdin.flush()
while want is not None:
line = proc.stdout.readline()
if not line:
sys.exit("server exited: " + proc.stderr.read()[-2000:])
reply = json.loads(line)
if reply.get("id") == want:
return reply
ask({"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "ci", "version": "1"}}}, 1)
ask({"jsonrpc": "2.0", "method": "notifications/initialized"})
tools = ask({"jsonrpc": "2.0", "id": 2, "method": "tools/list"}, 2)["result"]["tools"]
proc.terminate()
assert tools, "no tools"
print(len(tools), "tools")
PY