DeepInfra API

by phuihock

Not rated
GitHub

About

Provides a full suite of AI tools via DeepInfra’s OpenAI-compatible API, including image generation, text processing, embeddings, and speech recognition.

Details

Author
phuihock
Categories
Developer Tools, AI, API, Other

Setup

Install DeepInfra API in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/phuihock/mcp-deeinfra

Follow the installation instructions in the repository README, then restart your MCP client.

This is a Model Context Protocol (MCP) server that provides various AI capabilities using the DeepInfra OpenAI-compatible API, including image generation, text processing, embeddings, speech recognition, and more.

mcp-deepinfra/ ├── src/ │ └── mcp_deepinfra/ │ ├── __init__.py # Package initialization │ └── server.py # Main MCP server implementation ├── tests/ │ ├── conftest.py # Pytest fixtures and configuration │ ├── test_server.py # Server initialization tests │ └── test_tools.py # Individual tool tests ├── pyproject.toml # Project configuration and dependencies ├── uv.lock # Lock file for uv package manager ├── run_tests.sh # Convenience script for running tests └── README.md # This file
curl -LsSf https://astral.sh/uv/install.sh | sh

Set up your DeepInfra API key: Create a.envfile in the project root:

You can configure which tools are enabled and set default models for each tool using environment variables in your.envfile:

-

ENABLED_TOOLS: Comma-separated list of tools to enable. Use "all" to enable all tools (default: "all"). Example:ENABLED_TOOLS=generate_image,text_generation,embeddings

MODEL_GENERATE_IMAGE: Default model for image generation (default: "Bria/Bria-3.2")

MODEL_TEXT_GENERATION: Default model for text generation (default: "meta-llama/Llama-2-7b-chat-hf")

MODEL_EMBEDDINGS: Default model for embeddings (default: "sentence-transformers/all-MiniLM-L6-v2")

MODEL_SPEECH_RECOGNITION: Default model for speech recognition (default: "openai/whisper-large-v3")

MODEL_ZERO_SHOT_IMAGE_CLASSIFICATION: Default model for zero-shot image classification (default: "openai/gpt-4o-mini")

MODEL_OBJECT_DETECTION: Default model for object detection (default: "openai/gpt-4o-mini")

MODEL_IMAGE_CLASSIFICATION: Default model for image classification (default: "openai/gpt-4o-mini")

MODEL_TEXT_CLASSIFICATION: Default model for text classification (default: "microsoft/DialoGPT-medium")

MODEL_TOKEN_CLASSIFICATION: Default model for token classification (default: "microsoft/DialoGPT-medium")

MODEL_FILL_MASK: Default model for fill mask (default: "microsoft/DialoGPT-medium")

The tools always use the models specified via environment variables. Model selection is configured at startup time through the environment variables listed above.

Configure your MCP client (e.g., Claude Desktop) to use this server.

For Claude Desktop, add to yourclaude_desktop_config.json:

{ "mcpServers": { "deepinfra": { "command": "uv", "args": ["run", "mcp_deepinfra"], "env": { "DEEPINFRA_API_KEY": "your_api_key_here" } } } }

This server provides the following MCP tools:

- generate_image: Generate an image from a text prompt. Returns the URL of the generated image.
- text_generation: Generate text completion from a prompt.
- embeddings: Generate embeddings for a list of input texts.
- speech_recognition: Transcribe audio from a URL to text using Whisper model.
- zero_shot_image_classification: Classify an image into provided candidate labels using vision model.
- object_detection: Detect and describe objects in an image using multimodal model.
- image_classification: Classify and describe contents of an image using multimodal model.
- text_classification: Analyze text for sentiment and category.
- token_classification: Perform named entity recognition (NER) on text.
- fill_mask: Fill masked tokens in text with appropriate words.

To test the server locally, run the pytest test suite:

# Install test dependencies uv sync --extra test # Run all tests pytest # Run with verbose output pytest -v # Run specific test file pytest tests/test_tools.py # Use the convenience script ./run_tests.sh

- Server initialization and tool listing
- Individual tool functionality tests via JSON-RPC protocol
- All tests run synchronously without async/await complexity

uvxis designed for running published Python packages from PyPI or GitHub. For local development, use theuv runcommand as described above.

If you publish this package to PyPI (e.g., asmcp-deepinfra), you can run it with:

{ "mcpServers": { "deepinfra": { "command": "uvx", "args": ["mcp-deepinfra"], "env": { "DEEPINFRA_API_KEY": "your_api_key_here" } } } }

For local development, stick with theuv runapproach.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

MCP server for OpenAI ChatGPT API — chat, vision, and embeddings

A unified framework for integrating various language models and embedding providers to generate text completions and embeddings.

Generate images using the Together AI API. Supports custom aspect ratios, save paths, and batch generation.

Identity infrastructure for the AI economy. 33-trait psychometric engine — belonging probability, trait vectors, attunement depth. Remote streamable-HTTP. Free tier: 16 tools, 10 req/min.

An unofficial MCP server for the Artificial Analysis API

Access 30+ AI models in Claude Code with zero API keys. One wallet, pay-per-request.

An image generation server that connects to a local ComfyUI instance via its API, supporting dynamic workflows.

A Model Context Protocol server that provides access to the connpass users API v2, utilizing Gemini for grounding.

Give any LLM agent a real Android or iPhone as its body — 62 MCP tools for tap, swipe, type, screenshot, app launch, camera, TTS, on-device inference, and batched automation.

Remote Streamable HTTP MCP gateway for GPT-5.5 chat plus 92 text, web, JSON, and x402 discovery tools with Base USDC pay-per-call.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.