Upload local files to OAP (OpenAgentPlatform) remote storage.
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
{
"mcpServers": {
"file-uploader": {
"command": "npx",
"args": ["@oaphub/file-uploader-mcp"],
"env": {
"OAP_CLIENT_KEY": "your-client-key"
}
}
}
}Set these environment variables before running:
| Variable | Required | Default | Description |
|---|---|---|---|
OAP_CLIENT_KEY |
Yes | - | Your OAP client key |
OAP_STORAGE_BASE_URL |
No | https://storage.oaphub.ai |
Base URL of the storage API |
- Go to oaphub.ai
- Click Sign Up and create your account
- Obtain your Client Key from oaphub.ai/u/clientkeys
Uploads a file to storage and returns a URL.
| 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) |
Returns a JSON object with the uploaded file URL:
{
"url": "https://storage.oaphub.ai/v/xxxxxxxx/xxxxx.md"
}To test the MCP server locally before publishing
npm run build{
"mcpServers": {
"file-uploader": {
"command": "node",
"args": ["/path/to/file-uploader/dist/index.js"],
"env": {
"OAP_CLIENT_KEY": "your-client-key"
}
}
}
}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.