# Storyblok Content Creator

An MCP (Model Context Protocol) server for AI interaction with Storyblok CMS, enabling automated content creation without manual intervention.

## Features

- 🚀 Create, read, update, and delete Storyblok stories
- 📁 Manage assets (upload, download, delete)
- 🧩 List and inspect components
- 🤖 Full AI integration through MCP protocol
- 🔒 Secure authentication with Storyblok Management API

## Installation

### Using npx (Recommended)

Add to your MCP configuration file (e.g., `~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "storyblok-content-creator": {
      "command": "npx",
      "args": [
        "-y",
        "sb-content-creator@latest",
        "--space-id",
        "YOUR_SPACE_ID",
        "--access-token",
        "YOUR_ACCESS_TOKEN"
      ]
    }
  }
}
```



## Configuration

### Required Parameters

- `--space-id`: Your Storyblok space ID
- `--access-token`: Your Storyblok Management API token

### Getting Credentials

1. Go to [Storyblok](https://app.storyblok.com/)
2. Navigate to **Settings → Access Tokens**
3. Create a new **Management API** token
4. Note your **Space ID** from the URL or settings

## Available Tools

### Stories

- `createStory` - Create a new story
- `updateStory` - Update existing story
- `deleteStory` - Delete a story
- `getStory` - Get story by ID
- `listStories` - List all stories with pagination

### Assets

- `uploadAsset` - Upload asset from URL
- `getAsset` - Get asset by ID
- `getAssets` - List all assets with pagination
- `deleteAsset` - Delete an asset
- `finishUpload` - Finalize asset upload

### Components

- `getComponents` - List all components in space

## Usage Example

Once configured in your MCP client (like Cursor), you can use natural language:

```
"Create a new blog post in Storyblok with title 'Hello World'"
"Upload an image from https://example.com/image.jpg to Storyblok"
"List all stories in my Storyblok space"
"Update story with ID 12345 and change the title"
```

## Development

### Prerequisites

- Node.js >= 18.0.0
- npm or yarn

### Setup

```bash
git clone https://github.com/varshavskiyTymur/sb-content-creator.git
cd sb-content-creator
npm install
npm run build
```

### Project Structure

```
sb-content-creator/
├── src/
│   ├── index.ts           # Entry point
│   ├── server/            # MCP server setup
│   ├── services/          # Storyblok API client
│   ├── tools/             # MCP tool definitions
│   └── types/             # TypeScript types
├── build/                 # Compiled output
└── package.json
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

MIT License - see [LICENSE](LICENSE) file for details

## Author

Leetio

## Links

- [GitHub Repository](https://github.com/varshavskiyTymur/sb-content-creator)
- [npm Package](https://www.npmjs.com/package/sb-content-creator)
- [Storyblok API Docs](https://www.storyblok.com/docs/api/management)
- [Model Context Protocol](https://modelcontextprotocol.io/)

## Support

For issues and questions, please use the [GitHub Issues](https://github.com/varshavskiyTymur/sb-content-creator/issues) page.
