- Home
- MCP servers
- Civitai
Civitai
- python
0
GitHub Stars
python
Language
5 months ago
First Indexed
2 months 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": {
"waura-civitai-mcp-server": {
"command": "python",
"args": [
"civitai_mcp_server.py"
],
"env": {
"CIVITAI_API_KEY": "your_api_key_here"
}
}
}
}You run a Python-based MCP server that connects to the Civitai API to let you browse AI models, images, creators, and more through a standardized MCP client workflow. This server exposes a set of model search and detail endpoints, image browsing, and creator/tag discovery, enabling easy integration with your MCP client pipelines.
How to use
You start the server and connect with your MCP client to perform model searches, view model details, browse images, and explore creators and tags. Typical usage patterns include launching the server locally, deploying it with an MCP orchestration tool, and configuring your MCP client to point at the local or remote server. You will leverage the available tools to perform actions such as searching models, getting model details, browsing images, and filtering by tags or creators.
To run the server locally, start the Python script and then use your MCP client to issue commands like searching for models, retrieving model details, or browsing images. Deployment with Amazon Bedrock AgentCore is supported via the starter toolkit, which configures and launches the MCP server for you.
How to install
Prerequisites: you need Python and a working internet connection.
pip install -r requirements.txt
cp .env.example .env
# Edit .env file to set your CIVITAI_API_KEY
Configuration and usage notes
Configure your MCP client to connect to this server as shown in the MCP configuration example. If you plan to run the server directly on your machine, you can start it with Python and then point your MCP client to the local process.
{
"mcpServers": {
"civitai": {
"command": "python",
"args": ["path/to/civitai_mcp_server.py"],
"env": {
"CIVITAI_API_KEY": "your_api_key_here"
},
"disabled": false,
"autoApprove": []
}
}
}
Examples
You can perform common actions like searching models, getting model details, and browsing images using the provided toolset.
# Search models
search_models(query="anime", limit=10, sort="Most Downloaded")
# Get specific model details
get_model(model_id=12345)
# Get popular LORA models
get_models_by_type(type="LORA", sort="Most Downloaded", limit=5)
# Browse images
browse_images(limit=20, nsfw="None", sort="Newest")
Security and best practices
Store API keys securely using environment variables. Review NSFW filtering options and apply them appropriately. Regularly rotate API keys and monitor usage to stay within rate limits.
Available tools
search_models
Search models with filters such as query, type, and sort to locate relevant models.
get_model
Fetch detailed information about a specific model by its ID.
get_model_version
Retrieve details for a particular model version.
get_model_version_by_hash
Obtain model version information using a file hash.
get_popular_models
Get a list of currently popular models.
get_latest_models
Get the newest models available.
get_top_rated_models
Retrieve models with the highest ratings.
search_models_by_tag
Search models by a specific tag.
search_models_by_creator
Search models created by a particular creator.
get_models_by_type
Filter models by a specified type (e.g., LORA).
get_download_url
Obtain a direct download URL for a model version.
browse_images
Browse AI-generated images.
get_creators
Search for model creators.
get_tags
Search available tags.