Skip to main content

MCP server for Doc_Conv — convert PDF/Word/Excel/PowerPoint to Markdown, paid per call with USDC via the x402 protocol (Base).

Project description

docconv-mcp

MCP server for Doc_Conv — convert PDF / Word / Excel / PowerPoint documents to Markdown, paid per conversion with USDC on Base via the x402 protocol (gasless, EIP-3009). No account, no API key: the agent signs a USDC payment and the service returns Markdown.

Why? Feeding formatted files (PDF/PPT/DOCX) straight into an LLM can cost 5–50× more tokens than the same content as Markdown. This lets an agent cheaply pre-convert documents before use.

Tools

  • estimate_conversion(file_path) — free price quote (pages, credits, priceUsdc, jobId, jobToken). No payment, no side effects.
  • convert_document(file_path, max_usdc=1.0, poll_seconds=300) — pays via x402 (rejects if the quote exceeds max_usdc) and converts. Returns inline markdown for text documents, or a downloadUrl (zip) when the document contains images.

Install

Published to PyPI as docconv-mcp. Run with uvx (no install) or pip install docconv-mcp.

Configuration (env)

Variable Description Default
DOC_CONV_AGENT_PK Private key of the agent's Base wallet (must hold USDC). Signs x402 payments. Secret — never commit or share. (required)
DOC_CONV_BASE_URL Doc_Conv service base URL. Override only if self-hosting. https://converter.crepe.fund

The wallet needs USDC on Base; gas is paid by the service's x402 facilitator (the agent needs no ETH). Pricing is by document size: 50 pages = 1 credit = 0.2 USDC (call estimate_conversion for the exact amount).

Claude Desktop / Claude Code (claude_desktop_config.json or .mcp.json)

{
  "mcpServers": {
    "doc-conv": {
      "command": "uvx",
      "args": ["docconv-mcp"],
      "env": { "DOC_CONV_AGENT_PK": "0x<your-agent-wallet-private-key>" }
    }
  }
}

Claude Code one-liner:

claude mcp add doc-conv -- env DOC_CONV_AGENT_PK=0x<key> uvx docconv-mcp

Example

"Convert ~/papers/report.pdf to Markdown."

The agent calls estimate_conversion to see the price (e.g. 0.3 USDC), then convert_document to pay via x402 and return the Markdown. If conversion fails, the paid credit is retained on the payer wallet for reuse.

⚠️ convert_document spends real USDC. Use max_usdc to cap per-call cost.

Links

License

MIT © CREPE Foundation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docconv_mcp-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docconv_mcp-1.0.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file docconv_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: docconv_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for docconv_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86ba6200ff3361980a47847eb753bbd34d8dbfc0475aada43e77caa4c0087637
MD5 fba00f0927095385dea56aab0e64e497
BLAKE2b-256 53c82a42e9bc0a886a0c49df5cadde2d720edf6f0f54463e31772e8c22daf23c

See more details on using hashes here.

File details

Details for the file docconv_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: docconv_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for docconv_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1c304c1ee0cfe897eccf71086b0f491d9dd3a84afe0d508077b52f627767a3d
MD5 199599f446b6dbf20246c33177b304f8
BLAKE2b-256 554c77e02a136addd41d62ff2dbd7268751c555f4c9774ac6f37c7b12f73a2fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page