context-server 0.1.4__py3-none-macosx_11_0_arm64.whl
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.
- context_server-0.1.4.data/scripts/context-server +0 -0
- context_server-0.1.4.dist-info/METADATA +120 -0
- context_server-0.1.4.dist-info/RECORD +6 -0
- context_server-0.1.4.dist-info/WHEEL +4 -0
- context_server-0.1.4.dist-info/licenses/LICENSE +21 -0
- context_server-0.1.4.dist-info/sboms/context-server.cyclonedx.json +12394 -0
|
Binary file
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: context-server
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
License-File: LICENSE
|
|
5
|
+
Summary: Lightweight MCP server for semantic search over organizational markdown
|
|
6
|
+
Home-Page: https://github.com/shanemcd/context-server
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
10
|
+
Project-URL: Repository, https://github.com/shanemcd/context-server
|
|
11
|
+
|
|
12
|
+
# context-server
|
|
13
|
+
|
|
14
|
+
A lightweight [MCP](https://modelcontextprotocol.io/) server for **semantic search over markdown knowledge bases**.
|
|
15
|
+
|
|
16
|
+
One Rust binary. ONNX Runtime is **statically linked** (via [`ort`](https://github.com/pykeio/ort) / [`fastembed`](https://github.com/Anush008/fastembed-rs)) — no separate `libonnxruntime.so` to ship. SQLite is bundled. Built for AI coding agents (Claude Code, Cursor, etc.).
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- Index markdown into a local SQLite vector database
|
|
21
|
+
- Chunk by `##` / `###` headings (hierarchy kept in each chunk)
|
|
22
|
+
- Semantic search with All-MiniLM-L6-v2 (384-dim)
|
|
23
|
+
- MCP tools: `semantic_search`, `list_documents`, `answer_question`
|
|
24
|
+
- CLI for index / search / embed smoke tests
|
|
25
|
+
|
|
26
|
+
**Input contract:** feed searchable prose (markdown). Structured data (YAML, etc.) should be converted to markdown *before* indexing — raw YAML in code fences searches poorly.
|
|
27
|
+
|
|
28
|
+
## Requirements
|
|
29
|
+
|
|
30
|
+
- Rust 1.75+ (edition 2021)
|
|
31
|
+
- Linux x86_64 (primary target today)
|
|
32
|
+
- At build/link time: a C++ standard library (`libstdc++`) and OpenSSL development headers if your platform needs them for `native-tls`
|
|
33
|
+
|
|
34
|
+
On Fedora/RHEL, if the linker cannot find `-lstdc++` (only `libstdc++.so.6` is installed):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
mkdir -p .linker && ln -sfn /usr/lib64/libstdc++.so.6 .linker/libstdc++.so
|
|
38
|
+
export RUSTFLAGS="-L native=$(pwd)/.linker"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install context-server
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Platform wheels: Linux x86_64/aarch64 (`manylinux_2_39`, glibc 2.39+ / Ubuntu 24.04+) and macOS Apple Silicon.
|
|
48
|
+
|
|
49
|
+
## Build
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cargo build --release
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The first embedding run downloads the MiniLM model into the local Hugging Face / fastembed cache (~tens of MB, once).
|
|
56
|
+
|
|
57
|
+
### Linux wheels (Podman)
|
|
58
|
+
|
|
59
|
+
Same Containerfile CI uses (Ubuntu 24.04 / glibc 2.39 — required by current ORT prebuilts):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
./scripts/build-wheel.sh # writes dist/*.whl
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Preview how documents will be chunked
|
|
69
|
+
./target/release/context-server index --input ./docs --dry-run
|
|
70
|
+
|
|
71
|
+
# Embed and write the database
|
|
72
|
+
./target/release/context-server index --input ./docs --db context.db
|
|
73
|
+
|
|
74
|
+
# CLI search
|
|
75
|
+
./target/release/context-server search --db context.db "how do we handle backports"
|
|
76
|
+
|
|
77
|
+
# MCP stdio server
|
|
78
|
+
./target/release/context-server serve --db context.db
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Claude Code
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
claude mcp add --transport stdio --scope user context-server \
|
|
85
|
+
-- /absolute/path/to/context-server serve --db /absolute/path/to/context.db
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Re-index when content changes, then restart the MCP session so `serve` reloads the DB into memory.
|
|
89
|
+
|
|
90
|
+
## MCP tools
|
|
91
|
+
|
|
92
|
+
| Tool | Description |
|
|
93
|
+
|------|-------------|
|
|
94
|
+
| `semantic_search` | Ranked passages with similarity scores |
|
|
95
|
+
| `list_documents` | Indexed chunk listing |
|
|
96
|
+
| `answer_question` | Top passage for a question (retrieval only, no generative QA) |
|
|
97
|
+
|
|
98
|
+
## Architecture
|
|
99
|
+
|
|
100
|
+
| Piece | Choice |
|
|
101
|
+
|-------|--------|
|
|
102
|
+
| Embeddings | fastembed → All-MiniLM-L6-v2, L2-normalized |
|
|
103
|
+
| Inference | ort (static ONNX Runtime) |
|
|
104
|
+
| Storage | rusqlite (bundled SQLite), float32 blobs |
|
|
105
|
+
| Search | Brute-force cosine (fine for <100K chunks) |
|
|
106
|
+
| MCP | [rmcp](https://github.com/modelcontextprotocol/rust-sdk) stdio |
|
|
107
|
+
|
|
108
|
+
See [PLAN.md](PLAN.md) for design notes and roadmap.
|
|
109
|
+
|
|
110
|
+
## Development
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
cargo test
|
|
114
|
+
cargo build --release
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
MIT — see [LICENSE](LICENSE).
|
|
120
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
context_server-0.1.4.data/scripts/context-server,sha256=jQunNRQS4hyuhuN8uA8RJhToqaMyO_Py9QVMSKzGLWk,25161728
|
|
2
|
+
context_server-0.1.4.dist-info/METADATA,sha256=Tc2Gf0bNaFQgbkIg9Zp5wwqzeVgVWaTlswyeoI2NZ8Q,3675
|
|
3
|
+
context_server-0.1.4.dist-info/WHEEL,sha256=7m8kjhP_K0tQ6qXK8P1IG2YeRznSaoXUEpeK3IfZx-I,102
|
|
4
|
+
context_server-0.1.4.dist-info/licenses/LICENSE,sha256=GIrjZZgzkQdGJnKC0b2EI_svyzurFL0U6GeuEhDI-CU,1071
|
|
5
|
+
context_server-0.1.4.dist-info/sboms/context-server.cyclonedx.json,sha256=JwyzdMUAp-I64F-LPizWE8NtWjK0VGh3cNHRw7zg-rY,402196
|
|
6
|
+
context_server-0.1.4.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shane McDonald
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|