Repository navigation
feat(mcp): implement antigravity 2.0 stdio mcp server with publication preview, toc, and metadata tools - #6
Merged
Conversation
…view, toc, and metadata tools
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.
🎯 Ringkasan Perubahan Utama (Summary)
PR ini mengimplementasikan server Model Context Protocol (MCP) mandiri di
src/antigravity/mcp-server.tsberbasis transportstdiodan protokol standar JSON-RPC 2.0 (ringan, ~30 KB bundle, zero external runtime dependencies). Server ini mengekspos 3 perkakas otonom cerdas (autonomous tools) kepada AI Agent di Antigravity untuk berinteraksi dengan pembaca dokumen secara instan: membuka buku ke dalam Sidecar UI, membaca struktur daftar isi (TOC) dan urutan bab spine, serta mengekstrak metadata bibliografi publikasi.✨ Fitur Baru & Pembaruan (Features & Updates)
McpServerdisrc/antigravity/mcp-server.tsyang menangani message stream via newline-delimited JSON-RPC 2.0.initialize,notifications/initialized,ping,tools/list, dantools/call.xhtml_open_preview]:filePath(wajib),spineIndex(opsional), dantargetId(opsional)./api/openSidecar Server lokal.sidecar://xhtml-reader-plugin/xhtml-previewer/) dan direct browser URL.xhtml_get_toc]:filePath(wajib).src/core/epub.tsdansrc/core/archive.ts) untuk mengekstrak navigasi daftar isi (toc.xhtml/toc.ncx) dan urutan bab spine tanpa memerlukan GUI.xhtml_get_metadata]:filePath(wajib).isError: trueyang terstruktur.📦 Maintenance & Testing
package.json:build:mcpmenggunakanesbuildyang mengompilasisrc/antigravity/mcp-server.tsmenjadidist/mcp-server.cjs.npm run build:mcpke dalam pipelinenpm run build.test/mcp-server.test.mjs):initialize/ping, listing tools, pemanggilan ketiga tools dengan validasi format teks Markdown, simulasi live sidecar server, error handling, serta pengujian spawned child process STDIO pipe.Catatan Reviewer / Dev Notes:
feature/019-antigravity-mcp-servermain.