Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

Crate doiget_mcp

Crate doiget_mcp 

Source
Expand description

doiget MCP server (stdio).

Phase 3 foundation. JSON-RPC framing is provided by the official rmcp SDK with stdio-only transport (transport-io). See ADR-0001 for the permanence of the stdio-only choice and docs/MCP_TOOLS.md for the tool surface contract.

This module ships the rmcp wiring + the always-on tools that prove the foundation:

  • doiget_health — operational sanity check.
  • doiget_capability_profile — reports the runtime CapabilityProfile.
  • doiget_metadata_only — DOI / arXiv id metadata resolution. Both the dry_run: true preview path (ADR-0022) and the live non-dry-run path (dispatches through doiget_core::orchestrator::metadata_only_to_store, which also performs the docs/MCP_TOOLS.md §11 store-write SIDE EFFECT) are wired. The tool MUST NOT call HttpClient::fetch_pdf — that contract is enforced by the orchestrator and the posture-lint workflow.

The remaining tools named in docs/MCP_TOOLS.md (doiget_fetch_paper, doiget_batch_fetch, doiget_info, doiget_search_local, doiget_list_recent, doiget_paper_pdf_path) land in follow-up PRs. The exact count is intentionally left unstated in this docstring so it does not rot as tools land.

§Stdout safety

Per docs/SECURITY.md §3, stdout is reserved for JSON-RPC frames only. clippy::print_stdout is denied below at the crate root; tracing must be redirected to stderr by the binary entry point. The doiget-cli main() wires tracing_subscriber::fmt().with_writer(std::io::stderr) before calling Server::run.

Structs§

BatchFetchInput
JSON-schema-derived input for doiget_batch_fetch.
BatchFromBibliographyInput
JSON-schema-derived input for doiget_batch_from_bibliography per ADR-0030 D6.
BibtexExportInput
JSON-schema-derived input for the doiget_bibtex_export MCP tool. One or many refs (docs/MCP_TOOLS.md §1 row doiget_bibtex_export); each is resolved independently.
CslExportInput
JSON-schema-derived input for the doiget_csl_export MCP tool.
ExpandCitationGraphInput
JSON-schema-derived input for the doiget_expand_citation_graph MCP tool. Always present in the type system — the #[tool_router] macro references this type unconditionally and a cfg-gated pub struct would cause an unresolved type error in the default build. The feature-gate is applied only to the tool body, which returns NOT_IMPLEMENTED when built without --features citation. ADR-0010 hard caps (depth<=3, total<=100, per_paper<=20) are applied inside the tool body via GraphCaps::clamped — the Option<u32> fields below are caller hints, not authoritative.
FetchPaperInput
JSON-schema-derived input for doiget_fetch_paper. Same wire shape as MetadataOnlyInput — just a different orchestrator target.
InfoInput
JSON-schema-derived input for the doiget_info MCP tool.
ListRecentInput
JSON-schema-derived input for the doiget_list_recent MCP tool.
MetadataOnlyInput
JSON-schema-derived input for the doiget_metadata_only MCP tool.
PaperPdfPathInput
JSON-schema-derived input for the doiget_paper_pdf_path MCP tool.
ResolvePaperInput
JSON-schema-derived input for the doiget_resolve_paper MCP tool.
SearchLocalInput
JSON-schema-derived input for the doiget_search_local MCP tool.
Server
MCP server handle. Owns the resolved CapabilityProfile plus the statically-built rmcp tool router.