{
  "mcpSpec": "0.3.2",
  "mcpVersion": "2025-11-25",
  "server": {
    "name": "libretranslate-mcp",
    "version": "1.0.1"
  },
  "capabilities": {
    "tools": {
      "listChanged": true
    }
  },
  "transport": {
    "type": "stdio",
    "command": "npx",
    "args": [
      "--yes",
      "@libretranslate/mcp@1.0.2"
    ],
    "env": {
      "LIBRETRANSLATE_API_URL": "https://libretranslate.com",
      "LIBRETRANSLATE_API_KEY": "your-api-key"
    }
  },
  "tools": [
    {
      "name": "detect",
      "description": "Detect the language of a given text\n\nSends `text` as `q` to `POST /detect` on your configured instance.\n\nReturns the first detection from the API: `language` is its language code and `confidence` is a score from 0 to 100. The tool returns one detection, even when the HTTP API supplies several. The JSON is encoded in `content[0].text`.\n\n**Errors.** Failed requests set `isError: true` and return an `error` message in the JSON text block.\n\n<details>\n<summary>Response examples</summary>\n\nDecoded success result:\n\n```json\n{\n  \"language\": \"en\",\n  \"confidence\": 100\n}\n```\n\nDecoded failure result (`isError: true`):\n\n```json\n{\n  \"error\": \"No detection result returned\"\n}\n```\n\n</details>",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Text to identify."
          }
        },
        "required": [
          "text"
        ],
        "examples": [
          {
            "text": "Hello"
          }
        ]
      },
      "execution": {
        "taskSupport": "forbidden"
      }
    },
    {
      "name": "translate",
      "description": "Translate text from one language to another\n\nSends `text` as `q`, together with `source` and `target`, to `POST /translate` on your configured instance.\n\nReturns `translatedText` and requests up to three `alternatives`. With `source: \"auto\"`, the API can also return `detectedLanguage`. Available alternatives depend on your instance’s models. The JSON is encoded in `content[0].text`.\n\n**Errors.** Failed requests set `isError: true` and return an `error` message in the JSON text block. The managed service requires `LIBRETRANSLATE_API_KEY`; self-hosted instances use their own access settings.\n\n<details>\n<summary>Response examples</summary>\n\nDecoded success result:\n\n```json\n{\n  \"translatedText\": \"Hola\",\n  \"alternatives\": [\n    \"Hola.\"\n  ]\n}\n```\n\nDecoded failure result (`isError: true`):\n\n```json\n{\n  \"error\": \"Unsupported target language\"\n}\n```\n\n</details>",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Text to translate."
          },
          "source": {
            "type": "string",
            "description": "Source language code, or auto for automatic detection."
          },
          "target": {
            "type": "string",
            "description": "Target language code, such as es for Spanish."
          }
        },
        "required": [
          "text",
          "source",
          "target"
        ],
        "examples": [
          {
            "text": "Hello",
            "source": "en",
            "target": "es"
          }
        ]
      },
      "execution": {
        "taskSupport": "forbidden"
      }
    },
    {
      "name": "languages",
      "description": "List all supported languages for translation\n\nCalls `GET /languages` on your configured instance. No arguments are needed.\n\nReturns an array of languages. Each entry has a `code` and an English `name`; the API can also supply `targets`, the language codes that entry can translate into. Use this list when choosing `source` and `target` for a translation. The JSON is encoded in `content[0].text`.\n\n**Errors.** Failed requests set `isError: true` and return an `error` message in the JSON text block.\n\n<details>\n<summary>Response examples</summary>\n\nDecoded success result:\n\n```json\n[\n  {\n    \"code\": \"en\",\n    \"name\": \"English\",\n    \"targets\": [\n      \"es\"\n    ]\n  },\n  {\n    \"code\": \"es\",\n    \"name\": \"Spanish\",\n    \"targets\": [\n      \"en\"\n    ]\n  }\n]\n```\n\nDecoded failure result (`isError: true`):\n\n```json\n{\n  \"error\": \"Languages request failed: 503 Service Unavailable\"\n}\n```\n\n</details>",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {},
        "examples": [
          {}
        ]
      },
      "execution": {
        "taskSupport": "forbidden"
      }
    }
  ],
  "description": "Translate text, detect its language, and list supported languages from an MCP client. The server runs locally over stdio and forwards requests to the LibreTranslate instance you configure.\n\n[Set up your client](/guides/mcp_server/) for the hosted service or your own instance. The [HTTP API](/api/) also supports file translation and other operations beyond these three tools."
}