Skip to content

MCP Server

The CLI doubles as a local MCP server, exposing your media library to AI agents (Claude Desktop, Cursor, and other MCP clients) over stdio — using the API key in your config.

Run the server

bash
medialocker mcp serve

This speaks the MCP protocol on stdio, so it's launched by an MCP client rather than run by hand. stdout is reserved for the protocol; logs go to stderr.

Install into a client

bash
medialocker mcp install --client claude          # print a config block
medialocker mcp install --client claude --write  # merge into Claude Desktop's config
medialocker mcp install --client cursor          # print a Cursor config block

install emits (or merges) a medialocker MCP server entry that runs medialocker mcp serve with your resolved URL and API key.

Tools

The local server exposes these tools, each scoped by your API key's permissions:

ToolDoes
list_bucketsList buckets
create_bucketCreate a bucket
list_mediaList/filter media objects
search_mediaFull-text + facet search
get_objectObject metadata by id
get_object_urlA presigned download URL
upload_objectUpload a local file to a bucket
get_usageStorage and request usage snapshot

Local CLI server vs. the hosted MCP

MediaLocker also runs a hosted MCP server at https://mcp.medialocker.io over Streamable HTTP, with a richer tool catalog and a multi-tenant gateway. Pick based on how the agent connects:

Local (medialocker mcp serve)Hosted (mcp.medialocker.io)
Transportstdio (runs on your machine)Streamable HTTP (remote)
Setupmcp installPoint a client at the URL with a bearer token
ToolsThe core set aboveThe full catalog
Best forLocal/desktop agents, self-hosted instancesAlways-on, multi-client access

TIP

Use the local server when an agent runs on the same machine as the CLI; use the hosted MCP server for remote or always-on access. Both honor the same API keys and scopes.

See also

Released under the AGPL-3.0 License.