Local Provider

Provider name: local

What It Does #

The local provider writes uploaded files on the Discord MCP host and returns a public URL for them.

This is useful when you want generated files to stay under your own control instead of being stored by an external upload service.

Typical Use Case #

Use local when you want the Discord MCP to:

  • generate an image
  • save the final file locally
  • return a URL under your own domain or under the built-in /uploads/... route

What You Can Configure #

Provider fields:

  • directory (optional, absolute path, default /app/uploads/{app_id})
  • public_url (optional, must contain {filename})
  • length (optional, random name length from 6 to 32, default 6)

Provider selection settings that can point to local:

  • image_uploader
  • default_image_uploader
  • uploader
  • default_uploader

In normal use, applications can only override length.

How It Resolves Paths #

  • If directory contains {app_id}, the Discord MCP replaces it.
  • If directory does not contain {app_id}, the Discord MCP uses it as-is.
  • If public_url is omitted, the Discord MCP builds a URL from the current site base URL and /uploads/{app_id}/{filename}.

Example with defaults:

  • file path: /app/uploads/123456789012345678/abC23d.png
  • returned URL: https://mcp.dis.gg/uploads/123456789012345678/abC23d.png

Filename Behavior #

When X-Current-Message is provided, this provider names files after the message snowflake:

  • format: {message_id}-{count}.{ext} (e.g. 1485939749880594594-1.png)
  • count starts at 1 and increments until an unused name is found
  • multiple images generated in the same request get sequential numbers

When X-Current-Message is not provided, a random name is used instead:

  • the random part uses a reduced character set without ambiguous characters
  • length controls the random part length
  • if a generated name already exists, the Discord MCP generates another one instead of overwriting the file

In both cases, the extension is derived from the content type when possible.

Important Notes #

  • directory must be writable by the API process
  • the built-in /uploads/... route only serves files that actually exist
  • invalid paths and traversal attempts are rejected

Related Tools #