MCP Server
Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden →
Wat is de Oh My Posh MCP Server?
De Oh My Posh MCP (Model Context Protocol) Server is een validatieservice waarmee je je oh-my-posh thema-configuraties kunt valideren tegen het officiële JSON-schema. Het ondersteunt JSON, YAML en TOML-formaten en geeft gedetailleerde foutrapportages om geldige configuraties te maken.
Functionaliteiten
-
Multi-formaat ondersteuning: Valideert JSON-, YAML- en TOML-configuraties
-
Gedetailleerde foutrapportage: Ontvang precieze validatiefouten met JSON-paden
-
Automatische formaatherkenning: Detecteert automatisch het formaat van je configuratie
-
Waarschuwingen & aanbevelingen: Ontvang best practice suggesties en depreciatiewaarschuwingen
-
Op standaarden gebaseerd: Gebruikt het officiële oh-my-posh JSON-schema
-
Externe toegang: Geen installatie nodig - toegang via HTTPS
Gebruik
Met MCP-clients
Configureer je MCP-compatibele client (zoals Claude Desktop, Cline of andere AI-assistenten) om de validator te gebruiken:
{
"mcpServers": {
"oh-my-posh-validator": {
"url": "https://ohmyposh.dev/api/mcp",
"transport": "http"
}
}
}
Vraag vervolgens je AI-assistent om je oh-my-posh-configuratie te valideren.
Directe HTTP API
Je kunt de validator ook rechtstreeks via HTTP-verzoeken gebruiken.
Serverinformatie ophalen
curl https://ohmyposh.dev/api/mcp
Beschikbare tools opvragen
curl -X POST https://ohmyposh.dev/api/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 1
}'
Configuratie valideren
curl -X POST https://ohmyposh.dev/api/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "validate_config",
"arguments": {
"content": "{\"$schema\":\"https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json\",\"version\":4,\"blocks\":[]}",
"format": "json"
}
},
"id": 1
}'
Toolparameters
validate_config
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | The configuration content as a string (JSON, YAML, or TOML) |
| format | string | No | The format: json, yaml, toml, or auto (default: auto) |
Retourneert:
{
"valid": true,
"errors": [],
"warnings": [
{
"path": "$schema",
"message": "Consider adding \"$schema\" property for better editor support.",
"type": "recommendation"
}
],
"detectedFormat": "json",
"parsedConfig": { ... }
}
Responsvelden
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the configuration is valid |
| errors | array | List of validation errors (empty if valid) |
| warnings | array | List of warnings and recommendations |
| detectedFormat | string | The detected or specified format |
| parsedConfig | object | The parsed configuration object |
Foutformaat
Elke fout in de errors-array bevat:
| Field | Type | Description |
|---|---|---|
| path | string | JSON path to the problematic property |
| message | string | Human-readable error message |
| keyword | string | The validation keyword that failed |
| params | object | Additional parameters about the error |
| data | any | The actual data that failed validation |
Voorbeelden
Geldige configuratie
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 4,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "path",
"style": "powerline",
"background": "blue",
"foreground": "white"
}
]
}
]
}
Voorbeeld ongeldige configuratie
{
"blocks": [
{
"type": "invalid-type"
}
]
}
Validatieresultaat:
{
"valid": false,
"errors": [
{
"path": "/blocks/0/type",
"message": "Value must be one of: prompt, rprompt, line",
"keyword": "enum"
}
]
}
Integratievoorbeelden
Claude Desktop
Voeg toe aan je Claude Desktop-configuratie (~/Library/Application Support/Claude/config.json op macOS):
{
"mcpServers": {
"oh-my-posh-validator": {
"url": "https://ohmyposh.dev/api/mcp",
"transport": "http"
}
}
}
Vraag vervolgens aan Claude: "Kun je deze oh-my-posh-configuratie voor mij valideren?" en plak je configuratie.
Cline (VS Code-extensie)
Configureer Cline om de MCP-server te gebruiken, en het zal configuraties automatisch valideren wanneer je werkt aan oh-my-posh-thema's.
Ondersteunde formaten
JSON
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 4,
"blocks": []
}
YAML
$schema: https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version: 4
blocks: []
TOML
version = 4
blocks = []
Privacy & Beveiliging
-
Je configuratie-inhoud wordt niet opgeslagen of gelogd
-
Alle validatie gebeurt in het geheugen en wordt na verwerking verwijderd
-
De server leest alleen het officiële schema uit de repository
-
Geen authenticatie vereist - volledig anoniem
Broncode
De MCP-server is open source en onderdeel van de oh-my-posh-repository:
Problemen oplossen
Formaat niet correct herkend
Als automatische detectie faalt, specificeer dan expliciet het formaat:
{
"arguments": {
"content": "...",
"format": "yaml"
}
}
Parseerfouten
Bij parseerfouten controleer je eerst of je configuratie een geldige JSON/YAML/TOML-syntax heeft voordat je het schema valideert.
Schemafouten
De validator gebruikt het nieuwste schema van de main branch. Als je een oudere oh-my-posh versie gebruikt, kunnen sommige nieuwere eigenschappen mogelijk niet herkend worden.
Bijdragen
Heb je een bug gevonden of een suggestie? Open dan alstublieft een issue op GitHub.