🤖Mechanic MCP Server
Connect your AI assistant to Mechanic's task library and documentation. The Mechanic Model Context Protocol (MCP) server enables your AI assistant to search tasks, explore documentation, and fetch task code.
How it works
Your AI assistant uses the MCP server to read and interact with Mechanic's resources:
Ask your AI assistant to help with Mechanic task development or automation questions.
The assistant searches Mechanic's task library and documentation based on your prompt.
The MCP server provides access to 350+ pre-built tasks and comprehensive Mechanic documentation, so your assistant can provide accurate code, solutions, and guidance based on current best practices.
Requirements
Before you set up the Mechanic MCP server, make sure you have:
Node.js 18 or higher installed on your system.
An AI development tool that supports MCP, such as Claude Desktop, Claude Code, Cursor, Codex CLI, or Gemini CLI.
What you can ask your AI assistant
After you set up the MCP server, you can ask your AI assistant questions like:
"Find tasks that auto-tag orders"
"How do I subscribe to Shopify product creation events?"
"Show me the code for the 'Auto-tag customers by order tier' task"
"What tasks use the bulk operations API?"
"How do I use the cache action in Mechanic?"
"Find similar tasks to 'email customer when order is fulfilled'"
"Write a task that sends an email when inventory gets low"
Your AI assistant will use the MCP server to search Mechanic's task library and documentation when providing responses.
Available resources
The MCP server provides access to:
350+ pre-built automation tasks from tasks.mechanic.dev
Complete Mechanic documentation from learn.mechanic.dev
Task subscriptions, options, and full Liquid scripts
Documentation on Liquid templating, actions, events, and integrations
Set up the server
The server runs locally in your development environment and doesn't require authentication.
Step 1: Configure your AI development tool
Add configuration code that tells your AI tool how to connect to and use the Mechanic MCP server. This configuration enables your AI assistant to automatically access Mechanic's task library and documentation when you ask questions.
Claude Desktop and Claude Code
For Claude Desktop:
Open the app and access your configuration file through settings
Add the JSON configuration below to your MCP servers section
Save and restart Claude Desktop
For Claude Code:
Run this command in your terminal:
claude mcp add --scope user --transport stdio mechanic-mcp -- npx -y @lightward/mechanic-mcp@latestRestart Claude Code to load the server
Manual JSON configuration (both):
{
"mcpServers": {
"mechanic-mcp": {
"command": "npx",
"args": ["-y", "@lightward/mechanic-mcp@latest"]
}
}
}Cursor
Open Cursor and go to Cursor > Settings > Cursor Settings > Tools and integrations > New MCP server.
Add this configuration to your MCP servers:
{
"mcpServers": {
"mechanic-mcp": {
"command": "npx",
"args": ["-y", "@lightward/mechanic-mcp@latest"]
}
}
}Save your configuration and restart Cursor.
Codex CLI
Add this configuration to your
~/.codex/config.tomlfile:
[mcp_servers.mechanic-mcp]
command = "npx"
args = ["-y", "@lightward/mechanic-mcp@latest"]Restart Codex to load the new MCP server configuration.
Gemini CLI
Add this configuration using the Gemini CLI:
{
"mcpServers": {
"mechanic-mcp": {
"command": "npx",
"args": ["-y", "@lightward/mechanic-mcp@latest"]
}
}
}Restart Gemini CLI to load the new MCP server configuration.
Available tools
The Mechanic MCP server provides the following tools:
search_tasks
search_tasksSearch across Mechanic's task library to find tasks matching your query. Returns task titles, descriptions, tags, subscriptions, and public URLs.
Best for discovering existing automation solutions before building custom tasks. Results include subscription event topics, task options, and tags for filtering.
Parameters:
query(required): Search terms to match against task titles, descriptions, and contentlimit(optional): Maximum number of results to return (default: 10, max: 50)offset(optional): Number of results to skip for pagination (default: 0)tags(optional): Filter by task tagssubscriptions(optional): Filter by event subscription topicsfuzzy(optional): Enable fuzzy matching for typo tolerancefuzzyMaxEdits(optional): Maximum edit distance for fuzzy matching (max: 2)
search_docs
search_docsSearch across all Mechanic documentation to find relevant pages matching your query. Returns documentation titles, paths, and public URLs.
Best for learning about Mechanic concepts, Liquid templating, actions, and platform features. Returns quick results from across the entire documentation site.
Parameters:
query(required): Search terms to match against documentation contentlimit(optional): Maximum number of results to return (default: 10, max: 50)offset(optional): Number of results to skip for pagination (default: 0)fuzzy(optional): Enable fuzzy matching for typo tolerance
get_task
get_taskRetrieve complete task details including subscriptions, Liquid script, options, and JavaScript blocks. Use this to see the full implementation of a specific task.
Parameters:
id(required): Task handle or ID (e.g., "auto-tag-customers-by-sales-channel" or "task:auto-tag-customers-by-sales-channel")
Returns:
Task metadata (name, tags, URL)
Event subscriptions and subscription template
Complete Liquid script
Task options with defaults
Online store JavaScript (if present)
Order status JavaScript (if present)
get_doc
get_docRetrieve the full content of a documentation page. Provides complete documentation context without chunking.
Parameters:
id(required): Documentation ID from search results (e.g., "doc:core/tasks/code/action-objects.md")
Returns:
Full markdown content
Documentation title and path
Public documentation URL
similar_tasks
similar_tasksFind tasks related to a specific task by analyzing shared tags, event subscriptions, and title similarity. Useful for discovering alternative approaches or complementary automations.
Parameters:
handle(required): Task handle or ID to find similar tasks forlimit(optional): Maximum number of similar tasks to return (default: 10)
refresh_index
refresh_indexRefresh and rebuild the search index from bundled data. Generally not needed as the server includes pre-built indexes.
Usage best practices
When working with your AI assistant and the Mechanic MCP server:
Discover before building: Search for existing tasks before creating custom solutions. The library contains 350+ battle-tested tasks.
Use GraphQL: Prefer Shopify's GraphQL Admin API in task code. REST is deprecated in Mechanic.
Reference public URLs: Always cite tasks using their public URLs (tasks.mechanic.dev) and docs using learn.mechanic.dev URLs.
Get full task details: Use
get_taskto see complete implementations, including subscriptions, scripts, and options.Find related work: Use
similar_tasksto discover alternative approaches or complementary automations.
Related resources
Task library - Browse and contribute to Mechanic's task library
Writing tasks - Learn how to write Mechanic tasks
Liquid templating - Mechanic's Liquid implementation
Actions - Available action types for tasks
Events and subscriptions - Understanding Mechanic's event system
Last updated
Was this helpful?