ContextMore is a FastAPI application for document embedding and semantic retrieval, powered by the Qdrant vector database. It allows you to embed documents from URLs (with or without authentication), chunk and vectorize their content, and perform semantic search over your knowledge base.
Many companies want to integrate their internal documentation / PRD with tools like Cursor, Copilot to make them easy to provide more context to the toolings, or other MCP clients. However, embedding documents into a centralized internal knowledge base often requires building complex workflows, and different teams use different sources of context.
ContextMore is designed to solve this problem by providing a simple, centralized context library that is accessible via API (for building internal tools) and is MCP server ready. The goal is not only to support document embedding, but also to eventually support internal repositories and code libraries (coming soon).
- Embed Documents: Extracts text from a given URL (supports authentication), splits it into chunks, generates embeddings, and stores them in Qdrant.
- Semantic Retrieval: Retrieve the most relevant document chunks or grouped documents based on a natural language query.
- Web UI: User-friendly web interface for embedding and searching documents.
- API Access: RESTful endpoints for programmatic access.
- MCP Server support: Supporting mcp server using fastapi-mcp.
- Python 3.8+
- Docker (for running Qdrant locally)
- (Optional) Qdrant server running locally or accessible via network
git clone git@github.com:prima101112/contextmore.git
cd contextmore
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
Create a .env
file in the root directory:
QDRANT_URL=localhost
QDRANT_PORT=6333
QDRANT_COLLECTION_NAME=contextmore
You can run Qdrant locally using Docker:
./runqdrant.sh
Or manually:
docker run -p 6333:6333 qdrant/qdrant
The fastest way to get ContextMore and Qdrant running together is with Docker Compose. Just run:
docker-compose up -d
This will automatically start both services and set up persistent storage for Qdrant in the qdrant/data
directory. Access ContextMore at http://localhost:8000.
uvicorn app.main:app --reload
Or, for graceful shutdown and advanced handling:
python run.py
The app will be available at http://localhost:8000.
GET /
— Home pageGET /embed
— Embed documents via web UIGET /retrieve
— Search and retrieve via web UI
-
POST /embed
— Embed a document from a URL
Request Body:{ "url": "https://example.com", "call_name": "Example Document", "auth_headers": { "headers": { "Authorization": "Bearer ..." } }, // optional "basic_auth": { "username": "user", "password": "pass" } // optional }
Response:
- Success message, document ID, and metadata.
-
POST /retrieve
— Retrieve information based on a query
Request Body:{ "query": "Your search query", "top_k": 5, // optional, default 5 "group_by_doc": true // optional, default true }
Response:
- List of relevant document chunks or grouped documents.
- Basic Auth: Provide username and password for HTTP Basic Authentication.
- Custom Headers: Supply any custom headers (e.g., Bearer tokens) for authenticated requests.
contextmore/
├── app/
│ ├── main.py # FastAPI application entry point
│ ├── config/
│ │ └── settings.py # Environment and model settings
│ ├── models/
│ │ └── schemas.py # Pydantic request/response models
│ ├── services/
│ │ ├── qdrant_service.py # Qdrant database operations
│ │ └── text_service.py # Text extraction, chunking, embedding
│ └── utils/ # (Reserved for future utilities)
├── static/ # Static files (logo, CSS, etc.)
├── templates/ # Jinja2 HTML templates for web UI
├── run.py # Custom server runner with graceful shutdown
├── runqdrant.sh # Script to run Qdrant via Docker
├── requirements.txt # Python dependencies
└── README.md # This documentation
curl -X POST "http://localhost:8000/embed" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "call_name": "Example"}'
curl -X POST "http://localhost:8000/retrieve" \
-H "Content-Type: application/json" \
-d '{"query": "Your query here", "top_k": 5}'
for embeding public urls just put the url on the API embed or from the UI
Embeding atlassian confluence workspace you need to know the ID and a personal api token as a password for confluence.
using basic auth to the url
https://{confluence url}/wiki/api/v2/pages?id={page-id}&body-format=storage
username : your email (usualy)
password : personal api token docs personal access token
put bthat on contextmore and your internal docs will be embeded
TODO
to use contextmore as mcp server once you deployed on local you could use as follows on your repected mcp clients
{
"mcpServers": {
"contextmore": {
"url": "http://localhost:8000/mcp"
}
}
}
If you want everyone in your organization to use ContextMore as a centralized MCP server, follow these steps:
-
Deploy ContextMore on a Shared Server
- Choose a reliable server (cloud VM, on-premise, or container platform) that is accessible to your organization.
- Run ContextMore using the instructions above (ensure Qdrant is also running and accessible).
-
Configure Network Access
- Open the necessary ports (default: 8000 for ContextMore, 6333 for Qdrant) so users and MCP clients can reach the server.
- Use a reverse proxy (like Nginx or Traefik) for HTTPS and domain-based access (e.g.,
https://contextmore.myorg.com
).
-
Secure the Deployment
- Protect the API and web UI with authentication (e.g., VPN, SSO, or API keys) to prevent unauthorized access.
- Consider running ContextMore and Qdrant behind your organization's firewall or VPN.
-
Share the MCP Server Endpoint
- Distribute the MCP server URL (e.g.,
https://contextmore.myorg.com
) to your team. - Users can add this endpoint to their MCP-compatible tools (like Cursor, Copilot, Claude Desktop, or custom clients).
- Distribute the MCP server URL (e.g.,
By deploying ContextMore as a shared MCP server, your entire organization can benefit from a unified, searchable, and extensible knowledge base accessible from any MCP-compatible tool.
This project contextmore is licensed under the Apache License 2.0.
This project includes software called contextmore developed by prima101112.
apreciate if you retain this notice in any distribution or derivative works :) but if not is ok.
ContextMore makes it easy to build your own knowledge base with semantic search and MCP ready, using only URLs and a vector database. For questions or contributions, please open an issue or pull request!