The Multifunctional Computing Platform (MCP) Server is a robust backend service designed to support a variety of functionalities including file access, database connections, API integrations, and vector database access. This project is specifically tailored for integration with large language models like Qwen, providing a complete Docker deployment configuration and Qwen invocation examples.
mcp_server/
├── src/ # Source code directory
│ ├── __init__.py # Initialization module
│ ├── config.py # Configuration management
│ ├── server.py # Server main class
│ └── modules/ # Functional modules
│ ├── __init__.py # Module registration
│ ├── file_module.py # File access module
│ ├── database_module.py # Database connection module
│ ├── api_module.py # API integration module
│ └── vector_module.py # Vector database module
├── docker/ # Docker configuration
│ ├── Dockerfile # Docker image configuration
│ └── docker-compose.yml # Docker Compose configuration
├── examples/ # Example code
│ ├── qwen_client.py # Qwen client library
│ └── qwen_example.py # Qwen usage example
├── docs/ # Documentation
│ ├── user_guide.md # User guide
│ ├── api_docs.md # API documentation
│ └── qwen_examples.md # Qwen example instructions
├── test_server.py # Server test script
├── test_qwen_client.py # Qwen client test script
├── main.py # Main entry file
└── requirements.txt # Dependency list
git clone https://github.com/ningwenjie/mcp_server
cd mcp_server
docker-compose -f docker/docker-compose.yml up -d
curl http://localhost:8000/health
from examples.qwen_client import QwenMCPClient
# Initialize the client
client = QwenMCPClient("http://localhost:8000")
# Upload a file
file_info = client.upload_file("example.txt")
# Store a vector
vector = [0.1, 0.2, 0.3] * 512 # 1536-dimensional vector
metadata = {"text": "This is an example text", "source": "Qwen"}
vector_info = client.store_vector("qwen_embeddings", vector, metadata)
# Search vectors
query_vector = [0.15, 0.25, 0.35] * 512
search_results = client.search_vector("qwen_embeddings", query_vector, top_k=3)
For detailed documentation, please refer to:
Run the server tests:
python test_server.py
Run the Qwen client tests:
python test_qwen_client.py
For a detailed list of dependencies, please refer to requirements.txt
.