Metadata-Version: 2.1
Name: my-sse-http-custom-param-server
Version: 0.1.0
Summary: A custom MCP SSE HTTP Server with parameter support.
Author: MCP Demo
Author-email: mcp.demo@example.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Framework :: FastAPI
Description-Content-Type: text/markdown

# MCP SSE 服务器

这是一个基于Python Flask实现的MCP（Message Communication Protocol）服务器，支持SSE（Server-Sent Events）和自定义HTTP参数。

## 功能特点

- 基于SSE的实时消息推送
- 支持自定义客户端ID和消息类型
- 跨域支持（CORS）
- 内置测试页面

## 依赖要求

- Python 3.7+
- Flask 2.3.3
- Flask-CORS 4.0.0
- Gunicorn 21.2.0
- python-dotenv 1.0.0

## 安装说明

1. 安装依赖：
```bash
pip install -r requirements.txt
```

2. 运行服务器：
```bash
python main.py
```

服务器将在 http://localhost:5000 启动

## 使用方法

### 测试页面

访问 http://localhost:5000 可以看到内置的测试页面。

### SSE 接口

接口地址：`/events`

支持的URL参数：
- `client_id`: 客户端标识符
- `type`: 消息类型

示例：
```javascript
const eventSource = new EventSource('/events?client_id=client1&type=notification');

eventSource.onmessage = function(event) {
    const data = JSON.parse(event.data);
    console.log('收到消息:', data);
};
```

## 生产环境部署

使用Gunicorn启动服务：

```bash
gunicorn -w 4 -b 0.0.0.0:5000 main:app
```

## 注意事项

- 开发模式下默认启用了调试功能
- 生产环境部署时建议使用Gunicorn作为WSGI服务器
- 确保防火墙允许5000端口的访问
