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 thresholdlimit(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
KATANA_API_KEY(required): Your Katana API keyKATANA_BASE_URL(optional): API base URL (default: https://api.katanamrp.com/v1)
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:
- Check Claude Desktop logs:
~/Library/Logs/Claude/mcp*.log - Verify configuration file syntax (valid JSON)
- Test server standalone:
katana-mcp-server(should start without errors) - 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
Prerequisites
- uv package manager - Install uv
- Python 3.12+ (for hot-reload mode)
Development Mode with Hot Reload ⚡
For rapid iteration during development, use hot-reload mode to see changes instantly without rebuilding or restarting:
# 1. Install dependencies
cd katana_mcp_server
uv sync
# 2. Install mcp-hmr (requires Python 3.12+)
uv pip install mcp-hmr
# 3. Run with hot reload
uv run mcp-hmr src/katana_mcp/server.py:mcp
Benefits:
- Edit code → Save → Changes apply instantly
- No rebuild, no reinstall, no restart needed
- Keep your Claude Desktop conversation context
- Iteration time: ~5 seconds instead of 5-10 minutes
Claude Desktop Configuration for Development:
{
"mcpServers": {
"katana-erp-dev": {
"comment": "Use full path to uv - find with: which uv",
"command": "/Users/YOUR_USERNAME/.local/bin/uv",
"args": ["run", "mcp-hmr", "src/katana_mcp/server.py:mcp"],
"cwd": "/absolute/path/to/katana-openapi-client/katana_mcp_server",
"env": {
"KATANA_API_KEY": "your-api-key-here"
}
}
}
}
Important:
- Replace
YOUR_USERNAMEwith your actual username - Run
which uvto find the correct uv path (usually~/.local/bin/uv) - Replace
/absolute/path/to/with your repository path - Hot reload requires Python >=3.12. For Python 3.11 users, use the production install method.
See DEVELOPMENT.md for the complete development guide.
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/
Build and Install Locally
# Build the package
uv build
# Install with pipx
pipx install --force dist/katana_mcp_server-*.whl
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
- Documentation: https://github.com/dougborg/katana-openapi-client
- Issue Tracker: https://github.com/dougborg/katana-openapi-client/issues
- PyPI: https://pypi.org/project/katana-mcp-server/
- Katana API: https://help.katanamrp.com/api/overview
License
MIT License - see LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file katana_mcp_server-0.5.0.tar.gz.
File metadata
- Download URL: katana_mcp_server-0.5.0.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
350f04265d1a401a7267c2f9916eae72512e5471dcc1af2d13edb674145a0947
|
|
| MD5 |
427805bfe7f9c57de8dcc7d10dbddd13
|
|
| BLAKE2b-256 |
065f8913c81b8d5847ce1d93c27e625c6a2aabea392f144e2c5b8d149d44bfc7
|
Provenance
The following attestation bundles were made for katana_mcp_server-0.5.0.tar.gz:
Publisher:
release.yml on dougborg/katana-openapi-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
katana_mcp_server-0.5.0.tar.gz -
Subject digest:
350f04265d1a401a7267c2f9916eae72512e5471dcc1af2d13edb674145a0947 - Sigstore transparency entry: 672856922
- Sigstore integration time:
-
Permalink:
dougborg/katana-openapi-client@d20997c6a8287659ca1ccc7ed4f487e4bd1816fb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dougborg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d20997c6a8287659ca1ccc7ed4f487e4bd1816fb -
Trigger Event:
push
-
Statement type:
File details
Details for the file katana_mcp_server-0.5.0-py3-none-any.whl.
File metadata
- Download URL: katana_mcp_server-0.5.0-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4aa21b3a481a33738ce2d06225a98074f9b202396a89925c37bbb81e054663f
|
|
| MD5 |
161fa9804cd1e0595088c522a076b9df
|
|
| BLAKE2b-256 |
231cc9d56a301e0fe570a65141529b02f179c131fe7108bfe721ac35e2cd29a2
|
Provenance
The following attestation bundles were made for katana_mcp_server-0.5.0-py3-none-any.whl:
Publisher:
release.yml on dougborg/katana-openapi-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
katana_mcp_server-0.5.0-py3-none-any.whl -
Subject digest:
a4aa21b3a481a33738ce2d06225a98074f9b202396a89925c37bbb81e054663f - Sigstore transparency entry: 672856924
- Sigstore integration time:
-
Permalink:
dougborg/katana-openapi-client@d20997c6a8287659ca1ccc7ed4f487e4bd1816fb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dougborg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d20997c6a8287659ca1ccc7ed4f487e4bd1816fb -
Trigger Event:
push
-
Statement type: