A Model Context Protocol server that integrates with the Ravelry API, allowing AI assistants to search for and retrieve knitting and crochet patterns.
A Model Context Protocol (MCP) server that provides tools for interacting with the Ravelry API, allowing AI assistants to search for, explore, and retrieve knitting and crochet patterns.
This MCP server wraps the Ravelry API to create a reliable interface that can be used by AI assistants. It provides tools to:
This project was inspired by my girlfriend, whose passion for knitting and crochet encouraged me to create this bridge between AI assistants and the Ravelry crafting community. Since she's not very tech-savvy and somewhat skeptical about AI, this serves as my way of connecting with her interests and showing how technology can enhance her crafting experience rather than replace it.
Clone the repository
git clone cd ravelry-mcp
Install dependencies
npm install
Set up environment variables
# Create development environment file cp .env.example .env.development # Create production environment file cp .env.example .env.production
Configure API credentials
.env.development
and .env.production
files:
AUTH_USER=your_ravelry_username
AUTH_PASS=your_ravelry_password
npm run dev
This starts the MCP server in development mode with hot reload.
npm run build npm start
Or use the shorthand:
npm run prod
To add this MCP server to Claude Desktop and enable Ravelry browsing capabilities:
Start the MCP server Make sure your server is running locally or on a remote host that Claude Desktop can access.
Open Claude Desktop settings
Navigate to Extensions settings
4.1 Configure the MCP connection
Ravelry MCP
(or any name you prefer)http://localhost:3000
for local development)4.2 Alternative: Configure the MCP connection via command
"ravelry": { "command": "node", "args": [ "YOUR_CUSTOM_PATH/dist/index.js" ] }
Enable the MCP
Verify connection
Troubleshooting
Once connected, you can ask Claude to:
The server exposes several tools that can be used by AI assistants:
search-patterns
Searches for patterns based on query parameters.
Parameters:
query
: Search term (required)page
: Page number for pagination (default: 1)craft
: Craft type (e.g., "knitting", "crochet")availability
: Price filter (default: "free", options: "free", "ravelry", "online")get-pattern-details
Retrieves detailed information for a specific pattern.
Parameters:
id
: Pattern ID (required)get-multiple-pattern-details
Retrieves details for multiple patterns at once.
Parameters:
ids
: Array of pattern IDs (required)The server uses axios to make authenticated requests to the Ravelry API:
src/
โโโ class/
โ โโโ ravelry.class.ts # Main client for Ravelry API
โโโ endpoints/
โ โโโ getMultiplePatternDetails.ts # Get details for multiple patterns
โ โโโ getPatternDetails.ts # Get details for a single pattern
โ โโโ searchPatterns.ts # Search for patterns
โ โโโ index.ts # Endpoint exports
โโโ types/
โ โโโ patternDetailed.d.ts # Type definitions for detailed patterns
โ โโโ patternSimple.d.ts # Type definitions for simple patterns
โโโ index.ts # Entry point and MCP server setup
The server uses different environment files for development and production:
.env.development
- Used when running in development mode.env.production
- Used when running in production modeRun the test suite with:
npm test
# Run ESLint npm run lint # Fix ESLint errors npm run lint:fix # Format code with Prettier npm run format
When deploying to production:
.env.production
file contains valid Ravelry credentialsnpm run prod
to build and start the production serverThis project is licensed under the MIT License - see the LICENSE file for details.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!