| Path | Purpose |
|---|---|
src/index.ts |
Entry point: loads the .env, checks the variables, registers the 7 tools, starts the stdio transport, handles signals |
src/constants.ts |
fixed limits (timeout, truncation, sizes, pagination) |
src/schemas/index.ts |
Zod schemas for all tool inputs |
src/services/client.ts |
WikiJsClient: sends the GraphQL requests |
src/services/error-handler.ts |
uniform error and success responses |
src/tools/*.ts |
one file per tool |
tests/update-page.test.ts |
Vitest tests for the update behaviour |
The package is an ES module ("type": "module"); entry point and bin entry is dist/index.js.
tsc to dist/@modelcontextprotocol/sdk (McpServer, stdio transport).envfetch built into Node.js, no additional HTTP libraryAll requests are sent as POST with a JSON body and Authorization: Bearer <token> to WIKIJS_API_URL.
| Tool | Operation | Note |
|---|---|---|
wikijs_list_pages |
pages.list |
returns all pages, locale filter and pagination happen in the server |
wikijs_get_page |
pages.single(id) or pages.singleByPath(path, locale) |
without tags |
wikijs_search_pages |
pages.search(query) |
locale filter in the server |
wikijs_create_page |
pages.create |
with path, title, content, description, editor, isPublished, isPrivate, locale, tags |
wikijs_update_page |
pages.update |
with id, content, title, description, isPublished, tags |
wikijs_delete_page |
pages.delete(id) |
|
wikijs_move_page |
pages.move(id, destinationPath, destinationLocale) |
Path-based update, delete and move calls first resolve the path to an ID with pages.singleByPath.
The pages.update mutation needs a value for title, description, content and tags; that is why the server fills missing fields from the page's current state.
isError: true with {"success": false, "error": ..., "tool": ...}. The server does not crash on them.Wiki.js API request failed: HTTP error! status: <code>.Wiki.js API request failed: GraphQL request failed: <messages>.succeeded: false in responseResult, the message is Failed to create page: ..., Failed to update page: ..., Failed to delete page: ... or Failed to move page: ... followed by the text from Wiki.js.Request timed out. Please try again.On SIGINT, SIGTERM, unhandled errors and promise rejections the server closes the MCP connection and exits. An EPIPE (client closed the connection) is not logged.
npm install
npm run dev # tsx in watch mode
npm run build # compile to dist/
npm run typecheck # type check without output
npm test # Vitest
The CI builds and type-checks the project with Node.js 18, 20 and 22.