feat: add MCP tools for ingest pipeline control (status/pause/resume/retry-failed) - #656
Open
Kinghammer1 wants to merge 1 commit into
Open
feat: add MCP tools for ingest pipeline control (status/pause/resume/retry-failed)#656Kinghammer1 wants to merge 1 commit into
Kinghammer1 wants to merge 1 commit into
Conversation
…retry-failed)
Adds 4 new MCP tools so AI agents can control the ingest pipeline
without the UI, closing the gap described in the issue where ingest
pause/resume was locked behind UI buttons.
New MCP tools:
- llm_wiki_ingest_status: queue counts + paused flag + task list
- llm_wiki_ingest_pause: abort in-flight task, stop new tasks
- llm_wiki_ingest_resume: resume processing after pause
- llm_wiki_ingest_retry_failed: requeue all failed tasks
Architecture: the ingest queue lives in frontend TypeScript
(src/lib/ingest-queue.ts). Since the MCP server talks to the Rust
HTTP API, a Tauri event bridge connects them:
1. Rust HTTP endpoints emit 'ingest-api://request' events
2. Frontend listener (ingest-api-bridge.ts) calls ingest-queue fns
3. Frontend responds via 'ingest_api_response' Tauri command
4. Rust returns the result to the MCP client
Changes:
- src-tauri/src/api_server.rs: 4 new routes, event bridge, timeout
- src-tauri/src/lib.rs: ingest_api_response command + registration
- src/lib/ingest-api-bridge.ts: frontend event listener (new file)
- src/App.tsx: start bridge on app startup
- mcp-server/src/api-client.ts: 4 new API client methods + types
- mcp-server/src/index.ts: 4 tool definitions + handlers + formatters
- mcp-server/test/api-client.test.ts: 4 new tests (all passing)
Closes #{issue-number}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 4 new MCP tools so AI agents can control the ingest pipeline without the UI, closing the gap described in the issue where ingest pause/resume was locked behind UI buttons.
New MCP Tools
llm_wiki_ingest_statusllm_wiki_ingest_pausellm_wiki_ingest_resumellm_wiki_ingest_retry_failedArchitecture
The ingest queue lives entirely in frontend TypeScript (
src/lib/ingest-queue.ts). Since the MCP server talks to the Rust HTTP API, a Tauri event bridge connects them:api_server.rs): 4 new routes emitingest-api://requestTauri events with a unique request IDingest-api-bridge.ts): Listens for events, calls the correspondingingest-queuefunction, responds via theingest_api_responseTauri commandChanges
src-tauri/src/api_server.rs: 4 new routes (/ingest/status,/ingest/pause,/ingest/resume,/ingest/retry-failed), event bridge with timeout,complete_ingest_api_requestfunctionsrc-tauri/src/lib.rs:ingest_api_responseTauri command + registration in invoke handlersrc/lib/ingest-api-bridge.ts(new): Frontend event listener that calls ingest-queue functionssrc/App.tsx: Start bridge on app startupmcp-server/src/api-client.ts: 4 new API client methods + types + parsersmcp-server/src/index.ts: 4 tool definitions + handler cases + output formattersmcp-server/test/api-client.test.ts: 4 new tests (all passing)Testing
npm run typecheckandnpm test— 24/24 tests passcargo check— compiles cleanlynpx tsc --noEmit— compiles cleanlyBackward Compatibility