OpenAI Vector Store MCP Server

OpenAI Vector Store MCP Server

Enables semantic search and document retrieval from OpenAI Vector Store, allowing users to search documents using natural language queries and fetch complete document contents through ChatGPT.

Category
Visit Server

README

Sample MCP Server

이 프로젝트는 Model Context Protocol (MCP) 을 활용하여 ChatGPT와 연동되는 검색(Search)문서 조회(Fetch) 기능을 제공하는 샘플 서버입니다.
OpenAI Vector Store를 사용하여 문서 검색 및 전체 내용을 조회할 수 있으며, ChatGPT의 Deep Research 및 Chat Connectors 기능과 함께 사용할 수 있습니다.


✨ Features

  • Semantic Search
    OpenAI Vector Store를 사용한 벡터 기반 문서 검색
    자연어 쿼리를 지원하며 연관 문서를 스니펫 형태로 반환합니다.

  • Document Fetch
    검색된 문서의 ID로 전체 내용을 조회
    파일명, 본문 텍스트, URL, 메타데이터 포함

  • FastMCP 기반 MCP 서버
    ChatGPT MCP 표준에 맞춰 작성된 경량 서버
    SSE(Server-Sent Events)를 사용하여 ChatGPT와 통신

  • 환경 변수 기반 설정
    .env 파일로 API Key, Vector Store ID 관리


📁 Project Structure

.
├── server.py
├── requirements.txt
└── .env  (사용자가 직접 생성)

🔧 Requirements

Python 3.9+

설치 패키지는 requirements.txt 에 정의되어 있습니다.

예시:

fastmcp
openai
python-dotenv

⚙️ Setup

1. Repository 설치

git clone <your-repo-url>
cd <project-folder>

2. 가상환경 생성(선택)

python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

3. Dependencies 설치

pip install -r requirements.txt

4. .env 파일 생성

프로젝트 루트에 .env 파일을 만들고 아래 내용을 추가합니다:

OPENAI_API_KEY=your_openai_api_key
VECTOR_STORE_ID=your_vector_store_id

🚀 Running the Server

아래 명령어로 MCP 서버를 실행합니다.

python server.py

서버는 기본적으로 다음 주소에서 SSE 기반 MCP 서버로 동작합니다:

http://0.0.0.0:8000

ChatGPT(또는 Deep Research mode)에서 MCP 서버를 등록하면 Search 및 Fetch 도구를 사용할 수 있습니다.


🛠️ Tools

🔍 search(query: str)

벡터 스토어에서 쿼리와 관련된 문서를 검색합니다.

Response 예시:

{
  "results": [
    {
      "id": "file-xxxxx",
      "title": "example.pdf",
      "text": "문서의 앞부분 200자...",
      "url": "https://platform.openai.com/storage/files/file-xxxxx"
    }
  ]
}

📄 fetch(id: str)

문서의 ID를 받아 전체 내용을 반환합니다.

Response 예시:

{
  "id": "file-xxxxx",
  "title": "example.pdf",
  "text": "문서 전체 내용...",
  "url": "https://platform.openai.com/storage/files/file-xxxxx",
  "metadata": {}
}

📚 How It Works

  1. Search

    • openai.vector_stores.search() 호출
    • 연관 문서 목록 반환
  2. Fetch

    • vector_stores.files.content() 로 전체 텍스트 조각 가져오기
    • vector_stores.files.retrieve() 로 메타데이터 조회
    • 하나의 문서로 병합해 반환
  3. Server

    • FastMCP로 MCP-compliant 서버 생성
    • ChatGPT MCP 연결 모드에서 사용 가능

📝 Logging

기본 로그 레벨은 INFO로 설정되어 있으며, 검색/조회 요청과 서버 시작 정보를 출력합니다.


📄 License

이 프로젝트는 자유롭게 수정 및 확장하여 사용할 수 있는 샘플 코드입니다.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured