Repository navigation
feat(cli): markkit mcp stdio server exposing the markkit tool - #41
Merged
Merged
Conversation
Opt-in `tool` feature adds markkit::tool: MarkkitToolBuilder -> MarkkitTool -> single-use ToolExecution, mirroring bashkit's tool module. One call converts a url, html or base64 document to Markdown; args validated before execution, base64 bounded before decode, URL via the SSRF guard, output capped by max_output_chars. Adds Markkit::extract_url_document.
wasm-bindgen build of markkit (html, docx, spreadsheet, tool) for wasm32-unknown-unknown: single-threaded, no COOP/COEP, no URL fetching. Markkit class with validated camelCase options plus MarkkitTool. Node tests, CI job gating Check, and an OIDC npm publisher.
Node functions take an optional trailing MarkkitOptions object with every builder field plus URL policy (allowPrivateNetworks, allowedHosts, maxRedirects, maxProcessingSecs); same camelCase shape as the WASM package. Adds extractDocument/extractDocumentSync with title, format, warnings and stats, and node --test binding tests in js.yml.
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.
Requested by Михайло · project thread
What changed
New
markkit mcpsubcommand: a Model Context Protocol server over stdio that exposes themarkkittool (MarkkitTool) to MCP clients (Claude Code, Claude Desktop, Cursor, etc.).initialize(negotiates2025-06-18/2025-03-26/2024-11-05),ping,tools/list,tools/call; notifications get no reply.tools/callreturns the tool result as text content plusstructuredContent; bad arguments and extraction failures come back asisError: trueresults with the localized message, internal errors go to stderr only.--no-url(offline,urlsource removed from the schema),--max-size,--max-output-chars,--main-content,--locale.--max-size+ 1 MiB); oversized lines are drained without buffering and answered with-32700, session continues.Client config:
{"mcpServers": {"markkit": {"command": "markkit", "args": ["mcp"]}}}Docs: new
knowledge/integrations/mcp-server.md, threat-model attack-surface row for MCP messages, README, CHANGELOG, log.Why
Roadmap initiative 8 ("tool - yes, mcp server - very optional"). Lets any MCP client use markkit with no glue code, built on the tool contract from #19.
Before / After
Before: no MCP entry point;
markkit mcpis an unknown subcommand.After:
Tests: 10 unit tests in
mcp.rs+ 3 end-to-end tests spawning the binary (tests/mcp_integration.rs), incl. metadata-address SSRF block,--no-url, malformed/oversized messages.cargo test --workspace, clippy-D warnings, fmt, check-okf all pass locally.Risk
markkit-clinow enables markkit'stoolfeature (adds tower/base64 to the CLI build only).Checklist