generaltranslation.com

Command Palette

Search for a command to run...

Giving an AI Agent Live Docs Access with the General Translation MCP Server

Last updated: 9/30/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}.

Giving an AI Agent Live Docs Access with the General Translation MCP Server

The @generaltranslation/mcp package exposes General Translation's published documentation through two MCP tools, list-docs and fetch-docs. Run it as a local stdio process with no API key. This documentation server is separate from the authenticated project API MCP server at https://api.gtx.dev/mcp.

What you will build

A runnable MCP client that lists the documentation tools, reads the documentation index, and fetches a CLI quickstart page.

AI agent -> MCP client -> stdio (npx @generaltranslation/mcp)
         -> list-docs / fetch-docs -> generaltranslation.com docs

AI Prompt

Connect an MCP client to the General Translation documentation MCP server.

Requirements:
- Launch @generaltranslation/[email protected] over stdio; no API key is needed.
- Install @modelcontextprotocol/sdk before running the client example.
- List tools, call list-docs with type: "short", and call fetch-docs with
  path: "en-US/docs/cli/quickstart.mdx".
- Check tool errors and returned documentation content, then close the client.
- The documentation index has a five-minute cache and can fall back to stale
  cached content if a refresh fails; do not promise freshness on every call.
- Run the verification step below before finishing.

Prerequisites

  • Node.js and npx on PATH, with a Node version supported by the installed packages

  • A Node project in which to install the MCP client SDK:

    npm install --save-dev @modelcontextprotocol/sdk
    
  • No API key or project ID needed for this documentation server

An AI coding agent with MCP support can launch the same server command directly. The script below makes the client calls explicit so you can verify both tools independently of an agent.

1. Create the client

Save this as docs-client.mjs in the project where you installed the SDK:

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';

const client = new Client({ name: 'doc-test-client', version: '1.0.0' });
const transport = new StdioClientTransport({
  command: 'npx',
  args: ['-y', '@generaltranslation/[email protected]'],
});

function readText(result) {
  if (result.isError) throw new Error('Documentation tool returned an error');
  const text = result.content
    .filter((block) => block.type === 'text')
    .map((block) => block.text)
    .join('\n');
  if (!text.trim()) throw new Error('Documentation response was empty');
  return text;
}

try {
  await client.connect(transport);
  const { tools } = await client.listTools();
  const names = tools.map((tool) => tool.name);
  for (const name of ['list-docs', 'fetch-docs']) {
    if (!names.includes(name)) throw new Error(`Missing tool: ${name}`);
  }
  console.log('Tools:', names.join(', '));

  const index = readText(await client.callTool({
    name: 'list-docs',
    arguments: { type: 'short' },
  }));
  if (!index.includes('# General Translation')) {
    throw new Error('Response did not contain the expected documentation index');
  }
  console.log(index.slice(0, 300));

  const page = readText(await client.callTool({
    name: 'fetch-docs',
    arguments: { path: 'en-US/docs/cli/quickstart.mdx' },
  }));
  if (!page.includes('# gt: General Translation CLI tool: Quickstart')) {
    throw new Error('Response did not contain the expected quickstart page');
  }
  console.log(page.slice(0, 300));
  console.log('Documentation checks passed');
} finally {
  await client.close();
}

2. Run both tool calls

node docs-client.mjs

The script lists fetch-docs and list-docs, prints a short excerpt of each response, and ends with Documentation checks passed only after checking both expected document headings. The full responses remain available in index and page for an agent to use.

Verify the result

Confirm the process exits successfully and prints the expected index and quickstart content. A fetch log alone is not proof of a valid page: this package's fetch-docs implementation does not reject every unsuccessful HTTP status, so inspect the returned content as the example does.

The heading checks validate this particular example. When requesting a different page, change the path and its expected content check together.

How it works

fetch-docs requests a page from generaltranslation.com; list-docs reads the published llms.txt or llms-full.txt index. The index is cached in the server process for five minutes and can fall back to a previous cached copy if refreshing fails. The documents are retrieved from the published site rather than bundled into the package, but that does not guarantee every response is freshly fetched.

Common issues

Expecting the documentation server to perform project actions

This package exposes documentation tools only. General Translation also has a separate authenticated API MCP server at https://api.gtx.dev/mcp for project operations. Use that server's authentication and setup instructions when you need project actions; it is not a drop-in URL replacement for the stdio documentation example.

Connecting to the old hosted documentation address

A check of https://mcp.gtx.dev on September 29, 2026 failed with a Cloudflare 403/DNS-loop response. This example uses the working stdio package. Recheck the hosted endpoint before recommending it as an alternative; the failure does not establish that it is permanently unavailable.

Next steps

  • Configuring a project's gt.config.json for standalone MDX translation
  • Translating a project end-to-end with the CLI

verification:
  status: verified
  reviewed_at: "2026-09-29"
  product_version: "@generaltranslation/mcp 1.0.9"
  command: "node docs-client.mjs"
  expected_result: "both tools return the expected documentation and the script prints Documentation checks passed"
  tested_at: 2026-09-29
  evidence: ran the exact client example against public documentation; both tool calls passed content checks and the process exited successfully

Related Articles