Skip to content

MCP server

MCP overview

An MCP server that lets an AI agent run every tool of Vukem Tools on files on your machine.

Last updated:

You will learn#

  • What the MCP server is and what an agent can do with it.
  • What a result and an error look like.
  • The rules that keep an agent from doing more than you meant.

The idea#

vukem-tools mcp is a Model Context Protocol server. An agent in Claude Code, Claude Desktop, Cursor or any other MCP client sees 54 tools and can run the 37 that work on files: crop a PDF, compress a video, convert an image, pack an archive. The other 17 run in the browser on the site: they are listed so an agent knows they exist, and a call to one answers browser_only. See the tools.

The server converts nothing itself. It is a thin client of the HTTP API, like the CLI, and both read the same table of tools. For each call it checks the arguments, uploads your file to a Vukem Tools server, waits for the conversion, and downloads the result to the path you named.

The client starts the program and talks to it on standard input and output, one JSON-RPC message per line. No port is opened. When the client closes the pipe, calls still running are finished first. A batch (a JSON array) is not supported and is answered with -32600.

MethodResult
initializeEchoes the protocol version the client asked for (2025-06-18 when it names none), the capability tools, and serverInfo with the name vukem-tools and the version.
pingAn empty object.
tools/listEvery tool, under result.tools. Each entry has name, title, description, a closed inputSchema and _meta with the kind (pipeline or browser), the group and, for a pipeline tool, the CLI area and command.
tools/callRuns one tool.
notifications/cancelledCancels the running call whose id is in params.requestId.
Any other notifications/*Ignored. No answer.

Any other method is answered with the JSON-RPC error -32601. Malformed JSON is -32700. A tools/call with an unknown tool name, or with params that are not an object with a name, is -32602. Up to four tools/call requests run at once on one connection; the rest wait their turn, and ping is still answered while a long conversion runs.

Quick start#

You need the vukem-tools command-line program (Installation), a running Vukem Tools server (the desktop app or Docker), and an API key with the abilities of the tools the agent may use. Two environment variables tell the server where to go:

VariableDefaultMeaning
VUKEM_TOOLS_URLhttp://localhost:3000The Vukem Tools server.
VUKEM_TOOLS_API_KEYnoneThe API key. Without it a call fails with missing_key.

The key stays in memory. It is never printed, logged or written to disk. Register the server in Claude Code:

Terminal
claude mcp add --env VUKEM_TOOLS_URL=http://localhost:3000 \
  --env VUKEM_TOOLS_API_KEY=vk_... \
  --transport stdio vukem-tools -- vukem-tools mcp

Claude Desktop and Cursor take a JSON entry instead: see Connect a client. Then ask the agent for something a tool does:

Crop 36 points off every edge of in.pdf and save it as out.pdf.

The agent calls pdf-crop. The server then does what the CLI would:

  1. It checks the arguments against the tool's schema before anything leaves your machine.
  2. It uploads in.pdf and submits the conversion.
  3. It polls until the conversion ends.
  4. It downloads the result to out.pdf at once, because a result expires in minutes.
  5. It answers with the output path, its size and the conversion id.

A tool that makes several files, such as pdf-split, takes a directory as output.

What a result looks like#

A call that works returns isError: false, the result as JSON text in content, and the same result as an object in structuredContent:

JSON
{
  "tool": "pdf-crop",
  "conversion_id": "01JQ8Z5X0K7M3N9P2R4T6V8W0Y",
  "status": "finished",
  "outputs": [{ "path": "out.pdf", "name": "out.pdf", "mime": "application/pdf", "size_bytes": 1234 }],
  "bytes_in": 1500,
  "bytes_out": 1234,
  "expires_at": "2026-01-02T15:09:05Z"
}

outputs has one entry for each file written. note is what the conversion says about itself, when it has something to say. The fields bytes_in, bytes_out, note and expires_at are left out when empty.

A failed tool is not a protocol error. The call returns isError: true, and the model sees the error:

JSON
{"error":{"code":"missing_ability","message":"The API key may not run this tool: ..."}}

code is stable, so an agent can branch on it. message is a sentence to act on. retry is true when sending the same call again could work, and is left out otherwise. A failure after a conversion started adds conversion_id and, for a failed conversion, conversion_type, the conversion error code.

CodeMeaning
invalid_inputAn argument is missing, unknown or out of range, or a file is not readable or is empty. Checked before anything is uploaded.
missing_keyVUKEM_TOOLS_API_KEY is not set.
unauthorizedThe server refused the key.
missing_abilityThe key lacks the tool's ability.
file_too_largeThe file is past the server's upload limit.
not_foundThe server has no such resource.
upload_failedThe upload did not complete.
result_expiredThe result was deleted before it was downloaded.
rate_limitedA rate limit. The server waited and retried first.
conversion_failedThe conversion ended in error. See conversion_type.
conversion_cancelledThe conversion was cancelled.
timeoutThe conversion did not end in time. The default wait is 10 minutes.
server_errorThe server answered with an error, or something unexpected happened.
network_errorThe server could not be reached.
io_errorA file could not be read or written locally.
browser_onlyThe tool runs in the browser and has no call.
unknown_toolNo tool has that name.

What keeps an agent safe#

  • The server only calls the API with your key, so the key's abilities are the limit: a key with pdf:structure cannot run video-download. Give an agent a key of its own with the narrowest set.
  • The tool's schema is closed: an argument it does not name is refused with invalid_input, and so is a missing, empty or unreadable file, before anything is uploaded.
  • A call can be cancelled with notifications/cancelled, and idempotency_key makes a retry return the same conversion instead of starting a second one.
  • The result is downloaded to a temporary file next to output and then renamed, so a failed download leaves no partial file.
  • The key is never printed, logged or written to disk, and an error never carries it.
  • The local HTTP form refuses anything that is not loopback and anything with an Origin header, so a web page cannot use it. See Connect a client.

The agent chooses the paths, and the process can read and write anything your user can. Only connect it to an agent you trust with those files, prefer a client that asks you to approve each call, and name an output that is not one of the inputs unless you mean to replace it.

Common mistakes#

  • Assuming all 54 tools can be called. 17 are browser_only; the tool list says which.
  • Passing an option at the top level. A tool's own options go inside options; the top level takes only input or inputs, output, options and idempotency_key.
  • Leaving out output. It is required, and a tool that yields several files wants a directory.
  • Giving the agent a key with more abilities than the job needs.
  • Waiting before downloading. The server does it for you at once, because a result expires in minutes.

Next steps#