
test_mcp_client
基于WebSocket的实时聊天应用,使用FastAPI、PostgreSQL和Redis构建。
Repository Info
About This Server
基于WebSocket的实时聊天应用,使用FastAPI、PostgreSQL和Redis构建。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Chat Client
A real-time chat application with WebSocket support, built with FastAPI, PostgreSQL, and Redis.
New here? Start with our WELCOME.md or .ai-ide-welcome.md for a quick overview and links to all onboarding resources!
Features
- Real-time chat using WebSocket connections
- User authentication with JWT tokens
- Message history and persistence
- Rate limiting and connection management
- Health monitoring and telemetry
- Comprehensive test suite
Project Structure
mcp_chat_client/
├── backend/ # FastAPI backend
│ ├── app/ # Application code
│ │ ├── api/ # API endpoints and routers
│ │ ├── core/ # Core functionality
│ │ ├── db/ # Database models and sessions
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ └── services/ # Business logic services
│ ├── tests/ # Test suite
│ ├── alembic/ # Database migrations
│ └── Dockerfile # Backend container definition
├── docker/ # Docker configuration
│ ├── dev/ # Development environment
│ └── test/ # Test environment
├── docker-compose.dev.yml # Development compose file
├── docker-compose.test.yml # Test compose file
└── .env.example # Environment variables template
Prerequisites
- Docker and Docker Compose
- Python 3.9+
- Node.js 16+ (for frontend development)
Quick Start
-
Clone the repository:
git clone https://github.com/yourusername/mcp_chat_client.git cd mcp_chat_client -
Copy the environment template:
cp .env.example .env -
Update the
.envfile with your configuration:- Set your database credentials
- Configure Redis settings
- Set up JWT secret key
- Configure API keys for AI services
-
Start the development environment:
docker compose -f docker-compose.dev.yml up -d -
Access the application:
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
Development
Backend Development
-
Install dependencies:
cd backend pip install -r requirements.txt pip install -r requirements-test.txt -
Run database migrations:
./run_migration.sh -
Start the development server:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Testing
-
Start the test environment:
docker compose -f docker-compose.test.yml up -d -
Run the test suite:
cd backend pytest -
Generate coverage report:
pytest --cov=app tests/
API Documentation
The API documentation is available at /docs when running the application. It includes:
- REST API endpoints
- WebSocket connection details
- Authentication requirements
- Request/response schemas
Environment Variables
See .env.example for all required environment variables. Key variables include:
- Database configuration (PostgreSQL)
- Redis settings
- JWT configuration
- WebSocket settings
- Test environment settings
- Monitoring configuration
- AI provider API keys
To set up your environment:
- Copy
.env.exampleto.envand fill in the values as needed. - Run
bash validate_env.shto check for missing or empty variables.
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Admin API
See docs/admin_endpoints.md for a full guide to all admin-only API endpoints, including usage tips and example requests.
- Troubleshooting & Environment Issues: docs/env_troubleshooting.md
- Known Issues: KNOWN_ISSUES.md
AI-IDE Onboarding API
To serve onboarding, rules, and knowledge graph data via HTTP for AI-IDE tools:
make -f Makefile.ai ai-ide-api-build # Build the Docker image
make -f Makefile.ai ai-ide-api-up # Start the API at http://localhost:8080
make -f Makefile.ai ai-ide-api-down # Stop the API
Example endpoints:
- http://localhost:8080/metadata
- http://localhost:8080/rules
- http://localhost:8080/knowledge-graph
Quick Start
Clone the repository
git clone https://github.com/the-great-abby/test_mcp_clientInstall dependencies
cd test_mcp_client
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.