Repository navigation
feat(elos): MCP server to connect ELOS to local agents (Hermes) - #21
Conversation
mcp/elos-server.ts (stdio, official MCP SDK 1.32.1) exposes six tools built on the existing, tested modules: grounded answers with citations (and Socratic mode), cited study packs (flashcards, quiz, sheet, audio overview script, prerequisite paths), local English correction, oral roleplays, Daily English vocabulary and FSRS vs Leitner replay. Privacy: no network access; course files are read only from an explicitly configured ELOS_SOURCES_DIR (synthetic demo documents otherwise); knowledge-private/, secret files and paths outside the root are refused; tool descriptions state that results go to the agent's model provider. Integration tests drive the server with a real MCP client. Setup for Hermes in docs/integrations/HERMES.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce15831d19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const full = path.join(dir, name); | ||
| if (FORBIDDEN.test(path.relative(root, full)) || name.startsWith(".")) continue; | ||
| const info = statSync(full); | ||
| if (info.isDirectory()) walk(full); | ||
| else if (/\.(pdf|md|markdown|txt)$/i.test(name) && info.size <= MAX_FILE_BYTES) out.push(full); |
There was a problem hiding this comment.
Resolve symlinks before admitting source files
When the configured source tree contains an innocently named symlink to an external directory or file, statSync follows it and the lexical path.relative check still treats the entry as internal; subsequent tool calls can therefore read and send outside or knowledge-private content to the model provider. Reject symlinks with lstatSync, or compare each entry's canonical realpath against the canonical source root before traversing or reading it.
AGENTS.md reference: AGENTS.md:L11-L14
Useful? React with 👍 / 👎.
| if (kind === "audio_overview") return json(buildAudioOverview(documents).segments.map((segment) => ({ kind: segment.kind, text: segment.text, pauseAfterMs: segment.pauseAfterMs }))); | ||
| const relations = derivePrerequisites(cards); | ||
| return json(cards.map((card) => remediationPath(card.term, cards, relations)) | ||
| .filter((pathItem) => pathItem.prerequisites.length || pathItem.confusedWith.length).slice(0, limit) | ||
| .map((pathItem) => ({ notion: pathItem.term, reviewFirst: pathItem.prerequisites.map((step) => step.term), confusedWith: pathItem.confusedWith }))); |
There was a problem hiding this comment.
Preserve citations in every study-pack branch
For kind: "audio_overview" and kind: "prerequisites", the response serialization drops all provenance even though the tool contract promises that every item is cited. Audio segments already expose an optional citation, and prerequisite relations carry citations internally, but callers receive only text or notion names, so these two advertised study-pack formats cannot be traced back to the course sources.
Useful? React with 👍 / 👎.
Summary
mcp/elos-server.ts: local stdio MCP server (official SDK 1.32.1, MIT) with 6 tools built on existing modules: grounded answers + Socratic mode, cited study packs, local English correction, oral roleplays, vocabulary, FSRS vs Leitner replay.ELOS_SOURCES_DIR(synthetic demo otherwise);knowledge-private/, secrets and path traversal refused; tool descriptions state that results go to the agent model provider.docs/integrations/HERMES.md;npm run mcp:elos.Test plan
npm test637/637, typecheck,eslint ., production buildhermes mcp test elos→ connected, 6 tools🤖 Generated with Claude Code