MCP Server API
Overview
Model Context Protocol server for AST-rendered DITA documentation, exposed over the
Streamable HTTP transport (--transport http). The stdio transport has no HTTP surface.
All MCP traffic is JSON-RPC 2.0 on a single endpoint, /mcp. A client opens a session with an
initialize request (no session header); the response carries an Mcp-Session-Id header that
must accompany every later request. Idle sessions are reaped after 30 minutes.
Tools
| Tool | Arguments | Purpose |
|---|---|---|
list_documentation_sets | none | List doc sets with titles, descriptions and topic counts |
get_toc | docId | Hierarchical table of contents for a doc set |
search_documentation | query, docId?, lang? | Ranked topic matches; delegates to the RAG service when RAG_SERVICE_URL is set, otherwise MiniSearch |
get_topic_content | docId, topicPath | Full topic as Markdown |
render_topic_ui | docId, topicPath, theme? | Interactive MCP-UI rendering of a topic |
Resources: docs://library (JSON catalog), docs://summary (plain-text summary) and
ui://dita-docs/topic-viewer.html (the viewer app shell).
Version information
Version: 1.0.0
URI scheme
Host: {scheme}://{host}:{port}
MCP Server - Transport
Streamable HTTP transport carrying MCP JSON-RPC traffic
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Header | Mcp-Session-Id |
string (uuid) |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Server-sent event stream for the session | string |
| 400 | Invalid or missing session ID | string |
Produces
text/event-streamtext/plain
Send initialize without a session header to start a session, then include Mcp-Session-Id
on every request (tools/list, tools/call, resources/read, ...). Depending on the
request, the reply is a single JSON body or a text/event-stream.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Header | Mcp-Session-Id |
Omit only on the initialize request |
string (uuid) |
| Body | body |
JsonRpcRequest |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | JSON-RPC response, as JSON or a server-sent event stream |
object |
| 400 | No valid session ID, and the request was not initialize |
JsonRpcError |
| 500 | Internal server error | JsonRpcError |
Produces
application/jsontext/event-stream
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Header | Mcp-Session-Id |
string (uuid) |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Session closed | No Content |
| 400 | Invalid or missing session ID | string |
Produces
text/plain
MCP Server - Viewer
HTML app shell for rendering topics in MCP-UI clients
HTML shell used by MCP-UI clients to render render_topic_ui output, also embeddable in an iframe.
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Viewer HTML | string |
Produces
text/html
Definitions
| Name | Description | Schema |
|---|---|---|
jsonrpc |
string | |
id |
Omitted for notifications | object |
method |
|
string |
params |
object |
| Name | Description | Schema |
|---|---|---|
jsonrpc |
|
string |
error |
object | |
id |
integer |