This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run build - Compiles TypeScript to JavaScript and sets executable permissionsmake build - Alternative build command using Makefilenpm run codegen - Generates TypeScript types from WikiJS GraphQL schema (requires WIKIJS_URL in .env)make run - Builds and runs the MCP servermake clean - Removes build artifactsdocker-compose up -d - Starts a local WikiJS instance for testingdocker-compose down - Stops the local WikiJS instanceThis is a Model Context Protocol (MCP) server that bridges AI assistants with WikiJS instances. The architecture follows a three-layer pattern:
MCP Layer (src/mcp/)
WikiJSMcpServer class manages the MCP server lifecycle and tool registrationsrc/mcp/index.ts:27-54 with specific parameter schemassrc/mcp/tools/WikiJS Client Layer (src/wikijs/)
WikiJSClient class wraps GraphQL operationssrc/wikijs/generated/graphql.tssrc/wikijs/queries/pages.graphqlEntry Point (src/index.ts)
Each MCP tool follows a consistent pattern:
createTool function that returns a handlerPARAMETERS schema for validationThe project uses GraphQL Code Generator to create typed SDK from WikiJS API:
${WIKIJS_URL}/graphql.graphql files generate TypeScript typesRequired environment variables (set in .env):
WIKIJS_URL - Base URL of WikiJS instance (without /graphql)WIKIJS_API_KEY - Bearer token for WikiJS API authenticationThe project uses TypeScript with strict typing:
Read (always available):
search_pages - Full-text search across WikiJS pagesget_page_by_id - Retrieve specific page by numeric IDget_page_by_path - Retrieve page by path and localeget_all_pages - List pages with optional filters (limit/locale/tags)get_page_history - Revision history of a pageget_page_version - A specific version of a pageget_page_tree - Page tree of a sitelist_tags / search_tags - Tagsget_page_links - Page link graph for a localeWrite (only available when WIKIJS_ENABLE_EDIT=true):
create_page - Create a new WikiJS pageedit_page - Edit a WikiJS page by ID (full-document replace; metadata preserved when omitted)move_page, delete_page, restore_page_version, convert_page_editor