143 lines
3.3 KiB
Markdown
143 lines
3.3 KiB
Markdown
# Getting Started
|
|
|
|
Welcome to the Context7-style MCP System documentation!
|
|
|
|
## Overview
|
|
|
|
This system provides a self-hosted, local context7-compatible MCP (Model Context Protocol) solution using Docker containers. It enables you to:
|
|
|
|
- Ingest and index your own documents
|
|
- Perform semantic search on vector embeddings
|
|
- Integrate with MCP-enabled IDEs for intelligent tool interactions
|
|
|
|
## Architecture
|
|
|
|
```
|
|
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
│ Client │────▶│ docs-api │◀────│ docs-mcp │
|
|
│ (IDE/Tool) │ │ (FastAPI) │ │ (MCP Server)│
|
|
└─────────────┘ └─────────────┘ └─────────────┘
|
|
│
|
|
▼
|
|
┌─────────────┐
|
|
│ Qdrant │
|
|
│ (Vector DB) │
|
|
└─────────────┘
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
### 1. Start All Services
|
|
|
|
```bash
|
|
docker compose up -d --build
|
|
```
|
|
|
|
### 2. Verify Services Are Running
|
|
|
|
```bash
|
|
docker compose ps
|
|
```
|
|
|
|
You should see all three services in "Up" status:
|
|
- `qdrant` (port 6333)
|
|
- `docs-api` (port 8787)
|
|
- `docs-mcp` (port 8788)
|
|
|
|
### 3. Access the API
|
|
|
|
Open your browser and navigate to:
|
|
```
|
|
http://localhost:8787/docs
|
|
```
|
|
|
|
You should see the FastAPI documentation page.
|
|
|
|
## API Endpoints
|
|
|
|
### Health Check
|
|
|
|
```bash
|
|
curl http://localhost:8787/health
|
|
```
|
|
|
|
Expected response:
|
|
```json
|
|
{"status":"ok"}
|
|
```
|
|
|
|
### Ingest Document
|
|
|
|
Upload a text document to be processed and indexed:
|
|
|
|
```bash
|
|
curl -X POST "http://localhost:8787/api/v1/ingest" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"content": "This is sample document content for semantic search testing.",
|
|
"metadata": {"source": "example", "type": "text"}
|
|
}'
|
|
```
|
|
|
|
### Search Documents
|
|
|
|
Perform a similarity search on ingested documents:
|
|
|
|
```bash
|
|
curl "http://localhost:8787/api/v1/search" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"query": "semantic search",
|
|
"top_k": 5,
|
|
"threshold": 0.7
|
|
}'
|
|
```
|
|
|
|
## Configuration
|
|
|
|
### Environment Variables
|
|
|
|
Copy the example environment file and customize:
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
Key variables:
|
|
- `VECTOR_STORE_HOST`: Internal hostname of Qdrant (default: qdrant)
|
|
- `VECTOR_STORE_PORT`: Qdrant port (default: 6333)
|
|
|
|
### Docker Compose
|
|
|
|
All services are defined in `docker-compose.yml`. Key networking details:
|
|
- Services communicate internally via `context7-network`
|
|
- Qdrant uses service name `qdrant` for internal connections
|
|
- Vector store is exposed externally on port 6333 for debugging
|
|
|
|
## Next Steps
|
|
|
|
1. Review the project structure to understand component roles
|
|
2. Customize the backend API endpoints in `backend/app/main.py`
|
|
3. Implement MCP tools in `mcp-server/server.py`
|
|
4. Add more example documents in the `docs/` directory
|
|
|
|
## Troubleshooting
|
|
|
|
### Check Logs
|
|
|
|
```bash
|
|
docker compose logs -f docs-api
|
|
docker compose logs -f qdrant
|
|
docker compose logs -f docs-mcp
|
|
```
|
|
|
|
### Reset All Services
|
|
|
|
```bash
|
|
docker compose down -v
|
|
docker compose up -d --build
|
|
```
|
|
|
|
## Support
|
|
|
|
For issues, refer to the `README.md` or check the Qdrant documentation. |