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:
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 all pages with optional filterscreate_page - Create a new WikiJS page (only available when WIKIJS_ENABLE_EDIT=true)edit_page - Edit a WikiJS page by ID (only available when WIKIJS_ENABLE_EDIT=true)