@helios123/josn
v0.1.0
Published
Claude MCP stdio server for Aliyun OSS uploads (CLI: josn)
Downloads
10
Readme
OSS MCP HTTP Tool
Overview
- Provides a simple HTTP endpoint to upload files to Aliyun OSS using ali-oss.
- Designed to be usable as an MCP tool via HTTP transport (command = server URL).
Endpoints
GET /health→ status and bucket info.GET /config→ safe subset of config (bucket, endpoint, cdn).POST /upload→ body:{ filePath: string, objectPath?: string }returns{ success, url, objectName }.
Setup
- Ensure Node.js 18+ is installed.
- Copy
.env(already included) or set environment variables:OSS_ACCESS_KEY_IDOSS_ACCESS_KEY_SECRETOSS_BUCKETOSS_ENDPOINTOSS_CDN_URL(optional but recommended for public URLs)
- Install dependencies:
npm installinoss-mcp/. - Start server:
npm start.
Test
- Run
npm run test:uploadwith server running. It uploadsoss-mcp/sample.txttomcp/uploads/sample-<timestamp>.txtand prints the URL.
MCP Integration (HTTP transport)
- In your MCP tool registry, set:
transport:httpcommand:http://localhost:3333(adjust PORT as needed)enabledTools: include a descriptor foruploadendpoint if your registry requires.- Optionally pass
envwith OSS_* entries (already in.env).
Doubao Model Note
- Your LLM selection (Doubao
doubao:doubao-seedream-4-0-250828) andDOUBAO_API_KEYare configured at the client/IDE level. - This server does not call the model; it only exposes an HTTP tool the LLM can invoke.
- Set your IDE to use Doubao and register this HTTP tool; then instruct the model to call
/uploadwith{ filePath, objectPath }.
Security
- Do not commit
.envwith production secrets in shared repos. - Prefer using dev/public endpoints (non-internal) for local testing.
CLI (MCP stdio)
- This package provides a CLI
josnthat runs a Model Context Protocol stdio server exposing anuploadtool. - Install globally:
npm i -g josn - Claude Desktop config example (Windows
%APPDATA%\Claude\claude_desktop_config.json): { "mcpServers": { "oss-aliyun-stdio": { "command": "josn", "args": [], "env": { "OSS_ACCESS_KEY_ID": "optional-override", "OSS_ACCESS_KEY_SECRET": "optional-override", "OSS_BUCKET": "optional-override", "OSS_ENDPOINT": "optional-override", "OSS_CDN_URL": "optional-override" } } } } - Keys are embedded with safe defaults for personal use; you can override via env.
Publish to npm
- Ensure you have an npm account and are logged in:
npm login - From project root
oss-mcp/, publish:npm publish - Update version in
package.jsonwhen republishing.
Usage in Claude
- After publishing, install globally:
npm i -g josn(or usenpx josn) - In Claude, add the MCP server config above and restart Claude Desktop.
