Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 1.52 KB

File metadata and controls

41 lines (33 loc) · 1.52 KB

FluxMCP

MCP (Model Context Protocol) server for Flux AI image generation via AceDataCloud API.

Project Structure

core/
  config.py     — Settings dataclass (API token, base URL)
  server.py     — FastMCP server singleton
  client.py     — httpx async HTTP client
  types.py      — Literal types (FluxModel, etc.)
  exceptions.py — Error classes (AuthError, APIError, TimeoutError)
  utils.py      — Formatting helpers
tools/
  image_tools.py   — generate images from prompts
  task_tools.py    — query task status
  info_tools.py    — list models, actions
prompts/           — LLM guidance prompts
tests/             — pytest-asyncio + respx tests

Sync from Docs

When invoked by the sync workflow, the Docs repo is checked out at _docs/. Your job:

  1. Source of truth_docs/openapi/flux.json is the OpenAPI spec for the FluxMCP API.
  2. Compare models — The Literal types in core/types.py must match the spec's model enum. Add/remove as needed.
  3. Compare parameters — Each @mcp.tool() function's parameters should match the corresponding OpenAPI endpoint.
  4. Update defaults — If a new model becomes the recommended default, update the default in core/types.py.
  5. Update README — Keep the model table and feature list current.
  6. Add tests — For new tools or parameters, add test cases in tests/.
  7. PR title — Use format: sync: <description> [auto-sync]

Development

pip install -e ".[dev]"
pytest --cov=core --cov=tools
ruff check .