# {{ project_name }}

{{ description }}

## Description

This is a ChatGPT app built using the OpenAI Apps SDK and MCP (Model Context Protocol).

## Features

{% if widgets %}
### Widgets

{% for widget in widgets %}
- **{{ widget.title }}** (`{{ widget.identifier }}`): {{ widget.response_text }}
{% endfor %}
{% else %}
No widgets configured yet. Add widgets using `create-chatgpt-app add-widget`.
{% endif %}

## Installation

1. Create a virtual environment:
```bash
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

## Running the Server

Start the development server:

```bash
python main.py
```

The server will be running at `http://{{ host }}:{{ port }}`

## Development

### Adding a New Widget

Use the scaffold CLI to add new widgets:

```bash
create-chatgpt-app add-widget --identifier my-widget --title "My Widget"
```

Or run it interactively:

```bash
create-chatgpt-app add-widget
```

### Project Structure

```
{{ project_name }}/
├── main.py              # Main MCP server implementation
├── requirements.txt     # Python dependencies
├── README.md           # This file
{% if include_docker %}
├── Dockerfile          # Docker configuration
├── .dockerignore       # Docker ignore patterns
{% endif %}
{% if include_tests %}
└── tests/              # Test files
    └── test_main.py
{% endif %}
```

## Testing

{% if include_tests %}
Run tests with pytest:

```bash
pip install pytest pytest-asyncio httpx
pytest
```
{% else %}
Install test dependencies first:

```bash
pip install pytest pytest-asyncio httpx
```

Then create tests in a `tests/` directory.
{% endif %}

## MCP Inspector

To test your MCP server with the MCP Inspector:

```bash
npm install -g @modelcontextprotocol/inspector
mcp-inspector
```

Then connect to `http://{{ host }}:{{ port }}/mcp`.

## Docker

{% if include_docker %}
Build the Docker image:

```bash
docker build -t {{ project_name }} .
```

Run the container:

```bash
docker run -p {{ port }}:{{ port }} {{ project_name }}
```
{% else %}
To add Docker support, create a `Dockerfile` in your project directory.
{% endif %}

## API Documentation

Once the server is running, visit:
- OpenAPI docs: `http://{{ host }}:{{ port }}/docs`
- ReDoc: `http://{{ host }}:{{ port }}/redoc`

## Resources

- [OpenAI Apps SDK Examples](https://github.com/openai/openai-apps-sdk-examples)
- [MCP Documentation](https://modelcontextprotocol.io/)
- [FastAPI Documentation](https://fastapi.tiangolo.com/)
- [ChatGPT App Scaffold](https://github.com/openai/openai-apps-sdk-examples/tree/main/create-chatgpt-app)

## License

MIT
