Skip to content

feat: add locale parameter to all page creation and search tools - #5

Open
RastaChaum wants to merge 15 commits into
talosdeus:mainfrom
RastaChaum:feature/add-locale-parameter
Open

feat: add locale parameter to all page creation and search tools#5
RastaChaum wants to merge 15 commits into
talosdeus:mainfrom
RastaChaum:feature/add-locale-parameter

Conversation

@RastaChaum

Copy link
Copy Markdown

Summary

This PR adds a locale parameter to all Wiki.js MCP tools that create or query pages, allowing proper multi-language support.

Motivation

Wiki.js is a multilingual platform, but all tools previously hardcoded locale: "en" (or in some cases locale: "fr"). This prevented users from using the MCP server with non-English wikis.

Changes

New locale parameter (default: "en")

  • wikijs_create_page — locale applied to page creation mutation
  • wikijs_create_space — locale propagated to underlying wikijs_create_page
  • wikijs_create_repo_structure — locale propagated to all created pages
  • wikijs_create_nested_page — locale propagated through the hierarchy
  • wikijs_create_documentation_hierarchy — locale propagated to repo structure and file overviews
  • wikijs_generate_file_overview — locale applied when creating new pages
  • wikijs_bulk_update_project_docs — locale propagated to file overview creation

Fixed hardcoded locales

  • wikijs_get_page (slug lookup): was hardcoded locale: "fr", now uses locale parameter (default "en")
  • wikijs_search_pages: was hardcoded locale: "fr", now uses locale parameter (default "en")

New tool: wikijs_move_page

Moves/renames a page by updating its path/slug, preserving all other page attributes.

Other fixes

  • wikijs_update_page: added optional path parameter to allow renaming a page's slug without a separate move step
  • HTTP client: force HTTP/1.1 and disable SSL verification (for Traefik reverse proxy and self-signed certificate environments)

Backward Compatibility

All new parameters use locale: str = "en" as default, preserving existing behavior for English wikis.

David Chaumont added 6 commits January 11, 2026 14:26
- Add locale parameter to wikijs_create_page function signature with default value 'en'
- Update function documentation to describe the locale parameter
- Use the locale parameter in GraphQL mutation instead of hardcoded 'en'
- Allows users to create pages in different languages (fr, de, es, etc.)

This enhancement enables multi-language support for page creation,
making it possible to create pages directly in the desired language
instead of always defaulting to English.
- Add locale parameter to wikijs_create_space
- Add locale parameter to wikijs_generate_file_overview
- Add locale parameter to wikijs_create_repo_structure
- Add locale parameter to wikijs_create_nested_page
- Update docstrings to document locale parameter
- Propagate locale to all wikijs_create_page calls

This completes the multi-language support across all page creation tools.
- wikijs_get_page: add locale param for singleByPath lookup (was hardcoded 'fr')
- wikijs_search_pages: add locale param for search query (was hardcoded 'fr')
- wikijs_create_documentation_hierarchy: add locale param, propagate to repo structure and file overviews
- wikijs_bulk_update_project_docs: add locale param, propagate to generate_file_overview
- Add CLAUDE.md and copilot-instructions.md for homelab wiki guidelines
Copilot AI review requested due to automatic review settings May 10, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Wiki.js MCP server to better support multilingual wikis by introducing a locale parameter (default "en") across page creation/query/search-related tools, and adds a new wikijs_move_page tool for renaming/moving pages via path updates.

Changes:

  • Added locale: str = "en" to multiple MCP tools and propagated it through higher-level tooling flows (repo structure, nested pages, file overviews, bulk updates).
  • Added wikijs_move_page and extended wikijs_update_page with an optional path parameter for slug/path changes.
  • Modified the HTTP client configuration to force HTTP/1.1 and disable SSL verification.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/wiki_mcp_server.py Adds locale parameters to tools, introduces page move functionality, adds path to updates, and changes HTTP client TLS/HTTP2 settings.
CLAUDE.md Adds repository guidance documentation (commands, architecture, and HomeLab Wiki usage rules).
.github/copilot-instructions.md Adds HomeLab documentation directives, including mandatory French locale usage guidance for operations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wiki_mcp_server.py
Comment on lines +102 to +104
# Force HTTP/1.1 to avoid Traefik HTTP/2 PROTOCOL_ERROR
# Disable SSL verification for self-signed certificates
self.client = httpx.AsyncClient(timeout=30.0, http2=False, verify=False)
Comment thread src/wiki_mcp_server.py

@mcp.tool()
async def wikijs_create_nested_page(title: str, content: str, parent_path: str, create_parent_if_missing: bool = True) -> str:
async def wikijs_create_nested_page(title: str, content: str, parent_path: str, create_parent_if_missing: bool = True, locale: str = "en") -> str:
Comment thread src/wiki_mcp_server.py Outdated
Comment on lines +548 to +552
"description": current_page.get("description", ""),
"editor": "markdown",
"isPrivate": current_page.get("isPrivate", False),
"isPublished": current_page.get("isPublished", True),
"locale": current_page.get("locale", "en"),
Comment thread src/wiki_mcp_server.py
Comment on lines 447 to 452
"isPrivate": current_page.get("isPrivate", False),
"isPublished": current_page.get("isPublished", True),
"locale": current_page.get("locale", "en"),
"path": current_page["path"],
"path": new_path,
"scriptCss": "",
"scriptJs": "",
Comment thread src/wiki_mcp_server.py
context: str,
auto_create_missing: bool = True
auto_create_missing: bool = True,
locale: str = "en"
Comment thread src/wiki_mcp_server.py
query($path: String!, $locale: String!) {
pages {
singleByPath(path: $path, locale: "en") {
singleByPath(path: $path, locale: $locale) {
David Chaumont added 9 commits May 10, 2026 18:22
- Add MCP_TRANSPORT, MCP_HOST, MCP_PORT settings to support SSE mode
- SSE transport enables network-wide access from any client on the LAN
- lxc/create-lxc.sh: Proxmox host script to create Debian 12 LXC container
- lxc/install.sh: in-container install script (systemd service, venv, git clone)
- lxc/wiki-js-mcp.service: hardened systemd unit (non-root, PrivateTmp, etc.)
- lxc/README.md: deployment guide
…late docs to English

- community-scripts/ct/wiki-js-mcp.sh: community-scripts format ct script with
  custom build_container override for pre-submission testing; sources build.func
  from official repo for interactive setup (INSTALL_SCRIPT_URL env var overridable)
- community-scripts/install/wiki-js-mcp-install.sh: standard install.func based
  container installer (Python venv, git clone, systemd service)
- community-scripts/README.md: deployment guide and ProxmoxVED submission steps
- lxc/create-lxc.sh: translated comments/messages to English
- lxc/install.sh: translated comments/messages to English
- lxc/README.md: full rewrite in English
…lise pages.move au lieu de pages.update

- create_nested_page: singleByPath utilisait locale: "en" hardcodé → ne trouvait jamais les pages fr → RetryError
- move_page: remplace pages.update (déclenche rebuild-tree avec duplicate key bug Wiki.js 2.x) par la mutation pages.move dédiée
@eloi-lfrg

Copy link
Copy Markdown

+1 ! Juste wrote the same feature, was ready to push it then saw your pull request ! Thank you ☕️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants