Skip to main content

Module mcp

Module mcp 

Source
Expand description

MCP (Model Context Protocol) server — exposes scraping & pipeline tools MCP (Model Context Protocol) server for graph-based scraping.

Exposes stygian-graph scraping and pipeline capabilities as an MCP server over stdin/stdout using the JSON-RPC 2.0 protocol. External tools (LLM agents, IDE plugins) can scrape URLs, query REST/GraphQL APIs, parse feeds, and execute full pipeline DAGs via the standardised MCP interface.

§Enabling

[dependencies]
stygian-graph = { version = "*", features = ["mcp"] }

§Running the server

Add stygian-graph as a dependency with the mcp feature and call McpGraphServer::run() from your own binary:

use stygian_graph::mcp::McpGraphServer;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    McpGraphServer::run().await
}

§Protocol

Implements MCP 2026-07-28 over JSON-RPC 2.0 on stdin/stdout.

MCP MethodDescription
server/discoverAdvertise protocol versions, identity, capabilities
tools/listList available scraping and pipeline tools
tools/callExecute a scraping or pipeline tool

§Migrating from MCP 2025-11-25

The initialize / notifications/initialized handshake was removed. Clients must advertise their protocol version, identity, and capabilities in the _meta block of every request under the io.modelcontextprotocol/* keys. See the extract_client_protocol_version and extract_meta helpers for the reader-side extraction (used by future PRs in the MCP-001 migration sequence; PR 1 only adds them as helpers — enforcement lands in PR 4 alongside the aggregator).

§Tools

ToolKey ParametersReturns
scrapeurl, timeout_secs?, proxy_url?, rotate_ua?data, metadata
scrape_resturl, method?, auth?, query?, body?, headers?, pagination?, data_path?data, metadata
scrape_graphqlurl, query, variables?, auth?, data_path?data, metadata
scrape_sitemapurl, max_depth?data (JSON array of entries), metadata
scrape_rssurldata (JSON array of items), metadata
pipeline_validatetomlnodes, services, execution_order, valid
pipeline_runtoml, timeout_secs?per-node outputs, skipped, errors
charon_*feature-gated HAR diagnostics and planning inputsCharon report/policy JSON payloads

Structs§

McpGraphServer
MCP server exposing stygian-graph scraping and pipeline tools.