MCP DeepInfra AI Tools Server
This MCP server provides comprehensive AI capabilities through DeepInfra's OpenAI-compatible API:
Image Generation - Create images from text prompts using models like Bria-3.2, returning the generated image URL
Text Generation - Generate text completions and responses from prompts using LLMs like Llama-2
Text Embeddings - Convert text into vector embeddings for semantic analysis and similarity comparisons
Speech Recognition - Transcribe audio files from URLs to text using Whisper models
Zero-Shot Image Classification - Classify images into custom categories by comparing against provided candidate labels
Object Detection - Detect and describe objects within images using multimodal models
Image Classification - Analyze and classify image contents with detailed descriptions
Text Classification - Analyze text for sentiment and categorization
Token Classification (NER) - Extract and classify named entities (people, places, organizations) from text
Fill Mask - Predict and fill in masked/missing words in text sequences
All tools are configurable via environment variables, support custom model selection, can be selectively enabled/disabled, and require a DeepInfra API key for authentication.
Provides AI capabilities using DeepInfra's OpenAI-compatible API, including image generation, text processing, embeddings, speech recognition, image classification, object detection, and various NLP tasks like sentiment analysis and named entity recognition.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP DeepInfra AI Tools Server generate an image of a futuristic city at sunset with flying cars"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP DeepInfra AI Tools Server
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.
Project Structure
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 fileRelated MCP server: Hugging Face MCP Server
Setup
Install uv if not already installed:
curl -LsSf https://astral.sh/uv/install.sh | shClone or download this repository.
Install dependencies:
uv syncSet up your DeepInfra API key: Create a
.envfile in the project root:DEEPINFRA_API_KEY=your_api_key_here
Configuration
You can configure which tools are enabled and set default models for each tool using environment variables in your .env file:
ENABLED_TOOLS: Comma-separated list of tools to enable. Use "all" to enable all tools (default: "all"). Example:ENABLED_TOOLS=generate_image,text_generation,embeddingsMODEL_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.
Running the Server
To run the server locally:
uv run mcp_deepinfraOr directly with Python:
python -m mcp_deepinfra.serverUsing with MCP Clients
Configure your MCP client (e.g., Claude Desktop) to use this server.
For Claude Desktop, add to your claude_desktop_config.json:
{
"mcpServers": {
"deepinfra": {
"command": "uv",
"args": ["run", "mcp_deepinfra"],
"env": {
"DEEPINFRA_API_KEY": "your_api_key_here"
}
}
}
}Tools Provided
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.
Testing
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.shThe tests include:
Server initialization and tool listing
Individual tool functionality tests via JSON-RPC protocol
All tests run synchronously without async/await complexity
Running with uvx
uvx is designed for running published Python packages from PyPI or GitHub. For local development, use the uv run command as described above.
If you publish this package to PyPI (e.g., as mcp-deepinfra), you can run it with:
uvx mcp-deepinfraAnd configure your MCP client to use:
{
"mcpServers": {
"deepinfra": {
"command": "uvx",
"args": ["mcp-deepinfra"],
"env": {
"DEEPINFRA_API_KEY": "your_api_key_here"
}
}
}
}For local development, stick with the uv run approach.
Available Tools
10 toolsembeddingsB
Generate embeddings for a list of texts using DeepInfra OpenAI-compatible API.
Inputs: inputs (required). Returns: result
fill_maskC
Fill masked tokens in text using DeepInfra OpenAI-compatible API.
Inputs: text (required). Returns: result
generate_imageB
Generate an image from a text prompt using DeepInfra OpenAI-compatible API.
Inputs: prompt (required). Returns: result
image_classificationC
Classify an image using DeepInfra OpenAI-compatible API with multimodal model.
Inputs: image_url (required). Returns: result
object_detectionB
Detect objects in an image using DeepInfra OpenAI-compatible API with multimodal model.
Inputs: image_url (required). Returns: result
speech_recognitionB
Transcribe audio to text using DeepInfra OpenAI-compatible API (Whisper).
Inputs: audio_url (required). Returns: result
text_classificationB
Classify text using DeepInfra OpenAI-compatible API.
Inputs: text (required). Returns: result
text_generationB
Generate text completion using DeepInfra OpenAI-compatible API.
Inputs: prompt (required). Returns: result
token_classificationB
Perform token classification (NER) using DeepInfra OpenAI-compatible API.
Inputs: text (required). Returns: result
zero_shot_image_classificationB
Classify an image with zero-shot labels using DeepInfra OpenAI-compatible API (CLIP).
Inputs: image_url (required), candidate_labels (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose targeting different AI tasks (embeddings, text generation, image generation, classification, etc.). No ambiguity exists as tools are specialized for specific operations like speech recognition vs. text classification, with clear boundaries between them.
All tool names follow a consistent snake_case pattern with descriptive verb_noun or noun_verb structures (e.g., generate_image, text_classification). The naming is uniform across all tools, making them easily predictable and readable.
With 10 tools, the count is well-scoped for an AI tools server covering diverse tasks like text, image, and audio processing. Each tool earns its place by addressing a specific AI function without redundancy or bloat.
The tool set provides comprehensive coverage for common AI tasks (text, image, audio) with clear operations like generation, classification, and detection. Minor gaps might include more advanced or niche AI functions, but core workflows are well-covered for the domain.
Maintenance
Related MCP Connectors
Image, video, music and text generation across 100+ models through one endpoint.
One API for 100+ AI video, image, music and speech models.
Generate images and videos with 200+ AI models (GPT-Image-2, Seedance, Veo, Kling) via one API.
Generate images, video, music, voice and 3D through one API. 30 tools, 200+ models.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables speech-to-text transcription, text-to-speech synthesis, and audio analysis using Deepgram's AI models. Supports features like speaker diarization, sentiment analysis, language detection, and various audio processing capabilities.2MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables access to 200,000+ machine learning models through the Hugging Face Inference API. Supports text generation, image creation, classification, translation, speech processing, embeddings, and more AI tasks.-
- FlicenseNot gradedqualityNot gradedmaintenanceProvides AI-powered tools for image generation, text-to-speech conversion, background removal, and image upscaling through OpenAI and image processing APIs.38 npm-
- AlicenseNot gradedqualityDmaintenanceProvides 80+ image processing tools including AI generation, background removal, upscaling, local manipulation, and diagram rendering, all with built-in cost tracking and health monitoring.44 npmMIT