A Model Context Protocol (MCP) server for Sitecore with GraphQL API, version control, parent navigation, and item statistics. Query Sitecore items via AI assistants like Claude and GitHub Copilot.
Item Operations:
- π sitecore_get_item - Get a specific Sitecore item (with version support)
- πΆ sitecore_get_children - Get child items (with version support)
- π sitecore_get_field_value - Get a field value (with version support)
- οΏ½ sitecore_get_item_fields - Get all fields of an item (template-aware)
- οΏ½π sitecore_query - Execute Sitecore queries
- π sitecore_search - Search items with filters and ordering
- π sitecore_search_paginated - Search with pagination support
Template Operations:
- π sitecore_get_template - Get template information
- π sitecore_get_templates - Get multiple templates
Version Control:
- π sitecore_get_item_versions - See all versions of an item
- π sitecore_get_item_with_statistics - Get created/updated dates and users
Navigation:
- β¬οΈ sitecore_get_parent - Navigate to parent item
- π§ sitecore_get_ancestors - Get all ancestors (breadcrumb)
Layout & Sites:
- π¨ sitecore_get_layout - Get layout/presentation information
- π sitecore_get_sites - Get Sitecore site configurations
Mutations (Create/Update/Delete):
- β sitecore_create_item - Create new Sitecore items
- βοΈ sitecore_update_item - Update existing items
- β sitecore_delete_item - Delete items
Advanced Features:
- π¬ sitecore_scan_schema - Automatic GraphQL schema analysis
- π¬ sitecore_command - Natural language
/sitecorecommands in chat - π sitecore_discover_item_dependencies - Comprehensive item discovery with template, fields, and relationships
All MCP tools now report progress via stderr so you can see what's happening during longer operations in your AI client.
- Format:
[tool_name] Message... - Examples:
[sitecore_get_item] Starting (path=/sitecore/content/Home, language=nl-NL)[sitecore_get_item] Completed: Home (template=Page, version=1)[sitecore_search_paginated] Completed: 50 item(s), hasNextPage=true
Note: We always mention the language in messages (critical for Sitecore).
Via Slash Command Menu (Type / in chat):
# 1. Type / to open the menu
# 2. Choose "π§ /sitecore - Sitecore command interface"
# 3. Type your command (with or without /sitecore prefix)
help
get item /sitecore/content/Home
get item /sitecore/content/Home version 2 # NEW: Version support!
get parent /sitecore/content/Home/Article # NEW: Parent navigation!
get ancestors /sitecore/content/Home/Article # NEW: Breadcrumb!
search articles
field Title from /sitecore/content/Home
templatesDirect Natural Language Commands:
/sitecore help
/sitecore scan schema
/sitecore get item /sitecore/content/Home
/sitecore get item /sitecore/content/Home version 2
/sitecore get parent /sitecore/content/Home/Article
/sitecore get ancestors /sitecore/content/Home/Article
/sitecore search articles
/sitecore field Title from /sitecore/content/Home
/sitecore templatesVersion Control Examples:
// Get specific version
sitecore_get_item({
path: "/sitecore/content/Home",
language: "en",
version: 2
})
// Get all versions
sitecore_get_item_versions({
path: "/sitecore/content/Home",
language: "en"
})
// Returns: { totalVersions: 5, versions: [...], latestVersion: 5 }
// Get item with statistics
sitecore_get_item_with_statistics({
path: "/sitecore/content/Home",
language: "en"
})
// Returns: { created: "20211011T073530Z", createdBy: "sitecore\admin", ... }Navigation Examples:
// Get parent
sitecore_get_parent({
path: "/sitecore/content/Home/Article"
})
// Returns: { name: "Home", path: "/sitecore/content/Home", ... }
// Get all ancestors (breadcrumb)
sitecore_get_ancestors({
path: "/sitecore/content/Home/Article"
})
// Returns: {
// count: 3,
// ancestors: [...],
// breadcrumb: "sitecore > content > Home"
// }- docs/guides/ - Technical guides and implementation details (GUID formats, content discovery, slash commands, etc.)
- docs/releases/ - Release notes per version (RELEASE-NOTES-v1.x.md)
- docs/ready-to-ship/ - Release checklists and readiness documents per version
- docs/status/ - Progress reports and status updates
- docs/summaries/ - Version summaries and overviews
- docs/BACKLOG.md - Product backlog and planning
Tip: All documentation is organized under docs/. Root contains only README.md.
SitecoreMCP/
βββ .github/ # CI/CD workflows en GitHub configuratie
β βββ workflows/
β βββ root-scan.yml # Root hygiene enforcement
β
βββ src/ # TypeScript source code
β βββ index.ts # MCP server entry point (11 tools)
β βββ sitecore-service.ts # GraphQL client & business logic
β βββ sitecore-types.ts # TypeScript type definitions (auto-generated)
β βββ sitecore-types-FULL.ts # Extended type definitions
β
βββ dist/ # Compiled JavaScript (build output)
β
βββ scripts/ # All scripts organized by category
β βββ build/
β β βββ build-vsix.ps1 # VS Code extension packaging
β β
β βββ schema/ # GraphQL schema management
β β βββ download-schema.ps1 # Download schema from Sitecore
β β βββ download-full-schema.ps1
β β βββ analyze-schema.ps1 # Analyze schema structure
β β βββ extract-schema-types.ps1
β β βββ find-mutations.ps1 # Find mutation capabilities
β β βββ generate-types.ps1 # Generate TypeScript types
β β βββ generate-types-full.ps1
β β βββ check-search-schema.cjs # Validate search schema
β β
β βββ tests/ # Test scripts (72 files)
β β βββ Load-DotEnv.ps1 # Environment loader for tests
β β βββ test-*.ps1 # PowerShell test scripts
β β βββ test-*.cjs # Node.js test scripts
β β
β βββ tools/ # Utility tools
β β βββ build-relationship-graph.ps1 # Build item relationship graphs
β β βββ parse-field-references.ps1 # Parse field references
β β βββ Load-DotEnv.ps1 # Canonical environment loader
β β
β βββ wrappers/ # Backward compatibility wrappers
β βββ *.ps1 # PowerShell wrappers (deprecated)
β βββ *.cjs # Node.js wrappers (deprecated)
β
βββ docs/ # All documentation
β βββ guides/ # Technical guides (35+ documents)
β βββ releases/ # Release notes per version
β βββ ready-to-ship/ # Release readiness checklists
β βββ status/ # Status and progress reports
β βββ summaries/ # Version summaries
β βββ BACKLOG.md # Product backlog
β
βββ data/ # Schema and graph data (generated)
β βββ graphql-schema.json # GraphQL schema dump
β βββ graphql-schema-full.json # Full introspection result
β βββ graph.json # Relationship graph data
β
βββ .env.example # Environment variabelen template
βββ package.json # NPM dependencies en scripts
βββ tsconfig.json # TypeScript compiler configuratie
βββ LICENSE # MIT licentie
βββ README.md # Dit bestand (quick start)
| Directory | Purpose | Allowed Files |
|---|---|---|
| Root | Project metadata and entry point | Config files + README.md only |
| src/ | TypeScript source code | .ts files |
| dist/ | Build output | .js, .d.ts files (generated) |
| scripts/ | All scripts organized | Subdirectories per category |
| scripts/build/ | Build and packaging scripts | build-vsix.ps1 |
| scripts/schema/ | GraphQL schema management | Schema tools (9 scripts) |
| scripts/tests/ | Test scripts | Test files (72 files) |
| scripts/tools/ | Utility tools | Helpers and utilities (3 tools) |
| scripts/wrappers/ | Backward compatibility | Deprecated wrappers (11 files) |
| docs/ | All documentation | .md files in subdirectories |
| data/ | Generated data files | .json schema dumps (gitignored) |
| .github/ | CI/CD workflows | GitHub Actions workflows |
Hygiene Policy: Root contains ONLY config files and README.md. All documentation is under docs/, all scripts under scripts/. This structure is enforced by CI workflow (root-scan.yml).
GraphQL API is active and working!
- β Item queries
- β Get children
- β Get field values
- β Template information
- β Variables in queries
- Node.js 18 or higher
- Sitecore instance with GraphQL endpoint:
/sitecore/api/graph/items/master - Sitecore API Key (see configuration)
cd c:\gary\Sitecore\SitecoreMCP
npm install
npm run buildCopy .env.example to .env and configure your Sitecore instance:
SITECORE_HOST=https://your-sitecore-instance.com
SITECORE_API_KEY=your-api-key-hereVerify that all MCP tools are working correctly:
.\scripts\tests\run-tests.ps1This will run a comprehensive test suite covering:
- β Basic queries (item retrieval, children, fields)
- β Advanced search & discovery
- β Navigation & hierarchy (parent, ancestors)
- β Utilities & extensions
Expected output: 17/17 tests passed (100% success rate)
Choose your favorite tool and configure the Sitecore MCP server:
Claude Desktop: %APPDATA%\Claude\claude_desktop_config.json
VS Code: .vscode/settings.json or User Settings
Rider: %APPDATA%\JetBrains\Rider2024.3\options\mcp-servers.json
Visual Studio: %USERPROFILE%\.github-copilot\mcp-servers.json
See docs/guides/INSTALLATION.md for detailed configuration per tool.
Example configuration (Claude Desktop):
{
"mcpServers": {
"sitecore": {
"command": "node",
"args": ["c:\\gary\\Sitecore\\SitecoreMCP\\dist\\index.js"],
"env": {
"SITECORE_HOST": "https://your-sitecore-instance.com",
"SITECORE_API_KEY": "your-api-key-here"
}
}
}
}For VS Code, Rider and Visual Studio configurations, see docs/guides/INSTALLATION.md.
- Claude Desktop: Close completely and restart
- VS Code: Reload Window (Ctrl+Shift+P)
- Rider: Invalidate Caches & Restart
- Visual Studio: Close solution and reopen
The Sitecore MCP server should now be available!
Step 1: Open your AI chat (Claude Desktop, VS Code Copilot, etc.)
Step 2: Type / to open the slash command menu
Step 3: Choose π§ /sitecore from the menu
Step 4: Type your command (prefix is automatically added)
# Via slash menu:
/ β choose /sitecore β "help"
/ β choose /sitecore β "get item /sitecore/content/Home"
/ β choose /sitecore β "search articles"
/ β choose /sitecore β "field Title from /sitecore/content/Home"You can also type direct commands:
Get the Home item: /sitecore/content/Home
Show all children of /sitecore/content/Home
Execute this query: /sitecore/content/Home//*[@@templatename='Sample Item']
Search for items with "contact" in the name
What is the Title field of /sitecore/content/Home?
See docs/guides/EXAMPLES.md and docs/guides/SLASH-COMMAND.md for more extensive examples.
This MCP server uses the Sitecore PowerShell Extensions (SPE) API endpoint:
POST https://your-sitecore-instance.com/sitecore/api/spe/v2/script
Ensure SPE is correctly configured and the API is accessible.
For a complete overview of all directories and their purposes, see the π Repository Structure section above.
Main documents:
- README.md (this file): Overview and quick start
- docs/guides/INSTALLATION.md: Detailed installation for all IDEs
- docs/guides/EXAMPLES.md: Extensive usage examples and use cases
- docs/guides/SLASH-COMMAND.md: β‘ Slash command menu guide
- docs/guides/SITECORE-COMMAND-GUIDE.md: Natural language command reference
Documentation Structure:
docs/guides/β Technical guides and how-to's (35+ documents)docs/releases/β Release notes per version (RELEASE-NOTES-v1.x.md)docs/ready-to-ship/β Release readiness checklistsdocs/status/β Status and progress reportsdocs/summaries/β Version summaries
Note: All documentation is under docs/. The root contains only README.md. Scripts are under scripts/ in categories (build, schema, tests, tools, wrappers).
- Claude: Check
claude_desktop_config.jsonsyntax β Restart app - VS Code: Reload Window (Ctrl+Shift+P) β Check Output panel
- Rider: Invalidate Caches β Check Event Log
- Visual Studio: Restart as Administrator β Check Extension logs
- Run
.\test-spe-api.ps1to test the API - Verify that SPE remoting is enabled in
Spe.config - Check Sitecore logs:
https://your-sitecore-instance.com/sitecore/admin/showlog.aspx
- Verify that the path exists (case-sensitive!)
- Verify database (master/web/core)
- Check language code (en/nl/etc.)
For more details, see docs/guides/INSTALLATION.md.
Warning: This configuration is intended for LOCAL development!
For production environments:
- β Use HTTPS with valid certificate
- β No credentials in configuration files
- β Use Sitecore API keys
- β Restrict SPE permissions
- β Enable SSL certificate verification
Suggestions and improvements are welcome! Create an issue or submit a pull request.
MIT