Content
# CATIA MCP Service
This is a CATIA automation service based on `pycatia`, providing a complete REST API interface for remote control and operation of CATIA.
## Features
- Complete CATIA operation API support
- RESTful API design
- JWT authentication protection
- Cross-origin support
- Comprehensive logging
- Type hinting support
- Exception handling mechanism
## Supported Functions
### 1. Document Operations
- Create new document (Part/Product/Drawing)
- Open document
- Save document
- Close document
### 2. Parameter Operations
- Get parameter list
- Set parameter value
### 3. Geometry Operations
- Create point
- Create line
- Create plane
### 4. Sketch Operations
- Create sketch
- Add lines
- Add circles
### 5. Feature Operations
- Create pad
- Create pocket
- Create revolution
### 6. Assembly Operations
- Add component
- Create constraint
### 7. Measurement Operations
- Measure distance
- Measure angle
- Measure area
- Measure volume
### 8. Analysis Operations
- Mass analysis
- Interference check
### 9. Engineering Drawing Operations
- Create view
- Add dimension
### 10. System Operations
- Get system information
## Installation Requirements
- Python 3.8+
- CATIA V5/V6
- pycatia 0.8.2+
- Other dependencies can be found in requirements.txt
## Installation Steps
1. Clone the repository:
```bash
git clone [repository_url]
cd catia-mcp-service
```
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Configure environment variables:
- Copy `.env.example` to `.env`
- Modify configuration parameters
## Run the Service
```bash
python catia_mcp_service.py
```
The service will start at http://localhost:5000
## API Usage Examples
### 1. Connect to CATIA
```python
import requests
# Get JWT token
response = requests.post('http://localhost:5000/api/catia/connect',
headers={'Authorization': f'Bearer {token}'})
```
### 2. Create New Document
```python
response = requests.post('http://localhost:5000/api/catia/document',
json={
'operation': 'create',
'doc_type': 'Part'
},
headers={'Authorization': f'Bearer {token}'})
```
### 3. Create Geometry
```python
# Create point
response = requests.post('http://localhost:5000/api/catia/geometry',
json={
'operation': 'point',
'x': 0,
'y': 0,
'z': 0
},
headers={'Authorization': f'Bearer {token}'})
```
## API Documentation
### Authentication
All API requests must include the JWT token in the header:
```
Authorization: Bearer <token>
```
### Main Endpoints
1. Connect to CATIA
- POST `/api/catia/connect`
2. Document Operations
- POST `/api/catia/document`
- operation: open/save/create/close
3. Parameter Operations
- GET `/api/catia/parameters`
- POST `/api/catia/parameters`
4. Geometry Operations
- POST `/api/catia/geometry`
- operation: point/line/plane
5. Sketch Operations
- POST `/api/catia/sketch`
- operation: create/add_line/add_circle
6. Feature Operations
- POST `/api/catia/feature`
- operation: pad/pocket/revolution
7. Assembly Operations
- POST `/api/catia/assembly`
- operation: add_component/create_constraint
8. Measurement Operations
- POST `/api/catia/measure`
- operation: distance/angle/area/volume
9. Analysis Operations
- POST `/api/catia/analysis`
- operation: mass/interference
10. Engineering Drawing Operations
- POST `/api/catia/drawing`
- operation: create_view/add_dimension
11. System Operations
- GET `/api/catia/system`
## Error Handling
All API responses follow this format:
```json
{
"status": "success/error",
"message": "Description of the operation result",
"data": {} // Optional, data returned on success
}
```
## Logging
Service runtime logs are saved in the `catia_mcp.log` file, containing the following information:
- Timestamp
- Log level
- Module name
- Message content
## Notes
1. Ensure CATIA is correctly installed and functioning
2. Obtain the JWT token before use
3. All API calls must include authentication information
4. Pay attention to handle error messages returned by the API
## Contribution Guidelines
1. Fork the project
2. Create a feature branch
3. Submit changes
4. Push to the branch
5. Create a Pull Request
## License
MIT License
## Contact
If you have any questions, please submit an Issue or contact the maintainer.
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.