- Home
- MCP servers
- MCP DeepInfra AI Tools Server
MCP DeepInfra AI Tools Server
- python
1
GitHub Stars
python
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"phuihock-mcp-deeinfra": {
"command": "uv",
"args": [
"run",
"mcp_deepinfra"
],
"env": {
"DEEPINFRA_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}You run a flexible MCP server that exposes AI capabilities via the DeepInfra API, including image generation, text processing, embeddings, speech recognition, and more. This server lets you connect from MCP clients to perform these tasks locally or in your environment, with model selection and tool enablement configurable through environment variables.
How to use
You connect with an MCP client by running the server locally and pointing your client to the local or configured endpoint. The server uses your DeepInfra API key to access tools such as image generation, text generation, embeddings, and speech transcription. To enable and tailor capabilities, set environment variables before starting the server, including which tools are active and which models to use by default.
How to install
Prerequisites: Python and a runtime environment for MCP. You also use a package manager named uv for local setup and running the MCP server.
Step 1: Install uv if you don’t have it yet.
curl -LsSf https://astral.sh/uv/install.sh | sh
Step 2: Prepare your working directory by obtaining the server code (clone or download) and navigate into the project directory.
Step 3: Install dependencies using uv.
uv sync
Step 4: Create your API key file in the project root to provide authentication for the DeepInfra API.
DEEPINFRA_API_KEY=your_api_key_here
Step 5: Start the server locally using one of the supported start commands.
uv run mcp_deepinfra
Alternatively, you can start the server directly with Python if you prefer the module approach.
python -m mcp_deepinfra.server
Additional configuration and runtime notes
To tailor which tools are active and which models they use by default, set environment variables in a .env file in the project root.
Key variables include the following, with their default values used when not overridden.
-
ENABLED_TOOLS: Comma-separated list of tools to enable. Use all to enable every available tool. Example: ENABLED_TOOLS=generate_image,text_generation,embeddings
-
MODEL_GENERATE_IMAGE: Default image generation model (default Bria/Bria-3.2)
-
MODEL_TEXT_GENERATION: Default text generation model (default meta-llama/Llama-2-7b-chat-hf)
-
MODEL_EMBEDDINGS: Default embeddings model (default sentence-transformers/all-MiniLM-L6-v2)
-
MODEL_SPEECH_RECOGNITION: Default speech recognition model (default openai/whisper-large-v3)
-
MODEL_ZERO_SHOT_IMAGE_CLASSIFICATION: Default zero-shot image classification model (default openai/gpt-4o-mini)
-
MODEL_OBJECT_DETECTION: Default object detection model (default openai/gpt-4o-mini)
-
MODEL_IMAGE_CLASSIFICATION: Default image classification model (default openai/gpt-4o-mini)
-
MODEL_TEXT_CLASSIFICATION: Default text classification model (default microsoft/DialoGPT-medium)
-
MODEL_TOKEN_CLASSIFICATION: Default token classification model (default microsoft/DialoGPT-medium)
-
MODEL_FILL_MASK: Default fill mask model (default microsoft/DialoGPT-medium)
Using with MCP clients
Configure your MCP client to point to this server, enabling a smooth workflow for triggering AI tools from your client interface.
If you use a client similar to Claude Desktop, you would provide a configuration that runs the MCP server locally and passes the API key.
Security and best practices
Keep your DEEPINFRA_API_KEY secure and do not commit it to version control. Rotate keys if you suspect they are compromised. Use environment-based configuration to avoid exposing sensitive data in logs or code.
Available tools
generate_image
Create an image from a text prompt and return the image URL.
text_generation
Produce a text completion given a prompt.
embeddings
Generate vector embeddings for a list of input texts.
speech_recognition
Transcribe speech from an audio URL using Whisper model.
zero_shot_image_classification
Classify an image into candidate labels using a vision model.
object_detection
Detect and describe objects in an image using a multimodal model.
image_classification
Classify and describe the contents of an image using a multimodal model.
text_classification
Analyze text for sentiment and category.
token_classification
Perform named entity recognition on text.
fill_mask
Fill masked tokens in text with appropriate words.