Repository navigation
Commit 2e6a47f
authored
feat(mcp): authenticated read-only Streamable HTTP preview (#518)
## Summary
Adds an opt-in Streamable HTTP endpoint using the existing RMCP SDK and
Sem handlers. Stdio remains unchanged.
- `sem mcp --http 127.0.0.1:8765` (also standalone `sem-mcp --http`)
- Explicit SEM_REPO, mandatory random bearer token, loopback-only bind,
exact Host check, rejects browser Origin requests
- Only sem_find and sem_grep advertised AND callable; no validation
commands, cloud tools, or Weave writes
- Shared repository caches, stateless requests with independent context
ledgers
- 1 MiB body limit and eight concurrent HTTP requests; relative-path and
explicit symlink escape checks
- Source-build documentation, release limitation, and smoke test in
existing Linux/macOS CI
## Validation
- Built sem-cli and sem-mcp locally
- 100 sem-mcp library tests passed
- 12 existing MCP protocol tests passed
- 7 live HTTP smoke tests passed (handshake, reads, lookup/grep,
hidden-tool denial, paths, auth/Host/Origin/body size, nonloopback
rejection)
- Actual LangChain MCP adapter 0.2.1/MCP 1.25 and Aser/FastMCP 4.1
clients retrieved a function and caller over HTTP
## Deliberate boundaries
This is a trusted-client local/SSH-tunnel preview, NOT public hosting,
OAuth, a multi-tenant sandbox, or a remote editing service. It does not
make arbitrary checkouts safe. Published 0.27.0 does not include this
feature. No speedup claim. Downstream examples will be drafts pending
this transport landing.
AI-assisted implementation; local toolchain emitted existing LLVM
debug-stripping warnings but builds and tests completed successfully.1 parent 0bbe3d5 commit 2e6a47f
11 files changed
Lines changed: 585 additions & 8 deletions
File tree
- .github/workflows
- crates
- sem-cli/src
- sem-mcp
- src
- tests
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| 605 | + | |
| 606 | + | |
605 | 607 | | |
606 | 608 | | |
607 | 609 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
917 | 917 | | |
918 | 918 | | |
919 | 919 | | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
920 | 924 | | |
921 | 925 | | |
922 | 926 | | |
| |||
1916 | 1920 | | |
1917 | 1921 | | |
1918 | 1922 | | |
1919 | | - | |
| 1923 | + | |
1920 | 1924 | | |
1921 | 1925 | | |
1922 | 1926 | | |
| |||
1925 | 1929 | | |
1926 | 1930 | | |
1927 | 1931 | | |
1928 | | - | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
1929 | 1935 | | |
1930 | 1936 | | |
1931 | 1937 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | | - | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
0 commit comments