# Craft MCP Server
A lightweight MCP (Model Context Protocol) server providing read access to [craft.io](https://craft.io).
## Installation
```bash
npm install
npm run build
```
## Configuration
Set the following environment variables:
```bash
export CRAFT_API_KEY="your-api-key"
export CRAFT_WORKSPACE_ID="your-workspace-id"
export CRAFT_ACCOUNT_ID="your-account-id"
export CRAFT_PORTAL_ID="your-portal-id" # optional
```
- **CRAFT_API_KEY**: Your craft.io API key
- **CRAFT_WORKSPACE_ID**: The workspace ID (used for `/workspace/{id}/items` endpoint)
- **CRAFT_ACCOUNT_ID**: The account ID (used for `/workspaces/{id}` endpoint to list workspaces)
## Usage
### With Claude Code
Add to your Claude Code MCP settings (`~/.claude/settings.json`):
```json
{
"mcpServers": {
"craft": {
"command": "node",
"args": ["/path/to/craft_mcp/dist/index.js"],
"env": {
"CRAFT_API_KEY": "your-api-key",
"CRAFT_WORKSPACE_ID": "your-workspace-id",
"CRAFT_ACCOUNT_ID": "your-account-id"
}
}
}
}
```
### Standalone
```bash
npm start
```
## Available Tools
| Tool | Description |
|------|-------------|
| `craft_ping` | Test connectivity to craft.io API |
| `craft_get_workspace` | Get workspace details |
| `craft_get_items` | Get items (products, features, etc.) from workspace |
| `craft_get_item` | Get a specific item by ID (e.g., `UPS-1234`) |
## Development
```bash
# Watch mode for development
npm run dev
# Build
npm run build
```
## License
MIT