Skip to content

OpenAgentPlatform/file-uploader

Repository files navigation

File Uploader MCP Server

Upload local files to OAP (OpenAgentPlatform) remote storage.

Usage

Mainly used in combination with MCP that accepts URL for files.
For example: Use image edit MCP on a local image.

sequenceDiagram
    participant User
    participant LLM
    participant FileUploader
    participant ImageEditMCP

    User->>LLM: Edit this imege {LOCAL_PATH}
    LLM->>FileUploader: Upload local file
    FileUploader->>LLM: Storage URL
    LLM->>ImageEditMCP: Edit this image {URL}
    ImageEditMCP->>LLM: Edited image
    LLM->>User: Here is the result
Loading

Installation

{
  "mcpServers": {
    "file-uploader": {
      "command": "npx",
      "args": ["@oaphub/file-uploader-mcp"]
    }
  }
}

Configuration

Set these environment variables before running:

Variable Required Default Description
OAP_CLIENT_KEY No - Your OAP client key for longer expiration time. (> 1h)
OAP_STORAGE_BASE_URL No https://storage.oaphub.ai Base URL of the storage API

Aquire OAP Client Key

Tool: upload_file

Uploads a file to storage and returns a URL.

Parameters

Name Type Required Description
file_path string Yes Path to the file to upload
expire_after number No Seconds until file expires (minimum: 60, default: 60)

Response

Returns a JSON object with the uploaded file URL:

{
  "url": "https://storage.oaphub.ai/v/xxxxxxxx/xxxxx.md"
}

Local Development

To test the MCP server locally before publishing

npm run build
{
  "mcpServers": {
    "file-uploader": {
      "command": "node",
      "args": ["/path/to/file-uploader/dist/index.js"]
    }
  }
}

Publishing

This package uses automated publishing via GitHub Actions. To release:

  • Create and push a git tag:
    git tag v0.1.0
    git push origin v0.1.0

The GitHub Action will automatically build and publish to npm.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors