Setup in Claude Code
Een Axe MCP-server kan worden toegevoegd op projectniveau of gebruikersniveau.
Kies bereik
- Projectniveau: Maak een bestand aan bij
.mcp.jsonin de hoofdmap van je project (het beste om instellingen te delen met een team) - Gebruikersniveau: Maak of bewerk het configuratiebestand bij:
- macOS/Linux:
~/.config/claude-code/mcp.json - Windows:
%APPDATA%\claude-code\mcp.json
- macOS/Linux:
Configuratie JSON toevoegen
Voeg de volgende configuratie JSON toe.
Als je al andere servers gedefinieerd hebt, voeg dan het axe-mcp-server blok toe binnen het bestaande mcpServers object.
{
"mcpServers": {
"axe-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"--add-host=host.docker.internal:host-gateway",
"-i",
"--rm",
"-e", "AXE_SERVER_URL",
"-e", "AXE_API_KEY",
"dequesystems/axe-mcp-server:latest"
],
"env": {
"AXE_SERVER_URL": "https://axe.deque.com",
"AXE_API_KEY": "${AXE_API_KEY}"
}
}
}
}De configuratie gebruikt "AXE_API_KEY": "${AXE_API_KEY}" voor veilige invoerbehandeling. De ${AXE_API_KEY} syntaxis instrueert Claude Code om de waarde uit je shell-omgeving te halen. Voor meer informatie, zie de Claude Code MCP-documentatie.
Gebruik je een regionale, privé-cloud of lokale axe-instantie? Werk de AXE_SERVER_URL waarde bij in het env blok met de basis-URL van je instantie:
"env": {
"AXE_API_KEY": "${AXE_API_KEY}",
"AXE_SERVER_URL": "https://your-axe-instance.example.com"
}Indien weggelaten, valt de server terug op https://axe.deque.com (Deques gedeelde US SaaS-instantie). Zie Configuratie-opties voor details.
Stel je API-sleutel in
Stel je API-sleutel in als een omgevingsvariabele in je shell:
export AXE_API_KEY="your-api-key-here"Voor permanente instelling, voeg deze regel toe aan je shell-profiel (~/.bashrc, ~/.zshrc, enz.).
Gebruik en verificatie
Herstart Claude Code nadat je de MCP-server hebt geconfigureerd.
- Start Claude Code vanuit je terminal:
claude - Typ
/mcpom MCP-serverconnecties te beheren - Je zou
axe-mcp-servermoeten zien vermeld met deanalyzeenremediatetools beschikbaar
Configuratie van Claude Code (aanbevolen)
Om ervoor te zorgen dat Claude Code de axe MCP Server-tools correct gebruikt, voeg de volgende instructies toe aan een CLAUDE.md bestand in de hoofdmap van je project. Dit vertelt Claude om de juiste 'analyze-then-remediate'-workflow te volgen.
# Accessibility Testing and Remediation Workflow
## MANDATORY WORKFLOW - DO NOT DEVIATE
When working with accessibility issues, you MUST follow this exact workflow:
### 1. Analysis Phase
When asked to analyze pages for accessibility issues, you MUST:
- Use the `analyze` tool to scan the page
- Do NOT manually identify accessibility issues
- Always provide the complete URL being analyzed
### 2. Remediation Phase
When asked to remediate or fix accessibility issues, you MUST:
- First use `remediate` tool for EACH violation found
- Provide the exact HTML element, rule ID, and issue description
- Review the remediation guidance before making any code changes
- Apply fixes based on the remediate tool's recommendations
- Do NOT manually fix accessibility issues without first using the remediate tool
### 3. Verification Phase
After applying fixes, you MUST:
- Re-run `analyze` to verify all issues are resolved
- Confirm zero violations before considering the task completeVoor meer details over agentinstructies, zie Configuratie van jouw AI-agent.
