MCP Shipyard
← Guides

Build a remote MCP server for documentation lookup: tools, auth and review-ready metadata

Design a remote MCP server for documentation lookup: search and read tools, auth, a TypeScript example and tool-selection tips from the leaderboard.

docs-lookuptoolsauthsubmissionleaderboardtypescript

Build a remote MCP server for documentation lookup

Short answer: a docs server needs a search tool that returns identifiers and a read tool that takes one, no authentication for public docs, and descriptions that name the corpus and versions covered, because the model should pick you only for questions you can answer.

Basis: the MCP specification, the official TypeScript SDK docs (v2, package @modelcontextprotocol/server, read 2026-12-04) and our scanner rule pages. Tool sets are our recommendation, not a requirement. Anything marked (unverified) is not confirmed in those sources.

Use the two-step shape (search, then read) only because it keeps responses short and cited.

search_docs

  • Title: Search Acme docs
  • Description: see the example below.
  • Input: query string, required; version enum 3, 4 (default 4); limit integer 1 to 8
  • Annotations: readOnlyHint true, destructiveHint false, openWorldHint false

get_doc_page

  • Title: Read a docs page
  • Description: "Use this to read one documentation page by the id returned from search_docs. Returns the page as markdown with its version and last-updated date, truncated to 20,000 characters."
  • Input: page_id string, required; section string, optional heading
  • Annotations: readOnlyHint true, destructiveHint false, openWorldHint false

list_doc_versions

  • Title: List documented versions
  • Description: "Use this to list the product versions the docs cover and the date each was indexed."
  • Input: none
  • Annotations: readOnlyHint true, destructiveHint false, openWorldHint false

Annotations are hints, not security (see annotations explained). Here openWorldHint is true only where a tool reaches arbitrary outside parties, and false for a fixed domain. Both lookups read your own index, a closed domain, so openWorldHint is false. A tool with no parameters still needs an object schema (schema.missing).

Auth

Recommendation: no authentication. This is public read-only data, which the checks accept. Hold any upstream key on your server so no user ever types one (schema.secret-param). Add no write tools to a no-auth server, because auth.write-tools-unauthenticated warns when it lists create, update or delete tools. Without sign-in your protection is rate limiting and bounded results; see rate limits and 429s.

Transport

Serve Streamable HTTP on one HTTPS path such as https://mcp.example.com/mcp (auth.https). In the v2 SDK, createMcpHandler(factory) builds a fresh McpServer for every request, so the endpoint is stateless and needs no sticky sessions (sessions and serverless). The handler checks no Host, Origin or token itself, so put those checks in front of it. Still on SSE? See the migration guide. Keep the handshake fast (latency.handshake).

Minimal TypeScript example

This targets SDK v2; coming from v1, use the SDK's migration guide. In v2 inputSchema is a z.object(...). Replace lookup with your own code.

import { createMcpHandler, McpServer } from '@modelcontextprotocol/server';
import * as z from 'zod/v4';

const handler = createMcpHandler(() => {
  const server = new McpServer({ name: 'acme-docs', version: '1.0.0' });
  server.registerTool(
    'search_docs',
    {
      title: "Search Acme docs",
      description:
        "Use this to search the Acme SDK documentation (versions 3 and 4) for a concept, error or API name. Returns up to 8 passages with page id, heading, version and a short excerpt. Does not cover other products; use get_doc_page to read a full page.",
      inputSchema: z.object({
        query: z.string().describe('Concept, error message or API name'),
        version: z.enum(['3', '4']).default('4'),
        limit: z.number().int().min(1).max(8).default(5)
      }),
      annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false }
    },
    async (args) => {
      const result = await lookup(args); // your upstream call
      if (!result) return { isError: true, content: [{ type: 'text', text: 'No passage matched. Try the exact API or error name.' }] };
      return { content: [{ type: 'text', text: JSON.stringify(result) }] };
    }
  );
  return server;
});

export default handler; // web-standard runtimes; wrap with toNodeHandler on Node

Name the product in the description and keep results to cited passages.

Errors, size and speed

Return isError: true with text that says what was wrong and how to fix it; messages such as "Internal Server Error" fail review (errors.unhelpful-message). Reviewers run every tool with valid input and reject failures (errors.fixture-failed). Keep a call under 3 seconds where you can: the scanner warns above 3 and fails above 15 (latency.tool-call). For slower work see tool timeouts, cap result size (response size limits) and never echo keys or tokens in output (errors.secrets-in-output). Run the same calls in CI so a regression never reaches review.

Getting models to pick your tools

The leaderboard method shows the model every tool in the category as a function named <server>__<tool>, with your description and input schema, and records the first tool it calls. Your name, description and schema are the whole pitch. In the December 4 2026 run, 76.9% (83 of 108) of documentation lookup trials ended with no tool called. The method's docs set names mainstream libraries, so a server that indexes one product rarely wins general questions, and that is correct behaviour. State the product and versions in the first sentence, say what a result contains, and say what the tool does not cover. High no-tool shares mean the presented servers rarely fit what users ask, so treat your share as a coverage signal. Limits apply: the harness is offline, uses one model family, and measures selection, not correct answers. Rewrite method and prompt sets are in writing tool descriptions models pick; write about your own task and sibling tools, never about other servers (desc.injection-directive).

Pitfalls our rules catch

Submission checklist

Check your server against these rules at https://mcpshipyard.com/scan.

Check your server against these rules

Scan runs the checks from this guide against a live URL and lists each failing rule with its fix.

Scan a server