Wikijs Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Wikijs Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Serveur MCP (Model Context Protocol) qui expose l'API GraphQL de WikiJS pour rechercher et lire des pages de documentation.
Le serveur MCP utilise FastMCP v3 pour interagir avec WikiJS via son API GraphQL. Il expose 4 outils simples pour rechercher et lire des pages.
pip install -r requirements.txtcp env.example .envÉditez .env et configurez :
WIKIJS_URL : URL de base de WikiJS (ex: https://wiki.example.com)WIKIJS_GRAPHQL_ENDPOINT : Endpoint GraphQL (optionnel, défaut: {WIKIJS_URL}/graphql)WIKIJS_API_KEY : Clé API WikiJS avec droits de lectureMCP_TRANSPORT : Transport MCP (stdio, http, sse, streamable-http ; défaut : http). Mettez sse pour le transport Server-Sent Events.MCP_HOST : Adresse d'écoute pour le mode réseau (défaut: 0.0.0.0)MCP_PORT : Port pour le mode réseau (défaut: 8000)FASTMCP_SHOW_SERVER_BANNER : Afficher la bannière au démarrage (optionnel, voir FastMCP).env : WIKIJS_API_KEY=votre_cle_api_iciPar défaut, l'endpoint GraphQL est {WIKIJS_URL}/graphql. Si votre instance WikiJS utilise un endpoint différent, vous pouvez le spécifier :
WIKIJS_GRAPHQL_ENDPOINT=https://wiki.example.com/graphqlLe serveur utilise deux niveaux d'authentification distincts :
Le serveur MCP s'authentifie auprès de WikiJS en utilisant une clé API.
Configuration :
WIKIJS_API_KEY dans votre fichier .envAuthorization: Bearer {WIKIJS_API_KEY}Exemple de configuration :
WIKIJS_URL=https://wiki.example.com
WIKIJS_API_KEY=votre_cle_api_iciLe serveur MCP peut être protégé par OAuth 2.0 avec Keycloak pour authentifier les clients MCP. Cette authentification est indépendante de l'authentification avec WikiJS.
Le serveur utilise OAuthProxy de FastMCP qui gère automatiquement :
.well-known/oauth-authorization-server, etc.)Configuration Keycloak requise :
Avant d'utiliser le serveur MCP, vous devez configurer un client dans Keycloak :
wikijs-mcp-client)openid-connectconfidential (recommandé) ou public{MCP_BASE_URL}/auth/callback (ex: http://localhost:8000/auth/callback)openid profile email)Note (FastMCP v3) : Le stockage OAuth par défaut utilise désormais FileTreeStore. Lors d'une mise à jour depuis FastMCP v2, les clients MCP devront se ré-enregistrer une fois à la première connexion (comportement automatique).
Activation :
.env : KEYCLOAK_URL=https://keycloak.example.com
KEYCLOAK_REALM=wikijs-mcp
KEYCLOAK_CLIENT_ID=wikijs-mcp-client
KEYCLOAK_CLIENT_SECRET=your-client-secret-here
KEYCLOAK_SCOPES=openid profile email
MCP_BASE_URL=http://localhost:8000KEYCLOAK_REALM n'est pas défini, l'authentification est désactivée et le serveur est accessible à tous (mode développement uniquement).Mode avancé (URLs séparées) :
Pour un déploiement avec des URLs différentes pour PUBLIC et INTERNAL (ex: Docker) :
KEYCLOAK_PUBLIC_URL=https://keycloak.example.com
KEYCLOAK_INTERNAL_URL=http://keycloak:8080
KEYCLOAK_REALM=wikijs-mcp
KEYCLOAK_CLIENT_ID=wikijs-mcp-client
KEYCLOAK_CLIENT_SECRET=your-client-secret-here
MCP_BASE_URL=http://localhost:8000Résumé des deux authentifications :
| Type | Variable d'environnement | Usage | Obligatoire |
|---|---|---|---|
| WikiJS | WIKIJS_API_KEY | Authentification du serveur MCP auprès de WikiJS | ✅ Oui |
| Serveur MCP | KEYCLOAK_URL<br>KEYCLOAK_REALM<br>KEYCLOAK_CLIENT_ID | Protection du serveur MCP via OAuth Keycloak | ⚠️ Optionnel (recommandé en production) |
#### Méthode 1 : Exécution directe
Mode réseau HTTP/SSE (accessible depuis le réseau) :
python run_server.py
# Le serveur sera accessible sur http://0.0.0.0:8000 par défaut
# Configurez MCP_HOST et MCP_PORT dans .env pour personnaliser#### Méthode 2 : Avec Docker
Construire et lancer avec Docker :
# Construire l'image
docker build -t wikijs-mcp .
# Lancer le conteneur
docker run -p 8000:8000 --env-file .env wikijs-mcpOu avec Docker Compose (si vous avez un fichier docker-compose.yml) :
docker-compose upLe serveur MCP utilise la bibliothèque FastMCP v3. Le transport est configurable via MCP_TRANSPORT (stdio, http, sse, streamable-http).
#### Avec Python directement (mode stdio)
Pour utiliser le serveur en mode stdio, définissez MCP_TRANSPORT=stdio dans l'environnement (voir exemples ci-dessous).
Configuration de base (sans authentification du serveur MCP) :
{
"mcpServers": {
"wikijs": {
"command": "python",
"args": ["run_server.py"],
"cwd": "/chemin/vers/WikiJSMCP",
"env": {
"WIKIJS_URL": "https://wiki.example.com",
"WIKIJS_API_KEY": "votre_cle_api",
"MCP_TRANSPORT": "stdio"
}
}
}
}Configuration avec authentification du serveur MCP (recommandé en production) :
{
"mcpServers": {
"wikijs": {
"command": "python",
"args": ["run_server.py"],
"cwd": "/chemin/vers/WikiJSMCP",
"env": {
"WIKIJS_URL": "https://wiki.example.com",
"WIKIJS_API_KEY": "votre_cle_api",
"MCP_TRANSPORT": "stdio",
"KEYCLOAK_URL": "https://keycloak.example.com",
"KEYCLOAK_REALM": "wikijs-mcp",
"KEYCLOAK_CLIENT_ID": "wikijs-mcp-client",
"KEYCLOAK_CLIENT_SECRET": "your-client-secret",
"MCP_BASE_URL": "http://localhost:8000"
}
}
}
}WikiJSMCP/
├── src/
│ ├── __init__.py
│ ├── server.py # Serveur MCP principal
│ ├── graphql_client.py # Client GraphQL pour WikiJS
│ ├── config.py # Configuration
│ └── auth.py # Authentification OAuth Keycloak
├── requirements.txt # Dépendances Python
├── Dockerfile # Image Docker
├── env.example # Exemple de configuration
├── run_server.py # Script d'entrée
└── README.md # Cette documentation#### search_wiki Recherche des pages dans WikiJS.
Paramètres:
query (string, requis): Terme de recherchelimit (int, optionnel, défaut: 10): Nombre maximum de résultatsExemple:
search_wiki(query="documentation", limit=5)Retourne:
{
"results": [
{
"id": 1,
"title": "Documentation",
"description": "Guide d'utilisation",
"path": "/documentation"
}
]
}#### read_page Récupère le contenu d'une page par son ID.
Paramètres:
page_id (int, requis): ID de la pageExemple:
read_page(page_id=1)Retourne:
{
"id": 1,
"title": "Documentation",
"description": "Guide d'utilisation",
"path": "/documentation",
"content": "# Documentation\n\nContenu Markdown...",
"render": "<h1>Documentation</h1><p>Contenu HTML...</p>"
}#### list_pages Liste les pages disponibles avec pagination.
Paramètres:
limit (int, optionnel, défaut: 20): Nombre maximum de résultatsoffset (int, optionnel, défaut: 0): Décalage pour la paginationExemple:
list_pages(limit=50, offset=0)Retourne:
[
{
"id": 1,
"title": "Page 1",
"description": "Description",
"path": "/page1"
},
{
"id": 2,
"title": "Page 2",
"description": "Description",
"path": "/page2"
}
]#### get_page_by_path Récupère une page par son chemin.
Paramètres:
path (string, requis): Chemin de la page (ex: /home, /documentation/intro)Exemple:
get_page_by_path(path="/home")Retourne:
{
"id": 1,
"title": "Accueil",
"description": "Page d'accueil",
"path": "/home",
"content": "# Accueil\n\nBienvenue...",
"render": "<h1>Accueil</h1><p>Bienvenue...</p>"
}wikijs://pages - Description des pages WikiJS disponibleswiki-help - Documentation générale de l'API WikiJS et exemples d'utilisation# Via un client MCP
result = await mcp_client.call_tool(
"search_wiki",
{
"query": "documentation",
"limit": 5
}
)result = await mcp_client.call_tool(
"read_page",
{
"page_id": 1
}
)result = await mcp_client.call_tool(
"get_page_by_path",
{
"path": "/documentation/intro"
}
)result = await mcp_client.call_tool(
"list_pages",
{
"limit": 20,
"offset": 0
}
)search_wiki ou list_pages pour trouver des pagesread_page ou get_page_by_path pour récupérer le contenu completcontentrenderLe client GraphQL utilise les requêtes suivantes :
Consultez src/graphql_client.py pour voir les requêtes GraphQL complètes.
docker build -t wikijs-mcp ..env avec vos credentialsdocker-compose upCause : La variable WIKIJS_API_KEY n'est pas définie.
Solution : Définissez WIKIJS_API_KEY dans votre fichier .env avec une clé API valide générée dans WikiJS.
Causes possibles :
Solutions :
WIKIJS_GRAPHQL_ENDPOINT pointe vers le bon endpointCause : Le serveur MCP n'a pas été correctement initialisé.
Solution : Vérifiez les logs du serveur et assurez-vous que toutes les variables d'environnement requises sont définies.
Consultez la section "Authentification du serveur MCP avec OAuth Keycloak" pour la configuration détaillée.
Ce projet est fourni tel quel pour l'utilisation avec WikiJS.
Pour toute question ou problème :
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.