Skip to main content

MCP server for Katana Manufacturing ERP

Project description

Katana MCP Server

Model Context Protocol (MCP) server for Katana Manufacturing ERP.

Features

  • Inventory Management: Check stock levels, find low stock items, search products
  • Environment-based Authentication: Secure API key management
  • Built-in Resilience: Automatic retries, rate limiting, and pagination
  • Type Safety: Pydantic models for all requests and responses

Installation

pip install katana-mcp-server

Quick Start

1. Get Your Katana API Key

Obtain your API key from your Katana account settings.

2. Configure Environment

Create a .env file or set environment variable:

export KATANA_API_KEY=your-api-key-here

Or create .env file:

KATANA_API_KEY=your-api-key-here
KATANA_BASE_URL=https://api.katanamrp.com/v1  # Optional, uses default if not set

3. Use with Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "katana": {
      "command": "uvx",
      "args": ["katana-mcp-server"],
      "env": {
        "KATANA_API_KEY": "your-api-key-here"
      }
    }
  }
}

Restart Claude Desktop, and you'll see Katana inventory tools available!

4. Run Standalone (Optional)

For testing or development:

export KATANA_API_KEY=your-api-key
katana-mcp-server

Available Tools

check_inventory

Check stock levels for a specific product SKU.

Parameters:

  • sku (string, required): Product SKU to check

Example Request:

{
  "sku": "WIDGET-001"
}

Example Response:

{
  "sku": "WIDGET-001",
  "product_name": "Premium Widget",
  "available_stock": 150,
  "in_production": 50,
  "committed": 75
}

Use Cases:

  • "What's the current stock level for SKU WIDGET-001?"
  • "Check inventory for my best-selling product"
  • "How much stock do we have available for order fulfillment?"

list_low_stock_items

Find products below a specified stock threshold.

Parameters:

  • threshold (integer, optional, default: 10): Stock level threshold
  • limit (integer, optional, default: 50): Maximum items to return

Example Request:

{
  "threshold": 5,
  "limit": 20
}

Example Response:

{
  "items": [
    {
      "sku": "PART-123",
      "product_name": "Component A",
      "current_stock": 3,
      "threshold": 5
    },
    {
      "sku": "PART-456",
      "product_name": "Component B",
      "current_stock": 2,
      "threshold": 5
    }
  ],
  "total_count": 15
}

Use Cases:

  • "Show me products with less than 10 units in stock"
  • "What items need reordering?"
  • "Find critical low stock items (below 5 units)"

search_products

Search for products by name or SKU.

Parameters:

  • query (string, required): Search term (matches name or SKU)
  • limit (integer, optional, default: 20): Maximum results to return

Example Request:

{
  "query": "widget",
  "limit": 10
}

Example Response:

{
  "products": [
    {
      "id": 12345,
      "sku": "WIDGET-001",
      "name": "Premium Widget",
      "is_sellable": true,
      "stock_level": 150
    },
    {
      "id": 12346,
      "sku": "WIDGET-002",
      "name": "Economy Widget",
      "is_sellable": true,
      "stock_level": 200
    }
  ],
  "total_count": 2
}

Use Cases:

  • "Find all products containing 'widget'"
  • "Search for SKU PART-123"
  • "What products do we have in the electronics category?"

Configuration

Environment Variables

Advanced Configuration

The server uses the katana-openapi-client library with:

  • Automatic retries on rate limits (429) and server errors (5xx)
  • Exponential backoff with jitter
  • Transparent pagination for large result sets
  • 30-second default timeout

Troubleshooting

"KATANA_API_KEY environment variable is required"

Cause: API key not set in environment.

Solution: Set the environment variable or add to .env file:

export KATANA_API_KEY=your-api-key-here

"Authentication error: 401 Unauthorized"

Cause: Invalid or expired API key.

Solution: Verify your API key in Katana account settings and update the environment variable.

Tools not showing up in Claude Desktop

Cause: Configuration error or server not starting.

Solutions:

  1. Check Claude Desktop logs: ~/Library/Logs/Claude/mcp*.log
  2. Verify configuration file syntax (valid JSON)
  3. Test server standalone: katana-mcp-server (should start without errors)
  4. Restart Claude Desktop after configuration changes

Rate limiting (429 errors)

Cause: Too many requests to Katana API.

Solution: The server automatically retries with exponential backoff. If you see persistent rate limiting, reduce request frequency.

Development

Install from Source

git clone https://github.com/dougborg/katana-openapi-client.git
cd katana-openapi-client/katana_mcp_server
uv sync

Run Tests

# Unit tests only (no API key needed)
uv run pytest tests/ -m "not integration"

# All tests (requires KATANA_API_KEY)
export KATANA_API_KEY=your-key
uv run pytest tests/

Local Development

# Run server in development mode
uv run python -m katana_mcp

Version

Current version: 0.1.0a1 (alpha release)

This is an alpha release with 3 inventory management tools. Future releases will add:

  • Sales order management
  • Purchase order management
  • Manufacturing order management
  • Custom resources and prompts

Links

License

MIT License - see LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

katana_mcp_server-0.2.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

katana_mcp_server-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file katana_mcp_server-0.2.0.tar.gz.

File metadata

  • Download URL: katana_mcp_server-0.2.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for katana_mcp_server-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3a64a7c8c7f5e60756993fd3497ea7f368648d7b0ea65115576f4238e14f3372
MD5 3e60b9f5242812cc6ed30a8900190c0d
BLAKE2b-256 ee405f9b0fc8dba99f93d25001647916b7982dec9e51b7e8ae7563921343a6ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for katana_mcp_server-0.2.0.tar.gz:

Publisher: release.yml on dougborg/katana-openapi-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file katana_mcp_server-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for katana_mcp_server-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2b3a60308d30b9ba1dc4b0ec23e3d0a9c09f887708917404e0d3ad12c068b8e
MD5 38725f8a6ea3adefa97a55c89db21586
BLAKE2b-256 8f54b2e8d3987b2cfa8c89ee0156d9d2b7fff906b98d03c7db6d8427d4f541fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for katana_mcp_server-0.2.0-py3-none-any.whl:

Publisher: release.yml on dougborg/katana-openapi-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page