Skip to content

Commit 4086858

Browse files
committed
ci: add GitHub Actions workflow and clean up obsolete smoke script; update docs
1 parent 732a86f commit 4086858

14 files changed

Lines changed: 602 additions & 71 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Rust
17+
uses: actions-rs/toolchain@v1
18+
with:
19+
toolchain: stable
20+
components: rustfmt, clippy
21+
22+
- name: Build release MCP binary
23+
run: cargo build --release --all-features --bin cortex-scout-mcp
24+
25+
- name: Run Rust unit tests
26+
run: cargo test --all-features -- --quiet
27+
28+
- name: Install Python dependencies
29+
run: |
30+
python3 -m pip install --upgrade pip
31+
32+
- name: Run repo validation script
33+
run: python3 publish/ci/validate.py
34+
35+
- name: Run MCP smoke test
36+
run: python3 publish/ci/smoke_mcp.py

.vscode/mcp.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"servers": {
3+
"cortex-scout": {
4+
"type": "stdio",
5+
"command": "env",
6+
"args": [
7+
"RUST_LOG=warn",
8+
"SEARCH_ENGINES=google,bing,duckduckgo,brave",
9+
"LANCEDB_URI=/Users/hero/Documents/GitHub/ShadowCrawl/lancedb",
10+
"HTTP_TIMEOUT_SECS=30",
11+
"HTTP_CONNECT_TIMEOUT_SECS=10",
12+
"MAX_CONTENT_CHARS=10000",
13+
"IP_LIST_PATH=/Users/hero/Documents/GitHub/ShadowCrawl/ip.txt",
14+
"PROXY_SOURCE_PATH=/Users/hero/Documents/GitHub/ShadowCrawl/proxy_source.json",
15+
"/Users/hero/Documents/GitHub/ShadowCrawl/mcp-server/target/release/cortex-scout-mcp"
16+
]
17+
}
18+
}
19+
}

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,26 @@ Basic build (search, scrape, deep research, memory):
9090
```bash
9191
git clone https://github.com/cortex-works/cortex-scout.git
9292
cd cortex-scout/mcp-server
93-
cargo build --release
93+
cargo build --release --bin cortex-scout-mcp
9494
```
9595

9696
Full build (includes `hitl_web_fetch` / visible-browser HITL):
9797

9898
```bash
99-
cargo build --release --all-features
99+
cargo build --release --all-features --bin cortex-scout-mcp
100100
```
101101

102-
---
102+
If you also want the optional HTTP server binary, build it explicitly with `cargo build --release --bin cortex-scout`.
103103

104-
## MCP Integration (VS Code / Cursor / Claude Desktop)
104+
Local MCP smoke test:
105105

106-
Add a server entry to your MCP config.
106+
```bash
107+
python3 publish/ci/smoke_mcp.py
108+
```
107109

110+
This runs a newline-delimited JSON-RPC stdio session against the local `cortex-scout-mcp` binary and exercises the main public tools with safe example inputs.
111+
112+
A GitHub Actions workflow (`.github/workflows/ci.yml`) invokes the same validation, Rust test suite, and the `smoke_mcp.py` smoke test on every push/PR. It replaces the older HTTP-mode smoke script (`publish/ci/smoke.py`), which has been removed as obsolete.
108113
**VS Code** (`mcp.json` — global, or `settings.json` under `mcp.servers`):
109114

110115
```jsonc
@@ -121,16 +126,15 @@ Add a server entry to your MCP config.
121126
"LANCEDB_URI=/YOUR_PATH/cortex-scout/lancedb",
122127
"HTTP_TIMEOUT_SECS=30",
123128
"MAX_CONTENT_CHARS=10000",
124-
"IP_LIST_PATH=/YOUR_PATH/cortex-scout/ip.txt",
125-
"PROXY_SOURCE_PATH=/YOUR_PATH/cortex-scout/proxy_source.json",
126-
"--",
127129
"/YOUR_PATH/cortex-scout/mcp-server/target/release/cortex-scout-mcp"
128130
]
129131
}
130132
}
131133
}
132134
```
133135

136+
Default behavior is direct/no-proxy. Add `IP_LIST_PATH` and `PROXY_SOURCE_PATH` only if you want proxy tools available. If you want `proxy_control` available without routing normal traffic through proxies, point `IP_LIST_PATH` at an empty `ip.txt` file and let agents populate it on demand.
137+
134138
> **Important:** Always use `RUST_LOG=warn`, not `info`. At `info` level, the server emits hundreds of log lines per request to stderr, which can confuse MCP clients that monitor stderr.
135139
136140
> **Windows:** Windows has no `env` command. Use the `command`+`env` object format instead — see [docs/IDE_SETUP.md](docs/IDE_SETUP.md).
@@ -149,15 +153,12 @@ Add a server entry to your MCP config.
149153
"LANCEDB_URI=/YOUR_PATH/cortex-scout/lancedb",
150154
"HTTP_TIMEOUT_SECS=30",
151155
"MAX_CONTENT_CHARS=10000",
152-
"IP_LIST_PATH=/YOUR_PATH/cortex-scout/ip.txt",
153-
"PROXY_SOURCE_PATH=/YOUR_PATH/cortex-scout/proxy_source.json",
154156
"OPENAI_BASE_URL=https://openrouter.ai/api/v1",
155157
"OPENAI_API_KEY=sk-or-v1-...",
156158
"DEEP_RESEARCH_LLM_MODEL=moonshotai/kimi-k2.5",
157159
"DEEP_RESEARCH_ENABLED=1",
158160
"DEEP_RESEARCH_SYNTHESIS=1",
159161
"DEEP_RESEARCH_SYNTHESIS_MAX_TOKENS=4096",
160-
"--",
161162
"/YOUR_PATH/cortex-scout/mcp-server/target/release/cortex-scout-mcp"
162163
]
163164
}
@@ -222,8 +223,8 @@ Create `cortex-scout.json` in the same directory as the binary (or repository ro
222223

223224
| Variable | Default | Description |
224225
|----------|---------|-------------|
225-
| `IP_LIST_PATH` || Path to `ip.txt` (one proxy per line: `http://`, `socks5://`) |
226-
| `PROXY_SOURCE_PATH` || Path to `proxy_source.json` (used by `proxy_control grab`) |
226+
| `IP_LIST_PATH` || Optional path to `ip.txt` (one proxy per line: `http://`, `socks5://`). Leave unset to disable proxy support entirely, or point at an empty file to keep proxy tools available but inactive by default |
227+
| `PROXY_SOURCE_PATH` || Optional path to `proxy_source.json` (used by `proxy_control grab`) |
227228

228229
### Semantic Memory (LanceDB)
229230

@@ -309,7 +310,7 @@ Prevention checklist:
309310
Check these before anything else:
310311

311312
1. Use `RUST_LOG=warn`, not `info`.
312-
2. On macOS/Linux `env`-style configs, include `"--"` before the binary path.
313+
2. On macOS/Linux `env`-style configs, pass the binary path directly after the env assignments. Do not insert `"--"` in `mcp.json` args.
313314
3. On Windows, do not use `env`; use `command` plus an `env` object.
314315
4. Make sure the binary path points to a current build, not an old pre-fix binary.
315316

docs/IDE_SETUP.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,15 @@ VS Code reads MCP servers from two places (both are valid):
5858
"LANCEDB_URI=/absolute/path/to/cortex-scout/lancedb",
5959
"HTTP_TIMEOUT_SECS=30",
6060
"MAX_CONTENT_CHARS=10000",
61-
"IP_LIST_PATH=/absolute/path/to/cortex-scout/ip.txt",
62-
"PROXY_SOURCE_PATH=/absolute/path/to/cortex-scout/proxy_source.json",
63-
"--",
6461
"/absolute/path/to/cortex-scout/mcp-server/target/release/cortex-scout-mcp"
6562
]
6663
}
6764
}
6865
}
6966
```
7067

68+
Default behavior is direct/no-proxy. Add `IP_LIST_PATH` and `PROXY_SOURCE_PATH` only if you want proxy support available. For opt-in proxy usage, keep `ip.txt` empty and let the agent call `proxy_control grab` before retrying with `use_proxy: true`.
69+
7170
### Windows
7271

7372
Windows has no `env` command. Use the `command` + `env` object format:
@@ -85,9 +84,7 @@ Windows has no `env` command. Use the `command` + `env` object format:
8584
"SEARCH_ENGINES": "google,bing,duckduckgo,brave",
8685
"LANCEDB_URI": "C:\\Users\\YOU\\cortex-scout\\lancedb",
8786
"HTTP_TIMEOUT_SECS": "30",
88-
"MAX_CONTENT_CHARS": "10000",
89-
"IP_LIST_PATH": "C:\\Users\\YOU\\cortex-scout\\ip.txt",
90-
"PROXY_SOURCE_PATH": "C:\\Users\\YOU\\cortex-scout\\proxy_source.json"
87+
"MAX_CONTENT_CHARS": "10000"
9188
}
9289
}
9390
}
@@ -117,9 +114,6 @@ Claude uses `"mcpServers"` (not `"servers"`).
117114
"LANCEDB_URI=/absolute/path/to/cortex-scout/lancedb",
118115
"HTTP_TIMEOUT_SECS=30",
119116
"MAX_CONTENT_CHARS=10000",
120-
"IP_LIST_PATH=/absolute/path/to/cortex-scout/ip.txt",
121-
"PROXY_SOURCE_PATH=/absolute/path/to/cortex-scout/proxy_source.json",
122-
"--",
123117
"/absolute/path/to/cortex-scout/mcp-server/target/release/cortex-scout-mcp"
124118
]
125119
}
@@ -147,9 +141,6 @@ Cursor stores MCP config in `~/.cursor/mcp.json` (also configurable via UI).
147141
"LANCEDB_URI=/absolute/path/to/cortex-scout/lancedb",
148142
"HTTP_TIMEOUT_SECS=30",
149143
"MAX_CONTENT_CHARS=10000",
150-
"IP_LIST_PATH=/absolute/path/to/cortex-scout/ip.txt",
151-
"PROXY_SOURCE_PATH=/absolute/path/to/cortex-scout/proxy_source.json",
152-
"--",
153144
"/absolute/path/to/cortex-scout/mcp-server/target/release/cortex-scout-mcp"
154145
]
155146
}
@@ -176,9 +167,6 @@ Windsurf config file: `~/.codeium/windsurf/mcp_config.json`
176167
"LANCEDB_URI=/absolute/path/to/cortex-scout/lancedb",
177168
"HTTP_TIMEOUT_SECS=30",
178169
"MAX_CONTENT_CHARS=10000",
179-
"IP_LIST_PATH=/absolute/path/to/cortex-scout/ip.txt",
180-
"PROXY_SOURCE_PATH=/absolute/path/to/cortex-scout/proxy_source.json",
181-
"--",
182170
"/absolute/path/to/cortex-scout/mcp-server/target/release/cortex-scout-mcp"
183171
]
184172
}
@@ -208,9 +196,6 @@ mcpServers:
208196
- LANCEDB_URI=/absolute/path/to/cortex-scout/lancedb
209197
- HTTP_TIMEOUT_SECS=30
210198
- MAX_CONTENT_CHARS=10000
211-
- IP_LIST_PATH=/absolute/path/to/cortex-scout/ip.txt
212-
- PROXY_SOURCE_PATH=/absolute/path/to/cortex-scout/proxy_source.json
213-
- --
214199
- /absolute/path/to/cortex-scout/mcp-server/target/release/cortex-scout-mcp
215200
```
216201
@@ -239,6 +224,6 @@ These require an `OPENAI_API_KEY` (or compatible endpoint) in the environment.
239224
|---------|-----|
240225
| "no tools found" | Check binary path is correct and executable (`chmod +x`) |
241226
| Tools time out immediately | Ensure `RUST_LOG=warn` — not `info` or `debug` |
242-
| Proxy tools fail | Confirm `ip.txt` and `proxy_source.json` exist and path vars are set |
227+
| Proxy tools fail | Proxy support is optional. If you want it, set `IP_LIST_PATH`/`PROXY_SOURCE_PATH`; keep `ip.txt` empty by default and populate it only when needed |
243228
| `hitl_web_fetch` not available | Binary must be built with `--all-features` |
244229
| Config not picked up | Fully restart the client app after editing the JSON/YAML |

docs/VSCODE_SETUP.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@ VS Code reads MCP servers from two places:
5656
"LANCEDB_URI=/absolute/path/to/cortex-scout/lancedb",
5757
"HTTP_TIMEOUT_SECS=30",
5858
"MAX_CONTENT_CHARS=10000",
59-
"IP_LIST_PATH=/absolute/path/to/cortex-scout/ip.txt",
60-
"PROXY_SOURCE_PATH=/absolute/path/to/cortex-scout/proxy_source.json",
61-
"--",
6259
"/absolute/path/to/cortex-scout/mcp-server/target/release/cortex-scout-mcp"
6360
]
6461
}
6562
}
6663
}
6764
```
6865

66+
Default behavior is direct/no-proxy. Add `IP_LIST_PATH` and `PROXY_SOURCE_PATH` only if you want proxy support available. For an opt-in proxy setup, keep `ip.txt` empty and let `proxy_control grab` populate it only when an agent decides a retry should use proxies.
67+
6968
### Windows
7069

7170
Windows has no `env` command. Pass env vars as an object instead:
@@ -83,9 +82,7 @@ Windows has no `env` command. Pass env vars as an object instead:
8382
"SEARCH_ENGINES": "google,bing,duckduckgo,brave",
8483
"LANCEDB_URI": "C:\\Users\\YOU\\cortex-scout\\lancedb",
8584
"HTTP_TIMEOUT_SECS": "30",
86-
"MAX_CONTENT_CHARS": "10000",
87-
"IP_LIST_PATH": "C:\\Users\\YOU\\cortex-scout\\ip.txt",
88-
"PROXY_SOURCE_PATH": "C:\\Users\\YOU\\cortex-scout\\proxy_source.json"
85+
"MAX_CONTENT_CHARS": "10000"
8986
}
9087
}
9188
}
@@ -126,4 +123,4 @@ After editing any MCP config, **restart VS Code** (Cmd+Q / Alt+F4) to reload the
126123
| Tools time out | Set `RUST_LOG=warn` (not `info` or `debug`) |
127124
| `hitl_web_fetch` missing | Rebuild with `--all-features` |
128125
| Config not picked up | Fully restart VS Code after editing mcp.json |
129-
| Proxy tools fail | Confirm `ip.txt` and `proxy_source.json` exist and paths are set |
126+
| Proxy tools fail | Proxy support is optional. If you want it, set `IP_LIST_PATH`/`PROXY_SOURCE_PATH`; keep `ip.txt` empty by default and populate it only when needed |

0 commit comments

Comments
 (0)