Skip to main content

Homemade-MCP is a tiny Python library that gives you one standard input/output format for multiple AI providers.

Project description

Homemade-MCP

Homemade-MCP is a tiny Python library that gives you one standard input/output format for multiple AI providers (OpenAI GPT, Google Gemini, Mistral OCR).

✨ Features:

  • Unified request/response schema (no more provider-specific formats).

  • LLM & OCR support: text, text+image, and documents.

  • Structured outputs: enforce JSON schema across models.

  • Thinking control (reasoning budget / effort) when supported.

  • Search grounding (Gemini’s Google Search integration).

  • Batch processing:

    • “Concurrent” mode → fast async fan-out.
    • “Native” batch (OpenAI & Gemini) → cheaper large jobs with JSONL.

Why?

Each provider (OpenAI, Gemini, Mistral) exposes different SDKs, request shapes, and batch/structured-output quirks. Homemade-MCP acts as a “universal socket”: one entry point, one output format. Swap providers or models without rewriting your code.


Installation

pip install -e .

Quick start

from homemade_mcp.client import LLMClient
from homemade_mcp.schemas import StdRequest, LLMInput, PDFDoc

client = LLMClient({
  "openai": {"api_key": "..."},
  "gemini": {"api_key": "..."},
  "mistral_ocr": {"api_key": "..."},
})

req = StdRequest(
    provider="openai",
    model="gpt-5",
    task="llm",
    input=LLMInput(
        blocks=["Extract title & price: Widget X costs 12.99"],
        json_schema={"type":"object","properties":{"title":{"type":"string"},"price":{"type":"number"}},"required":["title","price"]},
        thinking="low"
    )
)

resp = await client.run(req)
print(resp.content)  # {'title': 'Widget X', 'price': 12.99}

Roadmap

  • Add batch job polling helpers (OpenAI & Gemini).
  • Extend OCR adapter (PDFs, multi-page).
  • PDF rasterization helper (images for LLM vision) [optional extra dep].
  • Add more providers (Anthropic, Cohere, Claude OCR).
  • CLI tool for quick testing.

Contributing

Pull requests and issues welcome!

  • Keep code simple (no heavy abstractions).
  • Follow PEP8.
  • Add examples if you add features.

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

homemade_mcp-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

homemade_mcp-0.1.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file homemade_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: homemade_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.1 Linux/6.8.0-1030-azure

File hashes

Hashes for homemade_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 08977a0bba0a09b5d5d62ea7e651483fed1f503d1160aecece0ef014e1d481f3
MD5 b2709d3a97552524611d6d0e6b0aad4a
BLAKE2b-256 57601208e63d73915ad2c9e5324aba6752b6c09b058694442f245c139d1bd761

See more details on using hashes here.

File details

Details for the file homemade_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: homemade_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.1 Linux/6.8.0-1030-azure

File hashes

Hashes for homemade_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10e8257d2c55d9cffb07e2c625e97e9a31705a9f27f6cca99896f22982d5f46a
MD5 065b8ab6c094de23b30106481ed13d11
BLAKE2b-256 6b636545d40952facabc9c9a9078fb2ec7f52ff4405a46a8f4bf543ecfc0e81a

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