Metadata-Version: 2.4
Name: vector-mcp
Version: 0.1.10
Summary: Integrate RAG into AI Agents via MCP Server. Supports multiple Vector database technologies.
Author-email: Audel Rouhi <knucklessg1@gmail.com>
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: Public Domain
Classifier: Environment :: Console
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastmcp>=2.12.4
Requires-Dist: sentence_transformers>=5.1.0
Requires-Dist: markdownify>=1.2.0
Requires-Dist: beautifulsoup4>=4.13.5
Requires-Dist: ebooklib>=0.19
Requires-Dist: html2text>=2025.4.15
Requires-Dist: ipython>=8.37.0
Requires-Dist: pypdf>=6.0.0
Requires-Dist: protobuf>=6.32.0
Requires-Dist: llama-index>=0.13.3
Requires-Dist: llama-index-llms-langchain>=0.7.0
Requires-Dist: llama-index-embeddings-huggingface>=0.6.0
Requires-Dist: chromadb>=1.0.20
Requires-Dist: llama-index-vector-stores-chroma>=0.5.2
Provides-Extra: pgvector
Requires-Dist: pgvector>=0.4.1; extra == "pgvector"
Requires-Dist: psycopg[binary]>=3.2.9; (platform_system == "Windows" or platform_system == "Darwin") and extra == "pgvector"
Requires-Dist: psycopg>=3.2.9; platform_system == "Linux" and extra == "pgvector"
Requires-Dist: llama-index-vector-stores-postgres>=0.6.4; extra == "pgvector"
Provides-Extra: chromadb
Requires-Dist: chromadb>=1.0.20; extra == "chromadb"
Requires-Dist: llama-index-vector-stores-chroma>=0.5.2; extra == "chromadb"
Provides-Extra: couchbase
Requires-Dist: couchbase>=4.4.0; extra == "couchbase"
Requires-Dist: llama-index-vector-stores-couchbase>=0.5.0; extra == "couchbase"
Provides-Extra: qdrant
Requires-Dist: qdrant-client>=1.15.1; extra == "qdrant"
Requires-Dist: fastembed>=0.7.3; extra == "qdrant"
Requires-Dist: llama-index-vector-stores-qdrant>=0.8.2; extra == "qdrant"
Provides-Extra: mongodb
Requires-Dist: pymongo>4.12.1; extra == "mongodb"
Requires-Dist: llama-index-vector-stores-mongodb>=0.8.0; extra == "mongodb"
Provides-Extra: all
Requires-Dist: fastmcp>=2.12.4; extra == "all"
Requires-Dist: sentence_transformers>=5.1.0; extra == "all"
Requires-Dist: markdownify>=1.2.0; extra == "all"
Requires-Dist: beautifulsoup4>=4.13.5; extra == "all"
Requires-Dist: ebooklib>=0.19; extra == "all"
Requires-Dist: html2text>=2025.4.15; extra == "all"
Requires-Dist: ipython>=8.37.0; extra == "all"
Requires-Dist: pypdf>=6.0.0; extra == "all"
Requires-Dist: protobuf>=6.32.0; extra == "all"
Requires-Dist: llama-index>=0.13.3; extra == "all"
Requires-Dist: llama-index-llms-langchain>=0.7.0; extra == "all"
Requires-Dist: llama-index-embeddings-huggingface>=0.6.0; extra == "all"
Requires-Dist: pgvector>=0.4.1; extra == "all"
Requires-Dist: psycopg>=3.2.9; extra == "all"
Requires-Dist: chromadb>=1.0.20; extra == "all"
Requires-Dist: couchbase>=4.4.0; extra == "all"
Requires-Dist: qdrant-client>=1.15.1; extra == "all"
Requires-Dist: fastembed>=0.7.3; extra == "all"
Requires-Dist: pymongo>4.12.1; extra == "all"
Requires-Dist: llama-index-vector-stores-mongodb>=0.8.0; extra == "all"
Requires-Dist: llama-index-vector-stores-qdrant>=0.8.2; extra == "all"
Requires-Dist: llama-index-vector-stores-couchbase>=0.5.0; extra == "all"
Requires-Dist: llama-index-vector-stores-chroma>=0.5.2; extra == "all"
Requires-Dist: llama-index-vector-stores-postgres>=0.6.4; extra == "all"
Dynamic: license-file

# Vector Database MCP Server

![PyPI - Version](https://img.shields.io/pypi/v/vector-mcp)
![PyPI - Downloads](https://img.shields.io/pypi/dd/vector-mcp)
![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/vector-mcp)
![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/vector-mcp)
![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/vector-mcp)
![PyPI - License](https://img.shields.io/pypi/l/vector-mcp)
![GitHub](https://img.shields.io/github/license/Knuckles-Team/vector-mcp)

![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/vector-mcp)
![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/vector-mcp)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/vector-mcp)
![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/vector-mcp)

![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/vector-mcp)
![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/vector-mcp)
![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/vector-mcp)
![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/vector-mcp)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/vector-mcp)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/vector-mcp)

*Version: 0.1.10*

This is an MCP Server implementation which allows for a standardized
collection management system across vector database technologies.

This was heavily inspired by the RAG implementation of Microsoft's Autogen V1 framework, however,
this was changed to an MCP server model instead.

AI Agents can:

- Create collections with documents stored on the local filesystem or URLs
- Add documents to a collection
- Utilize collection for retrieval augmented generation (RAG)
- Delete collection

Supports:

- ChromaDB
- PGVector - 90% Tested
- Couchbase - 80% Tested
- Qdrant - 80% Tested
- MongoDB - 80% Tested

This repository is actively maintained - Contributions and bug reports are welcome!

Automated tests are planned

<details>
  <summary><b>Usage:</b></summary>


### MCP CLI

| Short Flag | Long Flag                          | Description                                                                 |
|------------|------------------------------------|-----------------------------------------------------------------------------|
| -h         | --help                             | Display help information                                                    |
| -t         | --transport                        | Transport method: 'stdio', 'http', or 'sse' [legacy] (default: stdio)       |
| -s         | --host                             | Host address for HTTP transport (default: 0.0.0.0)                          |
| -p         | --port                             | Port number for HTTP transport (default: 8000)                              |
|            | --auth-type                        | Authentication type: 'none', 'static', 'jwt', 'oauth-proxy', 'oidc-proxy', 'remote-oauth' (default: none) |
|            | --token-jwks-uri                   | JWKS URI for JWT verification                                              |
|            | --token-issuer                     | Issuer for JWT verification                                                |
|            | --token-audience                   | Audience for JWT verification                                              |
|            | --oauth-upstream-auth-endpoint     | Upstream authorization endpoint for OAuth Proxy                             |
|            | --oauth-upstream-token-endpoint    | Upstream token endpoint for OAuth Proxy                                    |
|            | --oauth-upstream-client-id         | Upstream client ID for OAuth Proxy                                         |
|            | --oauth-upstream-client-secret     | Upstream client secret for OAuth Proxy                                     |
|            | --oauth-base-url                   | Base URL for OAuth Proxy                                                   |
|            | --oidc-config-url                  | OIDC configuration URL                                                     |
|            | --oidc-client-id                   | OIDC client ID                                                             |
|            | --oidc-client-secret               | OIDC client secret                                                         |
|            | --oidc-base-url                    | Base URL for OIDC Proxy                                                    |
|            | --remote-auth-servers              | Comma-separated list of authorization servers for Remote OAuth             |
|            | --remote-base-url                  | Base URL for Remote OAuth                                                  |
|            | --allowed-client-redirect-uris     | Comma-separated list of allowed client redirect URIs                       |
|            | --eunomia-type                     | Eunomia authorization type: 'none', 'embedded', 'remote' (default: none)   |
|            | --eunomia-policy-file              | Policy file for embedded Eunomia (default: mcp_policies.json)              |
|            | --eunomia-remote-url               | URL for remote Eunomia server                                              |

### Using as an MCP Server

The MCP Server can be run in two modes: `stdio` (for local testing) or `http` (for networked access). To start the server, use the following commands:

#### Run in stdio mode (default):
```bash
vector-mcp --transport "stdio"
```

#### Run in HTTP mode:
```bash
vector-mcp --transport "http"  --host "0.0.0.0"  --port "8000"
```

### Creating Collection
AI Prompt:
```text
Create a collection called zapdos with the documents in this directory:
/home/user/Documents/Chroma
```

AI Response:
```text
The collection named "zapdos" has been successfully created or retrieved from the vector database
using the documents in the directory /home/user/Documents/Chroma.
Let me know if you'd like to perform any further actions, such as querying the collection or adding more documents!
```

### Retrieving from Collection

AI Prompt:
```text
Create a collection called zapdos with the documents in this directory:
/home/user/Documents/Chroma
```

AI Response:
```text
The collection named "zapdos" has been successfully created or retrieved from the vector database
using the documents in the directory /home/user/Documents/Chroma.
Let me know if you'd like to perform any further actions, such as querying the collection or adding more documents!
```

### Deleting Collection

AI Prompt:
```text
Delete the collection called memory
```

AI Response:
```text
The collection named "memory" has been successfully deleted.
Let me know if you'd like to create a new collection or perform any other actions!
```

### Deploy MCP Server as a Service

The MCP server can be deployed using Docker, with configurable authentication, middleware, and Eunomia authorization.

#### Using Docker Run

```bash
docker pull knucklessg1/vector-mcp:latest

docker run -d \
  --name vector-mcp \
  -p 8004:8004 \
  -e HOST=0.0.0.0 \
  -e PORT=8004 \
  -e TRANSPORT=http \
  -e AUTH_TYPE=none \
  -e EUNOMIA_TYPE=none \
  knucklessg1/vector-mcp:latest
```

For advanced authentication (e.g., JWT, OAuth Proxy, OIDC Proxy, Remote OAuth) or Eunomia, add the relevant environment variables:

```bash
docker run -d \
  --name vector-mcp \
  -p 8004:8004 \
  -e HOST=0.0.0.0 \
  -e PORT=8004 \
  -e TRANSPORT=http \
  -e AUTH_TYPE=oidc-proxy \
  -e OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration \
  -e OIDC_CLIENT_ID=your-client-id \
  -e OIDC_CLIENT_SECRET=your-client-secret \
  -e OIDC_BASE_URL=https://your-server.com \
  -e ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/* \
  -e EUNOMIA_TYPE=embedded \
  -e EUNOMIA_POLICY_FILE=/app/mcp_policies.json \
  knucklessg1/vector-mcp:latest
```

#### Using Docker Compose

Create a `docker-compose.yml` file:

```yaml
services:
  vector-mcp:
    image: knucklessg1/vector-mcp:latest
    environment:
      - HOST=0.0.0.0
      - PORT=8004
      - TRANSPORT=http
      - AUTH_TYPE=none
      - EUNOMIA_TYPE=none
    ports:
      - 8004:8004
```

For advanced setups with authentication and Eunomia:

```yaml
services:
  vector-mcp:
    image: knucklessg1/vector-mcp:latest
    environment:
      - HOST=0.0.0.0
      - PORT=8004
      - TRANSPORT=http
      - AUTH_TYPE=oidc-proxy
      - OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration
      - OIDC_CLIENT_ID=your-client-id
      - OIDC_CLIENT_SECRET=your-client-secret
      - OIDC_BASE_URL=https://your-server.com
      - ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/*
      - EUNOMIA_TYPE=embedded
      - EUNOMIA_POLICY_FILE=/app/mcp_policies.json
    ports:
      - 8004:8004
    volumes:
      - ./mcp_policies.json:/app/mcp_policies.json
```

Run the service:

```bash
docker-compose up -d
```

#### Configure `mcp.json` for AI Integration

```json
{
  "mcpServers": {
    "vector_mcp": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "vector-mcp",
        "vector-mcp"
      ],
      "env": {
        "DATABASE_TYPE": "chromadb",                   // Optional
        "COLLECTION_NAME": "memory",                   // Optional
        "DOCUMENT_DIRECTORY": "/home/user/Documents/"  // Optional
      },
      "timeout": 300000
    }
  }
}

```

</details>

<details>
  <summary><b>Installation Instructions:</b></summary>

Install Python Package

```bash
python -m pip install vector-mcp
```

PGVector dependencies

```bash
python -m pip install vector-mcp[pgvector]
```

All

```bash
python -m pip install vector-mcp[all]
```

or

```bash
uv pip install --upgrade vector-mcp[all]
```



</details>

<details>
  <summary><b>Repository Owners:</b></summary>


<img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=Knucklessg1&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />

![GitHub followers](https://img.shields.io/github/followers/Knucklessg1)
![GitHub User's stars](https://img.shields.io/github/stars/Knucklessg1)
</details>

Special shoutouts to Microsoft Autogen V1 ♥️
