You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Evolves mcp-docs bash tools from static in-memory filesystem exploration
into an integrated agentic retrieval system that matches and exceeds
Mintlify's ChromaFS approach. All features are opt-in via the `bash:`
config subsection — existing configs work unchanged.
- **Session state**: Persistent CWD tracking across commands. `cd /docs
&& ls` works across separate tool calls. Path validation rejects
nonexistent directories.
- **Vector-backed grep**: Configurable 3-pass search (semantic
embeddings + ILIKE text + dedup) with graceful degradation when search
infrastructure is unavailable. Falls back to in-memory grep for
bash-only configs.
- **Virtual files**: Auto-generated `INDEX.md` (file listing) and
`SEARCH_TIPS.md` (usage guidance) injected into the virtual filesystem
at startup.
- **Cross-paradigm hints**: `related /path/to/file` command finds
semantically similar files across all sources. Grep misses suggest
companion search tools.
- **File metadata**: `buildFileMetadata` and `formatLsLong` for `ls -l`
style output with sizes and line counts.
- **Workspace tracker**: Per-session writable `/workspace/` directory
with 1MB size cap.
- **Telemetry hooks**: Tracks file access, grep misses, and commands
with buffer overflow protection (10K cap).
- **Webhook refresh**: Atomic bash instance swap when sources are
reindexed via GitHub webhooks.
- **154 tests** covering all features, edge cases, and error paths.
Full design: [Proposal on
Notion](https://www.notion.so/33a3aa38185281f2b5ebdf52a1a35108)
## Test plan
- [x] All 154 tests pass (`npx vitest run`)
- [x] TypeScript compiles clean (`npx tsc --noEmit`)
- [x] 2-round CR loop with 7 agents — 7 bugs found and fixed, round 2
clean
- [ ] Deploy to Railway staging and verify bash tools work with new
config options
- [ ] Verify `related` command returns meaningful results against
CopilotKit docs
- [ ] Verify vector grep returns results for common queries (useAction,
streaming, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copy file name to clipboardExpand all lines: README.md
+48-10Lines changed: 48 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
-
# mcp-docs
1
+
# Pathfinder
2
2
3
3
A self-hosted MCP server that provides semantic search over your documentation and code. Configure it with a YAML file, deploy with Docker, and give your AI coding agents instant access to your project's knowledge.
4
4
5
5
## How It Works
6
6
7
-
mcp-docs indexes your GitHub repositories — documentation (Markdown/MDX) and source code — into a PostgreSQL vector database using OpenAI embeddings. It exposes configurable search tools via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io), so AI agents like Claude Code can search your docs and code semantically.
7
+
Pathfinder indexes your GitHub repositories — documentation (Markdown/MDX) and source code — into a PostgreSQL vector database using OpenAI embeddings. It exposes configurable search tools via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io), so AI agents like Claude Code can search your docs and code semantically.
cp pathfinder.example.yaml pathfinder.yaml # edit for your project
16
+
cp .env.example .env # add your OPENAI_API_KEY
17
17
```
18
18
19
19
2.**Start the server:**
@@ -37,7 +37,7 @@ mcp-docs indexes your GitHub repositories — documentation (Markdown/MDX) and s
37
37
38
38
## Configuration
39
39
40
-
All configuration lives in `mcp-docs.yaml`. See [mcp-docs.example.yaml](mcp-docs.example.yaml) for a minimal starting point.
40
+
All configuration lives in `pathfinder.yaml`. See [pathfinder.example.yaml](pathfinder.example.yaml) for a minimal starting point.
41
41
42
42
### Sources
43
43
@@ -113,6 +113,44 @@ tools:
113
113
114
114
Each field in `schema` supports `type` (`string`, `number`, or `enum`), an optional `description` (shown to the agent), `required` (defaults to false), and `values` (required for `enum` fields). The validated input is written as JSONB to the `collected_data` table along with the tool name and a timestamp.
115
115
116
+
### Bash Tool Options
117
+
118
+
Bash tools expose source files as a read-only virtual filesystem that agents can explore with standard commands (`find`, `grep`, `cat`, `ls`, `head`). Several options control behavior:
119
+
120
+
```yaml
121
+
tools:
122
+
- name: explore-docs
123
+
type: bash
124
+
description: "Explore documentation files"
125
+
sources: [docs]
126
+
bash:
127
+
session_state: true # Persistent CWD across commands (default: false)
- **session_state**: When enabled, `cd` persists across commands within a session. Agents can run `cd /docs` in one tool call and then `ls` or `cat file.md` in the next without repeating the path.
133
+
- **grep_strategy**: Controls whether the `qmd` semantic search command is available. `memory` uses pure in-memory regex only (no `qmd`). `vector` or `hybrid` enable the `qmd` command, which performs semantic search via embeddings plus text `ILIKE`. The `vector` and `hybrid` modes require an `embedding` config block.
134
+
- **virtual_files**: Auto-generates `/INDEX.md` (file listing with descriptions) and `/SEARCH_TIPS.md` (usage guidance) at the root of the virtual filesystem.
135
+
136
+
Agents can also run the `related` command inside bash tools to find semantically similar files across all mounted sources:
137
+
138
+
```bash
139
+
related /docs/concepts/coagents.mdx
140
+
```
141
+
142
+
This returns a ranked list of files from any source that are semantically related to the given file, useful for discovering cross-references between documentation and code.
143
+
144
+
When `grep_strategy` is set to `vector` or `hybrid`, agents can use the `qmd` command for semantic search:
145
+
146
+
```bash
147
+
qmd "how do I configure authentication"
148
+
```
149
+
150
+
This performs a 2-pass search (semantic embeddings + text ILIKE) with dedup and filtering, and returns file:line:content results. Standard `grep` is never intercepted — it always works with standard flags as agents expect.
151
+
152
+
**Note:** The virtual filesystem is read-only and shared across all MCP sessions for a given tool. Content refreshes on webhook or server restart.
153
+
116
154
### Built-in Chunker Types
117
155
118
156
| Type | Best For | Splits On |
@@ -145,7 +183,7 @@ The simplest way to run in production:
145
183
146
184
1. **Configure:**
147
185
```bash
148
-
cp mcp-docs.example.yaml mcp-docs.yaml # edit for your project
186
+
cp pathfinder.example.yaml pathfinder.yaml # edit for your project
149
187
```
150
188
151
189
2. **Set environment variables** in `.env`:
@@ -173,7 +211,7 @@ The server automatically indexes on first boot and runs a nightly reindex at the
0 commit comments